<style>
                .enjoy-css {
                    -webkit-box-sizing: content-box;
                    -moz-box-sizing: content-box;
                    box-sizing: content-box;
                    cursor: pointer;
                    border: none;
                    font: normal 72px/normal "baumans", Helvetica, sans-serif;
                    color: rgba(255, 255, 255, 1);
                    text-align: center;
                    -o-text-overflow: clip;
                    text-overflow: clip;
                    text-shadow: 0 1px 0 rgb(204, 204, 204), 0 2px 0 rgb(201, 201, 201), 0 3px 0 rgb(187, 187, 187), 0 4px 0 rgb(185, 185, 185), 0 5px 0 rgb(170, 170, 170), 0 6px 1px rgba(242, 89, 89, 0.09), 0 0 5px rgba(0, 0, 0, 0.0980392), 0 1px 3px rgba(0, 0, 0, 0.298039), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.247059), 0 10px 10px rgba(0, 0, 0, 0.2), 0 20px 20px rgba(0, 0, 0, 0.14902);
                    -webkit-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1);
                    -moz-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1);
                    -o-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1);
                    transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1);
                }
                
                .enjoy-css:hover {
                    font: normal 72px/normal "baumans", Helvetica, sans-serif;
                    color: rgba(255, 255, 255, 1);
                    text-shadow: 0 1px 0 rgba(255, 255, 255, 1), 0 2px 0 rgba(255, 255, 255, 1), 0 3px 0 rgba(255, 255, 255, 1), 0 4px 0 rgba(255, 255, 255, 1), 0 5px 0 rgba(255, 255, 255, 1), 0 6px 1px rgba(0, 0, 0, 0.0980392), 0 0 5px rgba(0, 0, 0, 0.0980392), 0 1px 3px rgba(0, 0, 0, 0.298039), 0 3px 5px rgba(0, 0, 0, 0.2), 0 -5px 10px rgba(0, 0, 0, 0.247059), 0 -7px 10px rgba(0, 0, 0, 0.2), 0 -15px 20px rgba(0, 0, 0, 0.14902);
                    -webkit-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
                    -moz-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
                    -o-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
                    transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
                }
            </style>
   <div class="content-header">
    <div class="header-section">
        <h3>Airline <Strong>Statistics</Strong><br><Small> Stats Department | <?php echo SITE_NAME ?> &copy; <?php echo date("Y"); ?></Small></h3>
    </div>
</div>
<ol class="breadcrumb breadcrumb-top">
  <li><a href="<?php echo SITE_URL?>/index.php"><i class="fa fa-home"></i></a></li>
  <li>Stats Data</li>
  <li><a href="<?php echo SITE_URL?>/index.php/statistics">Airline Stats</a></li>
</ol>
<div class="alert alert-info">
	<?php 
	$recentpirep = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED);
	if(!$recentpirep)
	{
		$greetmessage = '<Strong>Welcome to SkyDream Virtual '.Auth::$userinfo->firstname.',</strong> We are glad that you will be a part of our future success!';
	}
	else
	{
		$greetmessage = '<strong>'.Auth::$userinfo->firstname.', Thank you!</strong> <br> We owe our success to you! Without you, it wouldn\'t have been possible';
	}
	?>
	<?php echo $greetmessage; ?>
