58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
|
|
|
if($_SESSION['id'] && $_GET['id'] && is_numeric($_GET['id'])) {
|
|
$id = (int)$_GET['id'];
|
|
|
|
$metroRegion = $id;
|
|
|
|
if ($id == 2) {
|
|
$metroRegion = 81;
|
|
}
|
|
|
|
if ($id == 19) {
|
|
$metroRegion = 1432;
|
|
}
|
|
if ($id == 1) {
|
|
$metroRegion = 80;
|
|
}
|
|
if ($id == 37) {
|
|
$metroRegion = 1468;
|
|
}
|
|
if ($id == 55) {
|
|
$metroRegion = 1500;
|
|
}
|
|
if ($id == 57) {
|
|
$metroRegion = 1504;
|
|
}
|
|
if ($id == 66) {
|
|
$metroRegion = 1520;
|
|
}
|
|
if ($id == 69) {
|
|
$metroRegion = 1526;
|
|
}
|
|
$sql = "SELECT * from metro where region_rf_id = $metroRegion";
|
|
$rez=mysql_query($sql);
|
|
if(mysql_num_rows($rez)>0) { ?>
|
|
<optgroup label="">
|
|
<?php while($metroArr=mysql_fetch_assoc($rez)){
|
|
$option = '<option value="'.$metroArr['id'].'" ';
|
|
|
|
if (isset($metro)) {
|
|
foreach ($metro as $m => $v) {
|
|
if ($metroArr['id'] == $m) {
|
|
$option.= "selected";
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
$option.= '>'.$metroArr['metro'].'</option>';
|
|
echo $option;
|
|
}
|
|
?>
|
|
</optgroup>
|
|
<?php
|
|
}
|
|
}
|