Forum Moderators: coopster
"<?php
$querystations = "SELECT * FROM `stations` WHERE `state` = '{$State['id']}' ORDER BY name ASC";
$rowstations = $Db->Rows($querystations);
$resultstations=$Db->Query($querystations);
$querycheck = mysql_query("SELECT * FROM `prices` WHERE approved = '0' and archive != '0'");
while($checkrow = mysql_fetch_array($querycheck)) {
$ids .= str_replace('ID:', '', $checkrow['station'] .',');
}
$station_array = explode(',', trim($ids));
for($i = 0; $i < $rowstations; $i++){
$station_id =trim($Db->Result($resultstations, $i, 'id'));
$station_name =$Db->Result($resultstations, $i, 'name');
$station_cityid = $Db->Result($resultstations, $i, 'city');
if(array_search($station_id, $station_array) === FALSE)
{
$querycity = "SELECT * FROM `citys` WHERE `id` = '{$station_cityid}'";
$station_city = $Db->FetchArray($querycity);
$queryaddress = "SELECT * FROM `address` WHERE `station` = '". $Db->Result($resultstations, $i, 'id') . "'";
$station_addr = $Db->FetchArray($queryaddress);
?><tr align="center">
<td><?php echo stripslashes($station_name) ?></td>
<td><?php echo "<a href=\"./{$State['state']}/{$station_city['name_short']}.html\">{$station_city['name']}</a>";?></td>