<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>	
<h3><?php echo SITE_NAME; ?> Admin Center</h3>
<h1 id="admin_title">
	Hello, <?php echo Auth::$pilot->firstname; ?> <i class="fa fa-bolt"></i>
</h1>

<script>
	$("#admin_title").hide().fadeIn(2000);	
</script>



<?php ICSAdmin::skincheck(); ?>
<table class="tablesorter">
	<thead>
	  <th>Skin Status</th>
	
	</thead>
	<tbody>
		
</section>
	  <td><?php echo ICSAdmin::currentskin($currentskin); ?></td>
	</tbody>
</table>
<table class="tablesorter">
	<thead>
		<th>Server PHP Version</th>
		<th>phpVMS Version</th>
		<th>iCrew Version</th>
		<th>License Type</th>
	</thead>
	<tbody>
		<td><?php 
		if (version_compare(phpversion(), '5.4', '<')) {
			echo phpversion()." Not Compatible! Errors may exist. <i class='fa fa-times'></i>";
		} else {
			echo phpversion()." Compatible <i class='fa fa-check'></i>";
		}
		 ?></td>
		<td>
		<?php 
			echo ICREW_VERSION;
		?>
		</td>
		<td>
			iCrew <?php echo ICS_VERSION; ?>
		</td>
		<td><?php echo e(ICS_LICENCE_TYPE); ?></td>
	</tbody>
</table>
<table class="tablesorter">
	<thead>
		<th>Date</th>
		<th>Airline Status</th>
		<th>Bid Cancel Time</th>
		<th>Airline Navdata</th>
	</thead>
	<tbody>
		<td><?php echo strtoupper(date("D")); ?> <?php echo date("d-m-Y"); ?></td>
		<td>
		<?php 
			$maint = Config::Get('MAINTENANCE_MODE');
			$stat = StatsData::TotalFlightsToday(); 
			if($maint == true) 
			{
				$status = 'MAINTENANCE MODE';
				$style = 'style="color:#F00"';
			}
			elseif($stat == 0)
			{
				$status = 'INACTIVE (No Flights Today)';
				$style = 'style="color:#F00"';
			}
			else
			{
				$status = 'ACTIVE';
				$style = 'style="color:#00FF00"';
			}
			echo '<span'.$style.'>'.$status.'</span>';
		?>
		</td>
		<td><?php echo Config::Get('BID_EXPIRE_TIME'); ?> Minutes</td>
		<td><?php echo VA_NAVDATA; ?></td>
	</tbody>
</table>
<h3>VA Stats:</h3>
<table width="100%">
	<tr>
	<td valign="top" width="33%" nowrap="nowrap">		
		<strong>Users Online: </strong><?php echo count(StatsData::UsersOnline()); ?><br />
		<strong>Guests Online: </strong><?php echo count(StatsData::GuestsOnline()); ?>
	</td>
	<td valign="top" width="33%" nowrap="nowrap" >
		<strong>Total Pilots: </strong><?php echo StatsData::PilotCount(); ?><br />
		<strong>Total Flights: </strong><?php echo StatsData::TotalFlights(); ?><br />
		<strong>Total Hours Flown: </strong><?php echo StatsData::TotalHours(); ?>
	</td>
	<td valign="top" width="33%" nowrap="nowrap" >
		<strong>Miles Flown: </strong><?php echo StatsData::TotalMilesFlown(); ?><br />
		<strong>Total Schedules: </strong><?php echo StatsData::TotalSchedules(); ?><br />
		<strong>Flights Today: </strong><?php echo StatsData::TotalFlightsToday();?>
	</td>
	</tr>
</table>
<?php
MainController::Run('Dashboard', 'CheckInstallFolder');
echo $updateinfo;
?>

<?php
/*
	Added in 2.0!
*/
$chart_width = '800';
$chart_height = '200';

/* Don't need to change anything below this here */
?>
<script type="text/javascript" src="<?php echo fileurl('/lib/js/ofc/js/swfobject.js')?>"></script>
<script type="text/javascript">
 $('#check').delay(5000).show(0);   
</script>
<script type="text/javascript">
swfobject.embedSWF("<?php echo fileurl('/lib/js/ofc/open-flash-chart.swf');?>", 
	"reportcounts", "<?php echo $chart_width;?>", "<?php echo $chart_height;?>", 
	"9.0.0", "expressInstall.swf", 
	{"data-file":"<?php echo adminaction('/dashboard/pirepcounts');?>"});
</script>
