"; echo "路線番号:".$route_data[0]['r_id']."
"; echo "路線名:".$route_data[0]['r_name']."
"; echo "ルート色:".$route_data[0]['r_color']."
"; } /*------------------------------------------*/ /*------------路線データの抽出------------*/ $con=@mysql_connect("localhost","event","L523GpA"); if(!$con){ unset($con,$data,$r_id,$lat,$lng,$time,$day); die("DB接続エラー"); } $select_db=@mysql_select_db("eventdb"); if(!$select_db){ unset($con,$select_db,$r_id,$lat,$lng,$time,$day); die ("DB選択エラー"); } @mysql_query("set names utf8"); $sql="select * from nservice_name_tbl where r_id=".$r_id." order by busservice_id asc"; $res = mysql_query($sql); if($_GET['debug']==1){ echo "

便に関するデータ
"; } for($i = 0;$row = mysql_fetch_array($res);$i++){ $service_id[$i]=$row['busservice_id']; $service_name[$i]=$row['busservice_name']; $backcolor[$i]=$row['backcolor']; if($_GET['debug']==1){ echo $service_id[$i]."
"; echo $service_name[$i]."
"; echo $backcolor[$i]."
"; } } mysql_free_result($res); $close=@mysql_close($con); if(!$close){ unset($con,$select_db,$res,$sql,$row,$close,$r_id,$lat,$lng,$time,$day); die("DB切断エラー"); } unset($con,$select_db,$res,$sql,$row,$close); /*------------------------------------------*/ /*------------バス停データの抽出------------*/ $con=@mysql_connect("localhost","event","L523GpA"); if(!$con){ unset($con,$data,$r_id,$lat,$lng,$time,$day); die("DB接続エラー"); } $select_db=@mysql_select_db("eventdb"); if(!$select_db){ unset($con,$select_db,$r_id,$lat,$lng,$time,$day); die ("DB選択エラー"); } @mysql_query("set names utf8"); $sql="select bus_name from nbus_master where r_id=".$r_id." order by busstop_id asc"; $res = mysql_query($sql); $bus_cnt=0; for($i = 1;$row = mysql_fetch_array($res);$i++){ $bus_name[$i]=$row['bus_name']; if($_GET['debug']==1){ echo "
バス停に関するデータ
"; echo $bus_name[$i]."
"; } } $bus_cnt=($i-1); mysql_free_result($res); $close=@mysql_close($con); if(!$close){ unset($con,$select_db,$res,$sql,$row,$close,$r_id,$lat,$lng,$time,$day); die("DB切断エラー"); } unset($con,$select_db,$res,$sql,$row,$close); /*------------------------------------------*/ /*------------時刻データの抽出------------*/ $con=@mysql_connect("localhost","event","L523GpA"); if(!$con){ unset($con,$data,$r_id,$lat,$lng,$time,$day); die("DB接続エラー"); } $select_db=@mysql_select_db("eventdb"); if(!$select_db){ unset($con,$select_db,$r_id,$lat,$lng,$time,$day); die ("DB選択エラー"); } @mysql_query("set names utf8"); $sql="select time from ntime_tbl where r_id=".$r_id." and busstop_id=".$busstop_id." order by busstop_id,busservice_id asc"; $res = mysql_query($sql); $bin_cnt=0; if($_GET['debug']==1){ echo "

時刻に関するデータ
"; } for($i = 0;$row = mysql_fetch_array($res);$i++){ $time[$i]=$row['time']; //echo ($i+1).":".$time[$i]."
"; } $bin_cnt=$i; mysql_free_result($res); $close=@mysql_close($con); if(!$close){ unset($con,$select_db,$res,$sql,$row,$close,$r_id,$lat,$lng,$time,$day); die("DB切断エラー"); } unset($con,$select_db,$res,$sql,$row,$close); /*------------------------------------------*/ ?> ".$busstop_id."_".$bus_name[$busstop_id]."
[".$route_data[0]['r_name']."]"); //print("
"); print(""); print(""); print(""); print(""); print(""); for($i=0;$i<$bin_cnt;$i++){ print(""); if($i==3 && $r_id==9){ print(""); $time_array=explode(",", $time[$i]); if($time_array[0]!=null){ print(""); }else{ print(""); } if($time_array[1]!=null){ print(""); }else{ print(""); } }else{ print(""); print(""); } print(""); } print("
便番号
時刻
".($i+1)."
".$time_array[0]."
 
".$time_array[1]."
 
".($i+1)."
".$time[$i]."
"); ?>