</div>    
<div class="row">
    <div class="col-md-12">
        <div class="block">
            <div class="block-title">
                <h3><strong>Airline</strong> Statistics</h3>
            </div>
            
            <div class="enjoy-css"></div>
            <h3 class="text-center"><strong>Total</strong> Log Hours</h3>
            <div class="col-md-12">
                <!-- Widget -->
                <a href="javascript::void(0);" class="widget widget-hover-effect5">
                    <div class="widget-simple">
                        <h1 class="enjoy-css">
	                    		 <strong><?php echo StatsData::TotalHours(); ?> Hrs <br></strong>
	                    </h1>
                    </div>
                </a>
                <!-- END Widget -->
            </div>

            <div class="col-sm-3">
                <!-- Widget -->
                <a href="javascript::void(0);" class="widget widget-hover-effect2">
                    <div class="widget-simple">
                        <h3 class="widget-content text-center animation-pullDown ">
	                    		 <strong><?php echo StatsData::TotalFlights(); ?></strong>
	                    		<small>Total Flights</small>
	                		</h3>
                    </div>
                </a>
                <!-- END Widget -->
            </div>

            <div class="col-sm-3">
                <!-- Widget -->
                <a href="javascript::void(0);" class="widget widget-hover-effect2">
                    <div class="widget-simple">
                        <h3 class="widget-content text-center text-warning animation-pullDown ">
	                    		 <strong><?php $number =  StatsData::TotalPaxCarried(); echo number_format($number, 0, '.', ','); ?></strong>
	                    		<small>Total Passengers </small>
	                		</h3>
                    </div>
                </a>
                <!-- END Widget -->
            </div>

            <div class="col-sm-3">
                <!-- Widget -->
                <a href="javascript::void(0);" class="widget widget-hover-effect2">
                    <div class="widget-simple">
                        <h3 class="widget-content text-center text-danger animation-pullDown ">
	                    		 <strong><?php $number = StatsData::TotalMilesFlown();
						                        echo number_format($number, 0, '.', ','); ?> NM
						                </strong>
	                    		<small>Miles Flown </small>

	                		</h3>
                    </div>
                </a>
                <!-- END Widget -->
            </div>

            <div class="col-sm-3">
                <!-- Widget -->
                <a href="javascript::void(0);" class="widget widget-hover-effect2">
                    <div class="widget-simple">
                        <h3 class="widget-content text-center text-success animation-pullDown ">
	                    		 <strong><?php $number = StatsData::TotalFuelBurned();
						                        echo number_format($number, 0, '.', ','); ?> KGS</strong>
	                    		<small>Total Fuel Burned</small>
	                		</h3>
                    </div>
                </a>
                <!-- END Widget -->
            </div>

            
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
        </div>
        
        <div class="block">
          <div class="block-title">
            <h3><strong>Per Day</strong> Statistics</h3>
          </div>
        	<?php 
			    /*Average Passenger Per Flight Algorithim*/
					$startdate = StatsData::getStartDate();
					$totalhours = StatsData::TotalHours();
					$tf = StatsData::TotalFlights();
					$tp = StatsData::TotalPaxCarried();
					$averagepax = $tp / $tf;
					$pax_capacity_per_flight = $tf;
					$average_flight_per_day = floor($totalhours / 24);
					$avp = (floor($averagepax) / $pax_capacity_per_flight ) * 100;
					$value = $avp - 30;
					$tf = StatsData::TotalFlights();
					$tfuel = StatsData::TotalFuelBurned();
					$averagefb = $tfuel / $tf;
					$fuelcutoffval = (floor($averagefb)) - 1000;
					$avg_dispatched_fuel_per_flight = 12000;
					$avf = (floor($fuelcutoffval) / $avg_dispatched_fuel_per_flight ) * 100;
			?>

                    <div class="row">
                    	<div class="col-sm-6">
                        <div class="widget">
                            <div class="widget-extra-full text-center">
                                <div class="pie-chart easyPieChart" data-percent="<?php echo $value;?>" data-size="120" data-bar-color="#003fff">
                                    <span><i class="fa fa-users"></i></span>
                                    <canvas width="90" height="90"></canvas>
                                </div>
                                <br>
                                <span class="text-muted">Average Passengers <?php echo floor($averagepax);?> </span>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-6">
                        <div class="widget">
                            <div class="widget-extra-full text-center">
                                <div class="pie-chart easyPieChart" data-percent="<?php echo $avf; ?>" data-size="120" data-bar-color="#ffa500" style="width: 90px; height: 90px; line-height: 90px;">
                                    <span><?php echo Config::Get('MONEY_UNIT'); ?></span>
                                    <canvas width="90" height="90"></canvas>
                                </div>
                                <br><span class="text-muted"> Average Fuel Consumption  <?php echo $fuelcutoffval; ?> Kgs </span>
                            </div>
                        </div>
                    </div>
                    </div>
                    
        </div>
    </div>

</div>
<div class="row">
	<div class="col-md-12">
		<div class="block">
			<div class="block-title">
				<h3><Strong>Operating</Strong> Statistics</h3>
			</div>
			<div class="table-responsive">
				<table class="table table-hover">
					<thead>
						<th>Total Flight Reports</th>
						<th>Total Active Pilots</th>
					</thead>
					<tbody>
						<td>
							<?php
							$count = 1;
							$pireps = PIREPData::getRecentReportsByCount($count);
							foreach($pireps as $pirep)
							{
								echo $pirep->pirepid;	
							}
							
							?>
						</td>
						<td>
							<?php
							$count = 1;
							$pilots = PilotData::getLatestPilots($count);
							foreach($pilots as $pilot)
							{
								echo $pilot->pilotid;	
							}
							
							?> 
						</td>
						
					</tbody>
				</table>
			</div>
		</div>
		<div class="block">
			<div class="block-title">
				<h3><Strong>Daily</Strong> Statistics</h3>
			</div>
			
		<div class="table-responsive">
			<table class="table table-hover">
				<thead>
					<th>Date</th>
					<th>Flights Today</th>
					<th>Hours Today</th>
				</thead>
				<tbody>
					<td><?php echo date("d F Y") ; ?></td>
					<td><?php $today =  StatsData::TotalFlightsToday(); echo $today;?></td>
					<td><?php $counta = $today;
							$pirepstoday = PIREPData::getRecentReportsByCount($counta); 
							foreach($pirepstoday as $pireptoday)
							{
								$pireptoday->flighttime;
							}
							?>
							
					</td>
				</tbody>
			</table>
		</div>
		</div>
	</div>
</div>