<div class="panel panel-default pjErBody pjErCheckout">
	<div class="panel-body">
		<?php
		if (isset($tpl['status']) && $tpl['status'] == 'OK')
		{ 
			include PJ_VIEWS_PATH . 'pjFrontEnd/elements/summary.php';
			$FORM = @$_SESSION[$controller->defaultForm];
			?>
			<div class="pjErCheckoutBody">
				<?php
				ob_start();
				$number_of_cols = 0;
				if (in_array((int) $tpl['option_arr']['o_bf_name'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_name'); ?><?php echo (int) $tpl['option_arr']['o_bf_name'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_name']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_email'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_email'); ?><?php echo (int) $tpl['option_arr']['o_bf_email'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_email']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_phone'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_phone'); ?><?php echo (int) $tpl['option_arr']['o_bf_phone'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_phone']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_address_1'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_address_1'); ?><?php echo (int) $tpl['option_arr']['o_bf_address_1'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_address_1']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_address_2'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_address_2'); ?><?php echo (int) $tpl['option_arr']['o_bf_address_2'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_address_2']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_country'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_country'); ?><?php echo (int) $tpl['option_arr']['o_bf_country'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$tpl['country_arr']['name']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_state'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_state'); ?><?php echo (int) $tpl['option_arr']['o_bf_state'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_state']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_city'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_city'); ?><?php echo (int) $tpl['option_arr']['o_bf_city'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_city']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				if($number_of_cols == 3)
				{
					$ob_fields = ob_get_contents();
					ob_end_clean();
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
					ob_start();
					$number_of_cols = 0;
				}
				if (in_array((int) $tpl['option_arr']['o_bf_zip'], array(2,3)))
				{
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="form-group">
							<label for="" class="control-label"><?php __('booking_zip'); ?><?php echo (int) $tpl['option_arr']['o_bf_zip'] === 3 ? ' *' : NULL;?></label>
							<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_zip']); ?></p>
						</div><!-- /.form-group -->
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					<?php
					$number_of_cols++;
				}
				$ob_fields = ob_get_contents();
				ob_end_clean();
				if(!empty($ob_fields))
				{
					?>
					<div class="row"><?php echo $ob_fields; ?></div>
					<?php
				}
				if (in_array((int) $tpl['option_arr']['o_bf_notes'], array(2,3)))
				{
					?>
					<div class="row">
						<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_notes'); ?><?php echo (int) $tpl['option_arr']['o_bf_notes'] === 3 ? ' *' : NULL;?></label>
								<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['c_notes']); ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					</div>
					<?php
				}
				if ((int) $tpl['option_arr']['o_disable_payments'] === 0)
				{					
					$pm = __('payment_methods', true);
					$ct = __('booking_cc_types', true);
					?>
					<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 __('booking_payment_method'); ?> *</label>
								<p class="form-control-static"><?php echo @$pm[$FORM['payment_method']];; ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
						<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 erSelectorBank" style="display: <?php echo @$FORM['payment_method'] != 'bank' ? 'none' : NULL; ?>">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_bank_account'); ?></label>
								<p class="form-control-static"><?php echo nl2br(stripslashes($tpl['option_arr']['o_bank_account'])); ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
						
						<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 erSelectorCCard" style="display: <?php echo @$FORM['payment_method'] != 'creditcard' ? 'none' : NULL; ?>">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_cc_type'); ?> *</label>
								<p class="form-control-static"><?php echo @$ct[$FORM['cc_type']]; ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
						<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 erSelectorCCard" style="display: <?php echo @$FORM['payment_method'] != 'creditcard' ? 'none' : NULL; ?>">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_cc_num'); ?> *</label>
								<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['cc_num']); ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					</div>
					<div class="row">
						<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 erSelectorCCard" style="display: <?php echo @$FORM['payment_method'] != 'creditcard' ? 'none' : NULL; ?>">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_cc_code'); ?> *</label>
								<p class="form-control-static"><?php echo pjSanitize::html(@$FORM['cc_code']); ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
						<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 erSelectorCCard" style="display: <?php echo @$FORM['payment_method'] != 'creditcard' ? 'none' : NULL; ?>">
							<div class="form-group">
								<label for="" class="control-label"><?php __('booking_cc_exp'); ?> *</label>
								<p class="form-control-static"><?php printf("%s/%s", $FORM['cc_exp_month'], $FORM['cc_exp_year']); ?></p>
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
					</div>
					<?php
				} 
				?>
			</div><!-- /.pjErCheckoutBody -->

			<footer class="pjErCheckoutFoot">
				<form action="" method="post" class="erSelectorPreviewForm">
					<input type="hidden" name="er_preview" value="1" />
					<div class="clearfix pjErCheckoutActions">
						<a href="<?php echo pjUtil::getReferer(); ?>#!/Checkout" class="btn btn-default pull-left pjErBtn pjErBtnSecondary erSelectorCheckout"><?php __('button_back'); ?></a>
	
						<button type="submit" class="btn btn-default pull-right pjErBtn erSelectorButton pjErBtnPrimary"><?php __('button_confirm'); ?></button>
					</div><!-- /.clearfix pjErCheckoutActions -->
					<div><input type="hidden" name="er_validate" value="1" /></div>
				</form>
			</footer><!-- /.pjErCheckoutFoot -->
			<?php
		} elseif (isset($tpl['status']) && $tpl['status'] == 'ERR') { 
			if (isset($tpl['code']))
			{
				switch ($tpl['code'])
				{
					case 101:
						__('co_empty_notice');
						break;
					case 102:
						__('preview_empty_notice');
						break;
					case 104:
						__('accept_bookings_notice');
						break;
				}
			}
		}
		?>
	</div><!-- /.panel-body -->
</div><!-- /.panel panel-default pjErBody pjErCheckout -->