<?php
$extra_per = __('extra_per',true);
$get = $controller->_get->raw();
$post = $controller->_post->raw();
?>
<div class="container-fluid pjCrContainer">
	<div class="panel panel-default">
		<?php include_once dirname(__FILE__) . '/elements/header.php';?>
		
		<div class="panel-body pjCrBody">
			<button class="btn btn-default text-capitalize pjCrBtnPannelTrigger visible-xs-block"><?php __('front_3_booking'); ?></button>
			<br class="visible-xs-inline" />
			
			<div class="row">
				<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 hidden-xs pjCrPanelLeft">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h1 class="panel-title"><?php __('front_3_booking'); ?></h1><!-- /.panel-title -->
						</div><!-- /.panel-heading -->

						<div class="panel-body">
							<p class="clearfix">
								<strong><?php __('front_3_when'); ?></strong>

								<a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="crBtnWhen" class="pull-right text-capitalize pjCrColorPrimary"><?php __('front_3_change'); ?></a>
							</p>

							<div class="row">
								<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text-muted"><?php __('front_3_pickup'); ?>:</span></div><!-- /.col-lg-5 col-md-5 col-sm-5 col-xs-12 -->

								<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
									<?php echo stripslashes($tpl['pickup_location']['name']); ?><br/>
									<?php 
									$dt_from = $_SESSION[$controller->default_product][$controller->default_order]['date_from'] . " " . $_SESSION[$controller->default_product][$controller->default_order]['hour_from'] . ":" . $_SESSION[$controller->default_product][$controller->default_order]['minutes_from'] . ":00";
									echo date($tpl['option_arr']['o_date_format'], strtotime($dt_from)).', '.date($tpl['option_arr']['o_time_format'], strtotime($dt_from)); 
									?>
									</div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->
							</div><!-- /.row -->

							<div class="row">
								<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text-muted"><?php __('front_3_return'); ?>:</span></div><!-- /.col-lg-5 col-md-5 col-sm-5 col-xs-12 -->

								<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
									<?php echo isset($tpl['return_location']['name']) ? stripslashes($tpl['return_location']['name']) : stripslashes($tpl['pickup_location']['name']); ?><br/>
									<?php
									$dt_to = $_SESSION[$controller->default_product][$controller->default_order]['date_to'] . " " . $_SESSION[$controller->default_product][$controller->default_order]['hour_to'] . ":" . $_SESSION[$controller->default_product][$controller->default_order]['minutes_to'] . ":00";
									echo date($tpl['option_arr']['o_date_format'], strtotime($dt_to)).', '.date($tpl['option_arr']['o_time_format'], strtotime($dt_to)); 
									?>
									</div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->
							</div><!-- /.row -->
							<?php
							$rental_hours = $_SESSION[$controller->default_product][$controller->default_order]['rental_hours'];
							$hours = $rental_hours %24;
							if($tpl['option_arr']['o_booking_periods'] == 'perday') 
							{
								$days = $_SESSION[$controller->default_product][$controller->default_order]['rental_days'];
								?>
								<div class="row">
									<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text-muted"><?php __('front_3_rental'); ?>:</span></div><!-- /.col-lg-5 col-md-5 col-sm-5 col-xs-12 -->
	
									<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12"><?php echo $days == 1 ? $days ." ". __('front_label_day',true) : $days ." ". __('front_3_days',true); ?><?php echo $days > 0 && $hours > 0 ? ' ' :'';?><?php echo $hours > 0 ?  $hours." ".__('front_3_hours',true) : ''?></div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->
								</div><!-- /.row -->
								<?php
							}else{
								$days = 0;
								if($hours == 0 )
								{
									$days = $rental_hours / 24;
								}else {
									$days = floor($rental_hours / 24);
								}
								?>
								<div class="row">
									<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text-muted"><?php __('front_3_rental_duration'); ?>:</span></div><!-- /.col-lg-5 col-md-5 col-sm-5 col-xs-12 -->
	
									<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12"><?php echo $rental_duration = $days > 0 ? ($days == 1 ? $days ." ". __('front_label_day',true) : $days ." ". __('front_3_days',true) ) : ''?><?php echo $days > 0 && $hours > 0 ? ' ' :'';?><?php echo $hours > 0 ?  $hours." ".__('front_3_hours',true) : ''?></div><!-- /.col-lg-7 col-md-7 col-sm-7 col-xs-12 -->
								</div><!-- /.row -->
								<?php
							} 
							?>

							<br />

							<p class="clearfix">
								<strong><?php __('front_3_choise'); ?></strong>

								<a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="crBtnChoise" class="pull-right text-capitalize pjCrColorPrimary"><?php __('front_3_change'); ?></a>
							</p>

							<div class="row">
								<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
									<img src="<?php echo is_file(@$tpl['type_arr']['thumb_path']) ? PJ_INSTALL_URL . $tpl['type_arr']['thumb_path'] : PJ_INSTALL_URL . PJ_IMG_PATH . 'frontend/dummy_1.png'; ?>" alt="" class="img-responsive"/>
								</div><!-- /.col-lg-4 col-md-4 col-sm-4 col-xs-4 -->

								<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
									<p><strong><?php echo stripslashes(@$tpl['type_arr']['name']); ?></strong></p>
									<p>(<?php __('front_3_example'); ?>: <?php echo stripslashes(@$tpl['type_arr']['example']['make'] . " " . @$tpl['type_arr']['example']['model']); ?>)</p>
								</div><!-- /.col-lg-8 col-md-8 col-sm-8 col-xs-8 -->
							</div><!-- /.row -->
						</div><!-- /.panel-body -->
					</div><!-- /.panel panel-default pjCrPanelLeft -->
				</div><!-- /.col-lg-4 col-md-4 col-sm-12 col-xs-12 pjCrPanelLeft -->

				<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 pjCrPanelRight">
					<?php
						if (!$_SESSION[$controller->default_product][$controller->default_order]['request']): ?>
						<div class="panel panel-default">
							<div class="panel-heading">
								<h1 class="panel-title"><?php __('front_3_payment'); ?></h1><!-- /.panel-title -->
							</div><!-- /.panel-heading -->
							<?php
							$rental_fee_detail = array();
							?>
							<div class="panel-body">
								<div class="table-responsive">
									<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
										<tr>
											<td class="col-lg-5 col-md-5 col-sm-5 col-xs-5" style="border-top: none;">
												<strong class="text-danger pjCrColorPrimary"><?php __('front_3_total_price'); ?></strong>
											</td>
											<td class="col-lg-5 col-md-5 col-sm-5 col-xs-5 text-right" style="border-top: none;"><?php echo pjCurrency::formatPrice($tpl['cart']['total_price']);?></td>
										</tr>
									</table><!-- /.table -->
								</div><!-- /.table-responsive -->
							</div><!-- /.panel-body -->
						</div><!-- /.panel panel-default -->
					<?php endif; ?>
				</div><!-- /.col-lg-8 col-md-8 col-sm-12 col-xs-12 pjCrPanelRight -->
			</div><!-- /.row -->
			
			<form id="crCheckoutForm" name="crCheckoutForm" class="pjCrFormCheckout" action="" method="post" role="form" data-toggle="validator">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h2 class="panel-title text-muted"><?php __('front_4_personal'); ?></h2><!-- /.panel-title text-muted -->
					</div><!-- /.panel-heading -->
				
					<div class="panel-body">
						<div class="row">
							<?php
							if (in_array($tpl['option_arr']['o_bf_include_title'], array(2, 3)))
							{
								$title_arr = pjUtil::getTitles();
								$name_titles = __('personal_titles', true, false);
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php __('front_4_title'); ?> <?php if ($tpl['option_arr']['o_bf_include_title'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<select name="c_title" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_title'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_title', true))); ?>">
											<option value=""><?php __('front_4_select_title'); ?></option>
											<?php
											foreach ($title_arr as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo $name_titles[$v]; ?></option><?php
											}
											?>
										</select>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_name'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php __('front_4_name'); ?> <?php if ($tpl['option_arr']['o_bf_include_name'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_name" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_name'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_name', true))); ?>" />
										
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							} 
							if (in_array($tpl['option_arr']['o_bf_include_email'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_email'); ?> <?php if ($tpl['option_arr']['o_bf_include_email'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" id="crEmail" name="c_email" class="form-control email<?php echo ($tpl['option_arr']['o_bf_include_email'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_email', true))); ?>" data-msg-email="<?php echo htmlspecialchars(stripslashes(__('front_4_v_email_invalid', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_phone'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_phone'); ?> <?php if ($tpl['option_arr']['o_bf_include_phone'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_phone" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_phone'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_phone', true))); ?>" />
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							} 
							?>
						</div><!-- /.row -->
						<?php
						if (in_array($tpl['option_arr']['o_bf_include_notes'], array(2, 3)))
						{
							?>
							<div class="row">
								<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<label for="" class="control-label"><?php  __('front_4_notes'); ?> <?php if ($tpl['option_arr']['o_bf_include_notes'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
									<textarea name="c_notes" rows="6"  class="form-control<?php echo ($tpl['option_arr']['o_bf_include_notes'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_notes', true))); ?>"></textarea>
									<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
								</div>
							</div><!-- /.row -->
							<?php
						}
						?>
					</div><!-- /.panel-body -->
				</div><!-- /.panel panel-default -->
				
				<div class="panel panel-default">
					<div class="panel-heading">
						<h2 class="panel-title text-muted"><?php  __('front_4_billing'); ?></h2><!-- /.panel-title text-muted -->
					</div><!-- /.panel-heading -->
				
					<div class="panel-body">
						<div class="row">
							<?php
							if (in_array($tpl['option_arr']['o_bf_include_company'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_company'); ?> <?php if ($tpl['option_arr']['o_bf_include_company'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_company" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_company'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_company', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_address'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_address'); ?> <?php if ($tpl['option_arr']['o_bf_include_address'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_address" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_address'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_address', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_city'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_city'); ?> <?php if ($tpl['option_arr']['o_bf_include_city'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_city" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_city'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_city', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_state'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_state'); ?> <?php if ($tpl['option_arr']['o_bf_include_state'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_state" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_state'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_state', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_zip'], array(2, 3)))
							{
								?>
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_zip'); ?> <?php if ($tpl['option_arr']['o_bf_include_zip'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<input type="text" name="c_zip" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_zip'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_zip', true))); ?>"/>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}
							if (in_array($tpl['option_arr']['o_bf_include_country'], array(2, 3)))
							{
								?>
								<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_country'); ?> <?php if ($tpl['option_arr']['o_bf_include_country'] == 3) : ?><span class="text-danger">*</span><?php endif; ?></label>
																	
										<select name="c_country" class="form-control<?php echo ($tpl['option_arr']['o_bf_include_country'] == 3) ? ' required' : NULL; ?>" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_country', true))); ?>">
											<option value=""><?php echo __('front_4_select_country'); ?></option>
											<?php
											foreach ($tpl['country_arr'] as $country)
											{
												?><option value="<?php echo $country['id']; ?>"><?php echo stripslashes($country['country_title']); ?></option><?php
											}
											?>
										</select>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
								<?php
							}  
							?>
						</div><!-- /.row -->
					</div><!-- /.panel-body -->
				</div><!-- /.panel panel-default -->
				<?php
				if ($tpl['option_arr']['o_payment_disable'] == '0' && !$_SESSION[$controller->default_product][$controller->default_order]['request'])
				{ 
					?>
					<div class="panel panel-default">
						<div class="panel-heading">
							<h2 class="panel-title text-muted"><?php  __('front_4_payment'); ?> </h2><!-- /.panel-title text-muted -->
						</div><!-- /.panel-heading -->
					
						<div class="panel-body">
							<div class="row">
								<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_payment'); ?> <span class="text-danger">*</span></label>
										<?php
										$plugins_payment_methods = pjObject::getPlugin('pjPayments') !== NULL? pjPayments::getPaymentMethods(): array();
										$haveOnline = $haveOffline = false;
										foreach ($tpl['payment_titles'] as $k => $v)
										{
										    if($k == 'creditcard') continue;
										    if (array_key_exists($k, $plugins_payment_methods))
										    {
										        if(!isset($tpl['payment_option_arr'][$k]['is_active']) || (isset($tpl['payment_option_arr']) && $tpl['payment_option_arr'][$k]['is_active'] == 0) )
										        {
										            continue;
										        }
										    }else if( (isset($tpl['option_arr']['o_allow_'.$k]) && (int) $tpl['option_arr']['o_allow_'.$k] == 0) || $k == 'cash' || $k == 'bank' ){
										        continue;
										    }
										    $haveOnline = true;
										    break;
										}
										foreach ($tpl['payment_titles'] as $k => $v)
										{
										    if($k == 'creditcard') continue;
										    if( $k == 'cash' || $k == 'bank' )
										    {
										        if( (isset($tpl['option_arr']['o_allow_'.$k]) && (int )$tpl['option_arr']['o_allow_'.$k] == 1))
										        {
										            $haveOffline = true;
										            break;
										        }
										    }
										}
										?>							
										<select name="payment_method" class="form-control required" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_payment', true))); ?>">
											<option value=""><?php echo __('front_4_select_payment'); ?></option>
											<?php
											if ($haveOnline && $haveOffline)
											{
											    ?><optgroup label="<?php __('script_online_payment_gateway', false, true); ?>"><?php
						                    }
						                    foreach ($tpl['payment_titles'] as $k => $v)
						                    {
						                        if($k == 'creditcard') continue;
						                        if (array_key_exists($k, $plugins_payment_methods))
						                        {
						                            if(!isset($tpl['payment_option_arr'][$k]['is_active']) || (isset($tpl['payment_option_arr']) && $tpl['payment_option_arr'][$k]['is_active'] == 0) )
						                            {
						                                continue;
						                            }
						                        }else if( (isset($tpl['option_arr']['o_allow_'.$k]) && (int) $tpl['option_arr']['o_allow_'.$k] == 0) || $k == 'cash' || $k == 'bank' ){
						                            continue;
						                        }
						                        ?><option value="<?php echo $k; ?>"<?php echo isset($FORM['payment_method']) && $FORM['payment_method']==$k ? ' selected="selected"' : NULL;?>><?php echo $v; ?></option><?php
						                    }
						                    if ($haveOnline && $haveOffline)
						                    {
						                        ?>
						                    	</optgroup>
						                    	<optgroup label="<?php __('script_offline_payment', false, true); ?>">
						                    	<?php 
						                    }
						                    foreach ($tpl['payment_titles'] as $k => $v)
						                    {
						                        if($k == 'creditcard') continue;
						                        if( $k == 'cash' || $k == 'bank' )
						                        {
						                            if( (isset($tpl['option_arr']['o_allow_'.$k]) && (int) $tpl['option_arr']['o_allow_'.$k] == 1))
						                            {
						                                ?><option value="<?php echo $k; ?>"<?php echo isset($FORM['payment_method']) && $FORM['payment_method']==$k ? ' selected="selected"' : NULL;?>><?php echo $v; ?></option><?php
						                            }
						                        }
						                    }
						                    if ($haveOnline && $haveOffline)
						                    {
						                        ?></optgroup><?php
						                    }
											?>
										</select>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
							</div><!-- /.row -->
							
							<br />

							<div id="crStripeData" style="display: none">
								<input type="hidden" name="stripe_payment_txn_id" id="stripe_payment_txn_id" />
								<div>
									<label class="crLabel">&nbsp;</label>
									<div class="pjCrStripeCardElementWrapper">
										<!-- placeholder for Elements -->
										<div id="pjCrStripeCardElement"></div>

										<!-- Used to display form errors. -->
										<div class="pjCrStripeCardError" id="pjCrStripeCardErrors"></div>
									</div>
								</div>
								<br class="crClearBoth" />
							</div>
							
							<div id="crBankData" style="display:none">
								<div class="crLeft100">
									<p>
										<strong><?php __('front_4_bank_account'); ?> </strong>
									</p>
									<p><?php echo pjSanitize::html($tpl['bank_account']); ?></p>
								</div>
							</div>
							
							<div id="crCCData" style="display: none" class="row">
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php  __('front_4_cc_type'); ?> <span class="text-danger">*</span></label>
																	
										<select name="cc_type" class="form-control required" data-msg-required="<?php echo htmlspecialchars(__('front_4_v_cc_type', true)); ?>">
											<option value="">---</option>
											<?php
											foreach (__('front_4_cc_types',true) as $k => $v)
											{
												if (isset($post['cc_type']) && $post['cc_type'] == $k)
												{
													?><option value="<?php echo $k; ?>" selected="selected"><?php echo $v; ?></option><?php
												} else {
													?><option value="<?php echo $k; ?>"><?php echo $v; ?></option><?php
												}
											}
											?>
										</select>
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
							
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php echo __('front_4_cc_num'); ?> <span class="text-danger">*</span></label>
																	
										<input type="text" name="cc_num" class="form-control required" data-msg-required="<?php echo htmlspecialchars(__('front_4_v_cc_num', true)); ?>" />
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
							
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group pjCrDatePicker">
										<label for="" class="control-label"><?php echo __('front_4_cc_exp'); ?> <span class="text-danger">*</span></label>
																	
										<input type="text" name="cc_exp" class="form-control required" data-msg-required="<?php echo htmlspecialchars(__('front_4_v_cc_exp', true)); ?>" />
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group pjCrDatePicker -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
							
								<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
									<div class="form-group">
										<label for="" class="control-label"><?php echo __('front_4_cc_code'); ?> <span class="text-danger">*</span></label>
																	
										<input type="text" name="cc_code" class="form-control required" data-msg-required="<?php echo htmlspecialchars(__('front_4_v_cc_code', true)); ?>" />
										<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
									</div><!-- /.form-group -->
								</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
							</div><!-- /.row -->
						</div><!-- /.panel-body -->
					</div><!-- /.panel panel-default -->
					<?php
				}
				if (in_array($tpl['option_arr']['o_bf_include_captcha'], array(2, 3)))
				{ 
					?>
					<div class="panel panel-default">
						<div class="panel-heading">
							<h2 class="panel-title text-muted"><?php echo __('front_4_captcha'); ?></h2><!-- /.panel-title text-muted -->
						</div><!-- /.panel-heading -->
					
						<div class="panel-body">
							<div class="form-group">
								<?php
								if($tpl['option_arr']['o_captcha_type_front'] == 'system')
								{
    								?>
									<div class="row">
										<div class="col-lg-6 col-md-6 col-sm-6 col-sx-12">
											<input type="text" id="pjAsCaptchaField" name="captcha" class="form-control<?php echo (int) $tpl['option_arr']['o_bf_include_captcha'] === 3 ? ' required' : NULL; ?>" maxlength="<?php echo $tpl['option_arr']['o_captcha_mode_front'] == 'string'? (int) $tpl['option_arr']['o_captcha_length_front']: 10 ?>" autocomplete="off" data-msg-required="<?php __('front_4_v_captcha', false, true); ?>" data-msg-remote="<?php __('front_4_v_captcha_incorrect', false, true); ?>" />
										</div>
										<div class="col-lg-6 col-md-6 col-sm-6 col-sx-12">
											<img id="pjAsCaptchaImage" alt="Captcha" src="<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&action=pjActionCaptcha&rand=<?php echo rand(1000, 999999); ?>&session_id=<?php echo $controller->_get->check('session_id') ? pjObject::escapeString($controller->_get->toString('session_id')) : NULL;?>" style="vertical-align: middle; cursor: pointer;" />
										</div>
									</div>
									<?php 
								} else {
									?>
								    <div id="g-recaptcha" class="g-recaptcha" data-sitekey="<?php echo $tpl['option_arr']['o_captcha_site_key_front'] ?>"></div>
									<input type="hidden" id="recaptcha" name="recaptcha" class="recaptcha<?php echo ($tpl['option_arr']['o_bf_include_captcha'] == 3) ? ' required' : NULL; ?>" autocomplete="off" data-msg-required="<?php __('front_4_v_captcha');?>" data-msg-remote="<?php __('front_4_v_captcha_incorrect');?>"/>
									<?php 
								}
								?>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div>
						</div><!-- /.panel-body -->
					</div><!-- /.panel panel-default -->
					<?php
				} 
				?>
				
				<div class="panel panel-default">
					<div class="panel-heading">
						<h2 class="panel-title text-muted"><?php echo __('front_4_terms'); ?></h2><!-- /.panel-title text-muted -->
					</div><!-- /.panel-heading -->
				
					<div class="panel-body">
						<div class="form-group">
							<div class="checkbox">
								<label><input type="checkbox" name="c_agree" value="1" class="required" data-msg-required="<?php echo htmlspecialchars(stripslashes(__('front_4_v_agree', true))); ?>" /> <?php echo __('front_4_agree'); ?></label>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.checkbox -->
						</div><!-- /.form-group -->
						<?php
						if(!empty($tpl['term_arr'][0]['content']))
						{ 
							?>
							<a href="#" class="pjCrColorPrimary" data-toggle="modal" data-target="#myModal"><?php echo __('front_4_click'); ?></a>
							<?php
						} 
						?>
						<br />
						<br />
						<input type="button" value="<?php  __('front_btn_back'); ?>" id="crBtnBack" class="btn btn-default text-capitalize pjCrBtntDefault" />	
						<input type="submit" value="<?php  __('front_btn_confirm'); ?>" id="crBtnConfirm" class="btn btn-default pull-right text-capitalize pjCrBtntDefault crBtnConfirm" />
						
						<div class="crError text-danger text-center" style="display: none;"></div>
					</div><!-- /.panel-body -->
				</div><!-- /.panel panel-default -->
			</form><!-- /.pjCrFormCheckout -->
		</div><!-- /.panel-body pjCrBody -->
		
	</div><!-- /.panel panel-default -->
</div><!-- /.container-fluid pjCrContainer -->