<div class="row">
	<div class="col-md-12">
		<div class="content-header">
			<div class="header-section">
				<h1>
					<Strong>One Click</Strong> Search<br><small><?php echo SITE_NAME ?> | Flight Operations &copy; <?php echo date("Y"); ?></small>
				</h1>
			</div>
		</div>
		
		
		<div class="block">
			<div class="block-title">
				<h3><Strong>Avialable</Strong> Itenary</h3>
				<div class="block-options pull-right">
				<a href="<?php echo SITE_URL?>/index.php/schedules" class="btn btn-alt btn-sm btn-default">Go Back</a>
			</div>
			</div>
			
			
			
			<table class="table table-hover">
  				<thead>
    				<th align = "center"><strong>Flight #</strong></th>
					<th align = "center"><strong>Aircraft</strong></th>
    				<th align = "center"><strong>Departure</strong></th>
    				<th align = "center"><strong>Arrival</strong></th>   
  				</thead>
					
				<?php
					$pilotid = Auth::PilotID();
					$user = PilotData::getPilotData($pilotid);
					
					if (!$schedules)
    			{ ?> 
				<tr><td>No Routes Found!</td></tr>
				<?php 
				}
				else
    			{ ?>
				<?php foreach($schedules as $result) 
				{ 			
				$info = OperationsData::getAircraftByReg($result->registration);			
				?>
				<tr>       
		        <td><?php echo $result->code.$result->flightnum;?></td>		
				<td><?php echo $info->registration;?></td>		      
				<td><?php echo $result->depicao;?></td>        
				<td><?php echo $result->arricao;?></td> 
  				</tr>
				<?php 	}
				} ?>
				
	
</table>  
<hr>
	<form name="bidAll" id="bidAll" action="<?php echo SITE_URL?>/index.php/randomflights/bidAll" method="post">
		<?php
		for($i = 0; $i < count($schedules); $i++)
		{
		?>
		<input type="hidden" name="schedules[<?php echo $i;?>]" value="<?php echo $schedules[$i]->id;?>">
		<?php
		}
		?>		
		<input type="hidden" name="count" value = "<?php echo count($schedules);?>">
		<input type="hidden" name="pilotid" value="<?php echo $pilotid;?>">	
		<center>
			<button type="submit" class="btn btn-block btn-success" name ="submit" value="">Book all flights!</button>
		</center><br>
	</form>
		

			
		</div>
	</div>
</div>





