".$row['r_name']."

"); print(""); print(""); $sql1 = "select busservice_name, backcolor from nservice_name_tbl where direction = 0 and r_id=".$_GET['r_id']; $res1 = mysql_query($sql1); if(!$res1){ unset($con,$select_db,$sql,$res,$sql1,$res1); die(); } $row1 = mysql_fetch_array($res); for($i = 1;$row1 = mysql_fetch_array($res1);$i++){ print(""); } print(""); $sql2 = "select busstop_id, bus_name from nbus_master where r_id=".$_GET['r_id']." order by busstop_id asc"; $res2 = mysql_query($sql2); if(!$res2){ unset($con,$select_db,$sql,$res,$sql1,$res1,$sql2,$res2); die(); } for($i = 1;$row2 = mysql_fetch_array($res2);$i++){ print(""); $sql3 = "select backcolor, ntime_tbl.time from ntime_tbl left join nservice_name_tbl on nservice_name_tbl.r_id = ntime_tbl.r_id and nservice_name_tbl.busservice_id = ntime_tbl.busservice_id where busstop_id =".$i." and direction = 0 and ntime_tbl.r_id=".$_GET['r_id']." order by busstop_id,nservice_name_tbl.busservice_id asc"; $res3 = mysql_query($sql3); for($j = 1;$row3 = mysql_fetch_array($res3);$j++){ if($row3['backcolor'][0] == '#'){ print(""); }else{ print(""); } } print(""); } print("
バス停番号停留所名".$row1['busservice_name']."
".$row2['busstop_id']."
".$row2['bus_name']."
".$row3['time']."".$row3['time']."

"); print("
"); print("" . $row['remarks'] . "
"); print("" . $row['remarks2'] . "
"); print("" . $row['remarks3'] . "
"); print("
"); mysql_free_result($res); $close = @mysql_close($con); if(!$close){ unset($con,$elect_db,$sql,$sql1,$sql2,$sql3,$res,$res1,$res2,$res3,$row,$row1,$row2,$row3); die(); } unset($con,$elect_db,$sql,$sql1,$sql2,$sql3,$res,$res1,$res2,$res3,$row,$row1,$row2,$row3,$close); ?>