<?php
///////////////////////////////////////////////
///   SceneryDatabase v2.1 by php-mods.eu   ///
///            Author php-mods.eu           ///
///           Packed at 29/08/2012          ///
///     Copyright (c) 2012, php-mods.eu     ///
///////////////////////////////////////////////

?>
<h3><?php echo SITE_NAME; ?> Scenery Search Engine</h3>
<?php Template::Show('scenery/scenery_menu.tpl'); ?>
<center>
  Your search results are:<br />
  <br />
</center>
<table width="70%" border="0" cellpadding="1" cellspacing="0" align="center">
  <tr>
    <td width="10%" align="center"><b>ICAO</b></td>
    <td width="20%" align="center"><b>FS Version</b></td>
    <td width="15%" align="center"><b>Type</b></td>
    <td width="15%" align="center"><b>Freeware/Payware</b></td>
    <td width="15%">&nbsp;</td>
  </tr>
  <?php
if(!$result)
              {echo '<tr><td colspan="5"><center>We are sorry but we could not find the scenery your are looking for.</center></td></tr>';}
            else
            {
foreach($result as $result)
{ ?>
  <tr>
    <td><?php echo $result->icao; ?></td>
    <td><?php echo $result->fsvers; ?></td>
    <td><?php if($result->type == '1'){echo 'Airport';}
if($result->type == '2'){echo 'AFCAD';}
if($result->type == '3'){echo 'Other';}
?></td>
    <td><?php if($result->payfree == '1'){echo 'Freeware';}
if($result->payfree == '2'){echo 'Payware';}
?></td>
    <td><a href="<?php echo SITE_URL; ?>/index.php/Scenery/details/<?php echo $result->id; ?>">Click Here</a></td>
  </tr>
  <?php } } ?>
</table>
<br />
