<?php
include_once PJ_VIEWS_PATH . 'pjFront/elements/header.php';
?>
<div class="container-fluid pjMbContainer pjMbContent">
	<div id="pjCsCartContainer_<?php echo $_GET['index'];?>">
		<?php include_once PJ_VIEWS_PATH . 'pjFront/elements/cart.php';?>
	</div>
	
	<?php
	$option_arr = $tpl['option_arr'];
	$FORM = isset($_SESSION[$controller->defaultForm]) ? $_SESSION[$controller->defaultForm] : array();
	$delivery_date_arr = pjUtil::convertDateTime($FORM['delivery_date'] . ' ' . $FORM['delivery_time'], $option_arr['o_date_format'], 'h:i A');
	?>
	<form id="pjCsPreviewForm_<?php echo $_GET['index'];?>" name="pjCsPreviewForm" class="form-horizontal" action="" method="post" role="form" data-toggle="validator">
	
		<input type="hidden" name="cs_preview" value="1" />
		
		<div class="pjMbContentBody">
			<h2><?php __('front_your_details');?></h2>
		</div>
		
		<div id="pjCsCalendarLocale" style="display: none;" data-months="<?php echo implode("_", $months);?>" data-days="<?php echo implode("_", $short_days);?>"></div>
		
		<div class="form-group">
			<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_delivery_date');?></label>
			<div class="col-lg-5 col-md-5 col-sm-5">
				<label class="control-label text-muted"><?php echo date($option_arr['o_date_format'], $delivery_date_arr['ts']) . ', ' . date($option_arr['o_time_format'], $delivery_date_arr['ts']);?></label>
			</div>
		</div><!-- /.form-group -->
		
		<?php
		if (in_array($tpl['option_arr']['o_bf_include_title'], array(2, 3)))
		{
			$personal_titles = __('personal_titles', true);
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_title'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo $personal_titles[$FORM['c_title']];?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_name'], array(2, 3)))
		{
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_name'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_name']) ? htmlspecialchars(stripslashes(@$FORM['c_name'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_email'], array(2, 3)))
		{
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_email'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_email']) ? htmlspecialchars(stripslashes(@$FORM['c_email'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_phone'], array(2, 3)))
		{ 
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_phone'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_phone']) ? htmlspecialchars(stripslashes(@$FORM['c_phone'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_company'], array(2, 3)))
		{ 
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_company'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_company']) ? htmlspecialchars(stripslashes(@$FORM['c_company'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_address'], array(2, 3)))
		{
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_address'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_address']) ? htmlspecialchars(stripslashes(@$FORM['c_address'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_city'], array(2, 3)))
		{
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_city'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_city']) ? htmlspecialchars(stripslashes(@$FORM['c_city'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_state'], array(2, 3)))
		{ 
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_state'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_state']) ? htmlspecialchars(stripslashes(@$FORM['c_state'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_zip'], array(2, 3)))
		{ 
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_zip'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo isset($FORM['c_zip']) ? htmlspecialchars(stripslashes(@$FORM['c_zip'])) : NULL; ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_country'], array(2, 3)))
		{ 
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_country'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<?php
					if(isset($tpl['country_arr']['country_title']))
					{ 
						?><label class="control-label text-muted"><?php echo pjSanitize::html($tpl['country_arr']['country_title']); ?></label><?php
					}else{
						?><label class="control-label text-muted">&nbsp;</label><?php
					} 
					?>
				</div>
			</div><!-- /.form-group -->
			<?php
		}
		if (in_array($tpl['option_arr']['o_bf_include_notes'], array(2, 3)))
		{
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_notes'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="text-muted"><?php echo nl2br(pjSanitize::html(@$FORM['c_notes'])); ?></label>
				</div>
			</div><!-- /.form-group -->
			<?php
		} 
		?>
		<?php
		if($tpl['option_arr']['o_payment_disable'] == 'No')
		{
			$payment_methods = __('payment_methods', true);
			$cc_types = __('cc_types', true);
			?>
			<div class="form-group">
				<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_payment_medthod'); ?></label>
				<div class="col-lg-9 col-md-8 col-sm-8">
					<label class="control-label text-muted"><?php echo $payment_methods[$FORM['payment_method']]; ?></label>
				</div>
			</div><!-- /.form-group -->
			<div class="pjCsBankWrap" style="display: <?php echo isset($FORM['payment_method']) && $FORM['payment_method'] == 'bank' ? 'block' : 'none'; ?>">
				<div class="form-group">
					<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize">&nbsp;</label>
					<div class="col-lg-9 col-md-8 col-sm-8">
						<label class="control-label text-muted"><?php echo nl2br(pjSanitize::clean($tpl['option_arr']['o_bank_account']));?></label>
					</div>
				</div>
			</div>
			<div class="pjCsCCWrap" style="display: <?php echo isset($FORM['payment_method']) && $FORM['payment_method'] == 'creditcard' ? 'block' : 'none'; ?>">
				<div class="form-group">
					<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_cc_type'); ?></label>
					<div class="col-lg-9 col-md-8 col-sm-8">
						<label class="control-label text-muted"><?php echo $cc_types[$FORM['cc_type']]; ?></label>
					</div>
				</div><!-- /.form-group -->
				<div class="form-group">
					<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_cc_number'); ?></label>
					<div class="col-lg-9 col-md-8 col-sm-8">
						<label class="control-label text-muted"><?php echo pjSanitize::html(@$FORM['cc_num']); ?></label>
					</div>
				</div><!-- /.form-group -->
				<div class="form-group">
					<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_cc_exp'); ?></label>

					<div class="col-lg-5 col-md-4 col-sm-4 col-xs-4">
						<label class="control-label text-muted"><?php echo pjSanitize::html(@$FORM['cc_exp_month']); ?>/<?php echo pjSanitize::html(@$FORM['cc_exp_year']); ?></label>
					</div><!-- /.col-lg-5 col-md-4 col-sm-4 col-xs-4 -->
	
					<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
						
					</div><!-- /.col-lg-3 col-md-4 col-sm-4 col-xs-4 -->
				</div><!-- /.form-group -->
				<div class="form-group">
					<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize"><?php __('front_cc_code'); ?></label>
					<div class="col-lg-9 col-md-8 col-sm-8">
						<label class="control-label text-muted"><?php echo pjSanitize::html(@$FORM['cc_code']); ?></label>
					</div>
				</div><!-- /.form-group -->
			</div>
			<?php
		} 
		?>
		
		<div class="form-group">
			<label for="" class="col-lg-3 col-md-4 col-sm-4 control-label text-capitalize">&nbsp;</label>
			<div class="col-lg-9 col-md-8 col-sm-8">
				<button type="submit" class="btn btn-primary"><?php __('front_btn_preview_booking');?></button>
				<button type="button" class="btn pjCsCancelPreview"><?php __('front_btn_cancel');?></button>
			</div>
		</div>
		
	</form>
	
</div><!-- /.container-fluid pjMbContainer pjMbContent -->