<?php
$titles = __('error_titles', true);
$bodies = __('error_bodies', true);
$months = __('months', true);
ksort($months);
$short_days = __('short_days', true);
$bs = __('booking_statuses', true);
$get = $controller->_get->raw();
?>
<div class="row wrapper border-bottom white-bg page-heading">
	
	<div class="col-sm-12 export-page-heading">
		<div class="row">
			<div class="col-sm-10">
				<h2><?php echo @$titles['AR21'];?></h2>
			</div>
		</div><!-- /.row -->

		<p class="m-b-none"><i class="fa fa-info-circle"></i><?php echo @$bodies['AR21'];?></p>
	</div><!-- /.col-md-12 -->
</div>

<div class="wrapper wrapper-content animated fadeInRight">
	<?php
	$error_code = $controller->_get->toString('err');
	if (!empty($error_code))
	{
		switch (true)
		{
			case in_array($error_code, array('AR01', 'AR03')):
				?>
				<div class="alert alert-success">
					<i class="fa fa-check m-r-xs"></i>
					<strong><?php echo @$titles[$error_code]; ?></strong>
					<?php echo @$bodies[$error_code];?>
				</div>
				<?php 
				break;
			case in_array($error_code, array('AR04', 'AR08', 'AR09', 'AR10')):	
				?>
				<div class="alert alert-danger">
					<i class="fa fa-exclamation-triangle m-r-xs"></i>
					<strong><?php echo @$titles[$error_code]; ?></strong>
					<?php echo @$bodies[$error_code];?>
				</div>
				<?php
				break;
		}
	} 
	?>
	<div class="tabs-container tabs-reservations m-b-lg">
		<ul class="nav nav-tabs" role="tablist">
			<?php if (pjAuth::factory('pjAdminBookings', 'pjActionIndex')->hasAccess()) { ?>
			<li role="presentation"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminBookings&amp;action=pjActionIndex" class="nav-tab" aria-controls="bookings" role="tab"><?php __('tabBookings');?></a></li>
			<?php } ?>
			<?php if (pjAuth::factory('pjAdminBookings', 'pjActionExportBookings')->hasAccess()) { ?>
				<li role="presentation" class="active"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminBookings&amp;action=pjActionExportBookings" class="nav-tab" aria-controls="export" role="tab"><?php __('tabExport');?></a></li>
			<?php } ?>
		</ul>

		<div class="tab-content">
			
			<?php if (pjAuth::factory('pjAdminBookings', 'pjActionExportBookings')->hasAccess()) { ?>
				<div role="tabpanel" class="tab-pane active">
					<?php include dirname(__FILE__) . '/elements/export.php'; ?>
				</div>
			<?php } ?>
		</div>
	</div>
</div>
<script type="text/javascript">
var pjGrid = pjGrid || {};
pjGrid.queryString = "";
<?php
if (isset($_GET['space_id']) && (int) $_GET['space_id'] > 0)
{
	?>pjGrid.queryString += "&space_id=<?php echo (int) $_GET['space_id']; ?>";<?php
}
?>
var myLabel = myLabel || {};
myLabel.date_time = "<?php __('lblDateTimeFromTo'); ?>";
myLabel.name = "<?php __('lblName'); ?>";
myLabel.space = "<?php __('lblSpace'); ?>";
myLabel.exported = "<?php __('lblExport'); ?>";
myLabel.delete_selected = "<?php __('delete_selected'); ?>";
myLabel.delete_confirmation = "<?php __('delete_confirmation'); ?>";
myLabel.status = "<?php __('lblStatus'); ?>";
myLabel.pending = "<?php echo $bs['pending']; ?>";
myLabel.confirmed = "<?php echo $bs['confirmed']; ?>";
myLabel.cancelled = "<?php echo $bs['cancelled']; ?>";
myLabel.btn_export = "<?php __('btnExport'); ?>";
myLabel.btn_get_url = "<?php __('btnGetFeedURL'); ?>";
</script>