Ok, bear with me as I'm just learning PHP and just trying to understand this. I get the IF statement at the top of the page is just checking there are actually any routes. The bit further down in effect says, from the $schedules_list array, set each to $schedule. From this point all the echo statements are there just to show routes in separate entities on the resulting page. (tell me if I'm mistaken).
So, I am assuming that for your comment, it would need to go inside the existing foreach statement in order to turn the already created $schedules variable into something else such as $whatever, yes? What I don't get, is how this would stop the routes still being shown.
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
if(!$schedule_list)
{
echo '<p align="center">No routes have been found!</p>';
return;
}
?>
<table id="tabledlist" class="tablesorter">
<thead>
<tr>
<th>Flight Info</th>
<th>Options</th>
</tr>
</thead>
<tbody>
<?php foreach($schedule_list as $schedule) { ?>
<tr>
<td>
<a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?>
<?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?>
</a>
<br />
<strong>Departure: </strong><?php echo $schedule->deptime;?> <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br />
<strong>Equipment: </strong><?php echo $schedule->aircraft; ?> (<?php echo $schedule->registration;?>) <strong>Distance: </strong><?php echo $schedule->distance . Config::Get('UNITS');?>