<?php
if (isset($tpl['status']) && $tpl['status'] == "OK")
{
	?>
	<div class="panel panel-default pjTbMain">
		<?php
		include_once dirname(__FILE__) . '/elements/header.php';
		?>
		<div class="panel-body pjTbBody">
			<section class="pjTbSectionCheckout">
				<div class="pjTbForm pjTbFormCheckout">
					<?php
					if (isset($tpl['booking_arr']))
					{ 
						?>
						<section class="pjTbFormSection">
							<p class="pjTbFormSectionTitle"><?php __('front_your_tickets');?></p><!-- /.pjTbFormSectionTitle -->
							<?php
							switch ($tpl['booking_arr']['payment_method'])
							{
								case 'paypal':
									if($tpl['option_arr']['o_payment_status'] == $tpl['booking_arr']['status'])
									{
										?><p><?php __('front_your_booking_completed');?></p><?php
									}else{
										?><p><?php __('front_redirect_payment');?></p><?php
										if (pjObject::getPlugin('pjPaypal') !== NULL)
										{
											$controller->requestAction(array('controller' => 'pjPaypal', 'action' => 'pjActionForm', 'params' => $tpl['params']));
										}
									}
									break;
								case 'authorize':
									if($tpl['option_arr']['o_payment_status'] == $tpl['booking_arr']['status'])
									{
										?><p><?php __('front_your_booking_completed');?></p><?php
									}else{
										?><p><?php __('front_redirect_payment');?></p><?php
										if (pjObject::getPlugin('pjAuthorize') !== NULL)
										{
											$controller->requestAction(array('controller' => 'pjAuthorize', 'action' => 'pjActionForm', 'params' => $tpl['params']));
										}
									}
									break;
								case 'bank':
									?><p><?php __('front_your_booking_completed');?></p><p><?php echo nl2br($tpl['option_arr']['o_bank_account']);?></p><?php
									break;
								case 'creditcard':
								case 'none':
								default:
									?><p><?php __('front_your_booking_completed');?></p><?php
							} 
							?>
						</section><!-- /.pjTbFormSection -->
						<?php
					}else{
						?>
						<section class="pjTbFormSection">
							
							<p><?php __('front_booking_not_exist');?></p>
						</section><!-- /.pjTbFormSection -->
						<?php
					} 
					?>
				</div><!-- /.pjTbForm pjTbFormCheckout -->
			</section><!-- /.pjTbSectionCheckout -->
		</div><!-- /.panel-body pjTbBody -->
	
		<footer class="panel-footer clearfix pjTbFooter">
			<a href="#" class="btn btn-primary pull-right pjEtsMenuItem" data-load="loadTickets"><?php __('front_btn_start_over');?></a>
		</footer><!-- /.panel-footer clearfix pjTbFooter -->
	</div><!-- /.panel panel-default pjTbMain -->
	<?php
} 
?>