<style>
.flightsearch-pagination-wrapper { width: 100%; margin-top: 10px; }

.flightsearch-pagination-link { min-width: 15px; text-align: center; padding: 5px; margin: 2px; color: deepskyblue; font-weight: normal; border: 1px solid deepskyblue; display: inline-block; }
.flightsearch-pagination-link:hover { background: lightgray; font-weight: bold; }
.flightsearch-pagination-link a { color: deepskyblue; }
.flightsearch-pagination-active { font-weight: bold; background: white !important; color: black; border: 1px solid black; }
</style>
<h3>Search Results</h3>

<div align="center"><strong>
<?php if($count > '0') { ?>
<?php echo $count ?> Flight(s) found!
<?php } else { ?> We have found no flights matching your search!<?php } ?>
</strong></div><br /><br />

<?php if($flights) { ?> 
<table width="100%" class="tablesorter">
<thead>
<tr>
<th>Flight</th>
<th>Origin</th>
<th>Destination</th>
<th>Duration</th>
<th>Distance</th>
<th>Aircraft</th>
<th>Details</th>
</tr>
</thead>
<?php foreach($flights as $route) { 
$checkset = FlightSearchData::getsettings();
$allowedairlines = explode(':', $checkset->airlinelimit);
if(!in_array($route->code, $allowedairlines))
{
	continue;
}
?>
<tr>
<td><?php echo $route->code.$route->flightnum; ?></td>
<td><?php echo $route->depicao; ?> ( <?php echo $route->deptime; ?> )<br /><?php echo $route->depname; ?></td>
<td><?php echo $route->arricao; ?> ( <?php echo $route->arrtime; ?> )<br /><?php echo $route->arrname; ?></td>
<td><?php echo FlightSearchData::FormatDuration($route->flighttime); ?></td>
<td><?php echo round($route->distance); ?>NM</td>
<td><?php echo $route->aircraftname; ?><br /><?php echo $route->registration; ?></td>
<td>
	<a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br />
		<a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br />
		
		 <?php
			if(Auth::LoggedIn())
			{
			 ?>
             <?php if($bidtimecheck == 'true')
			 { ?>
             Bid Time Limit 
			 <?php } elseif($jumpseatcheck) { ?>
             Transfer in Progress
             <?php } elseif($bidexists) { ?>
             Bid Exists
             <?php } else { ?>
             <?php $routeidcheck = FlightSearchData::routeavailcheck($route->id);
			 if($routeidcheck)
			 { ?>
				<a id="<?php echo $route->id; ?>" class="addbid" 
					href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
                    <?php } else { ?>
                    Not Available!
                    <?php } ?>
			<?php } ?>
            <?php } ?>
</td>
</tr>
<?php } ?>
</table>
<div class="flightsearch-pagination-wrapper">
<?php echo $pagination ?>
</div>
<?php } ?>