<h3>Settings</h3>

<strong>Automatic Charter Flight Creation: </strong> <?php if($setting->autocreate == '1') { echo 'Active'; } else { echo 'Off'; } ?> <br />
<strong>Pilots can create Flights: </strong> <?php if($setting->pilotcreate == '1') { echo 'Active'; } else { echo 'Off'; } ?> <br />
<strong>Charter Airline in Use: </strong> <?php if($setting->usechartairline == '1') { echo 'Yes'; } else { echo 'No'; } ?> <br />
<strong>Charter Airline Code: </strong> <?php echo $setting->chartercode; ?> <br />
<strong>Departure Airports: </strong> <?php if($setting->prefdepapts) { echo str_replace(':',', ', $setting->prefdepapts); } else { echo 'Worldwide'; }?> <br />

<?php if($setting->limittoregions == '1') { ?>
<strong>Auto Flight Arrival Regions:</strong> <br />
<?php $countries = explode(':', $setting->regions); 
foreach($countries as $countr)
{
$imageurl = SITE_URL."/core/modules/CharterOps/img/flags/".$countr.".png";
if(getimagesize($imageurl))
{
echo "<img src='".$imageurl."' alt='countryflag' />"; 
}
else { echo $countr; }
}
?>
<br /> <br /> Arrival Regions are not limited for flights submitted by pilots!
<?php } ?>





<?php $flightcount = count($flights); ?>
<h3>Auto Generated Charters (<?php echo $flightcount; ?>)</h3>
<?php if($flightcount == '0')
{
echo "No Auto Charter Flights created!";
return;
} ?>


<table cellspacing="0" cellpadding="0" border="0" class="tablesorter">
<tr>
<th>From</th>
<th>City</th>
<th>To</th>
<th>City</th>
<th>Aircraft</th>
<th>Tour Operator</th>
<th>Expires</th>
<th>Delete</th>
</tr>
<?php foreach($flights as $flight)
{
?>
<tr>
<td><?php echo $flight->depicao; ?></td>
<td><?php echo $flight->depname; ?></td>
<td><?php echo $flight->arricao; ?></td>
<td><?php echo $flight->arrname; ?></td>
<td><?php echo $flight->aircraftname; ?></td>
<td><?php echo $flight->tourop; ?></td>
<td><?php echo $flight->expiredate; ?></td>
<td><a href="<?php echo SITE_URL ?>/admin/index.php/CharterOps/deleteflight/<?php echo $flight->cid; ?>">Delete</a></td>
</tr>
<?php } ?>
</table>