<? session_start(); include("header.php"); ?> <? $travelroute = ""; $error = ""; if (($submit == " แสดงเส้นทาง ") or (($amphuridstart <> "") and ($amphuridstop <> ""))) { if ($submit == " แสดงเส้นทาง ") $cmid = ""; $str = "Select * From map where amphuridstart = $amphuridstart and amphuridstop = $amphuridstop"; //mysql_query : คำสั่งที่กำหนดให้ MySQL ทำการประมวลผลตามคำสั่งที่กำหนด $rssm = mysql_query($str); //mysql_num_rows : คำสั่งสำหรับนับจำนวนแถว (Record) ของข้อมูลที่ทำการประมวลผล $rssmrow = mysql_num_rows($rssm); if ($rssmrow <= 0) { $error = "<font size=2 color=blue><div align=center><h3>ไม่พบข้อมูลเส้นทางการท่องเที่ยวที่เลือก</h3></div>"; } } ?><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <p align="center"><img src="images/tourlampang.jpg" width="350" height="38"></p> <form name=myform method="post"> <table width="900" height="53" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor=#FFFFFF> <tr height=5><td></td></tr> <tr> <td width=100%> <div align="center">เส้นทางการท่องเที่ยวจากอำเภอ <Select name='amphuridstart'> <? $strsql = "Select * From amphur Order By amphurid"; //mysql_query : คำสั่งที่กำหนดให้ MySQL ทำการประมวลผลตามคำสั่งที่กำหนด $rsm = mysql_query($strsql); //mysql_fetch_array : คำสั่งสำหรับอ่านข้อมูลจาก ตัวแปรที่เก็บข้อมูลตารางทีละ 1 Record While ($resultm=mysql_fetch_array($rsm)) { if ($resultm['amphurid'] == $amphuridstart) { ?> <Option value='<? echo $resultm['amphurid'] ?>' selected> <? echo $resultm['amphurname'] ?> </Option> <? } else { ?> <Option value='<? echo $resultm['amphurid'] ?>'> <? echo $resultm['amphurname'] ?> </Option> <? } } ?> </Select> ถึงอำเภอ <Select name='amphuridstop'> <? $strsql = "Select * From amphur Order By amphurid"; $rsm = mysql_query($strsql); While ($resultm=mysql_fetch_array($rsm)) { if ($resultm['amphurid'] == $amphuridstop) { ?> <Option value='<? echo $resultm['amphurid'] ?>' selected> <? echo $resultm['amphurname'] ?> </Option> <? } else { ?> <Option value='<? echo $resultm['amphurid'] ?>'> <? echo $resultm['amphurname'] ?> </Option> <? } } ?> </Select> <input type=submit name=submit value=' แสดงเส้นทาง '> </div></td> </tr> <tr height=5><td></td></tr> <? if ($error <> "") { ?> <tr> <td align=center> <br><br><br> <? echo $error ?> <br><br><br><br><br> </td> </tr> <? } else { //mysql_fetch_array : คำสั่งสำหรับอ่านข้อมูลจาก ตัวแปรที่เก็บข้อมูลตารางทีละ 1 Record $cc = 0; while ($resultsm = mysql_fetch_array ($rssm)) { if ($rssmrow > 1) $no = $no + 1; ?> <tr> <td> <table width="900" height="53" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <? if (($cmid == "") and ($cc == 0)) { $travelroute = $resultsm['maplink']; $strsql = "Update map set mapclick = mapclick + 1 Where mapid = $resultsm[mapid]"; $result = mysql_query($strsql,$connect); $cmid = $resultsm['mapid']; $cc = 1; ?> <font size=2 color=blue><? echo $resultsm['mapname'] ?></font> <? if ($rssmrow > 1) echo "<font size=2 color=red> ($no)</font>" ?> <br> <font size=2 color=blue><? echo $resultsm['mapdetail'] ?></font> <BR><BR> <iframe width="900" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<? echo $travelroute ?>&output=embed"></iframe><br /><small>ดู <a href="<? echo $travelroute ?>&source=embed" style="color:#0000FF;text-align:left">แผนที่ติดต่อ</a> ในแผนที่ขนาดใหญ่กว่า</small> <? } else { if ($cc == 0) { if ($cmid == $resultsm['mapid']) { $travelroute = $resultsm['maplink']; $strsql = "Update map set mapclick = mapclick + 1 Where mapid = $resultsm[mapid]"; $result = mysql_query($strsql,$connect); $cc = 1; ?> <font size=2 color=blue><? echo $resultsm['mapname'] ?></font> <? if ($rssmrow > 1) echo "<font size=2 color=red> ($no)</font>" ?> <br> <font size=2 color=blue><? echo $resultsm['mapdetail'] ?></font> <BR><BR> <iframe width="900" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<? echo $travelroute ?>&output=embed"></iframe><br /><small>ดู <a href="<? echo $travelroute ?>&source=embed" style="color:#0000FF;text-align:left">แผนที่ติดต่อ</a> ในแผนที่ขนาดใหญ่กว่า</small> <? } else { ?> <a href='travelroute.php?cmid=<? echo $resultsm['mapid'] ?>&huridstart=<? echo $amphuridstart ?>&huridstop=<? echo $amphuridstop ?>'><font size=2 color=blue><? echo $resultsm['mapname'] ?></font></a> <? if ($rssmrow > 1) echo "<font size=2 color=red> ($no)</font>" ?> <br> <font size=2 color=blue><? echo $resultsm['mapdetail'] ?></font> <? } } else { ?> <a href='travelroute.php?cmid=<? echo $resultsm['mapid'] ?>&huridstart=<? echo $amphuridstart ?>&huridstop=<? echo $amphuridstop ?>'><font size=2 color=blue><? echo $resultsm['mapname'] ?></font></a> <? if ($rssmrow > 1) echo "<font size=2 color=red> ($no)</font>" ?> <br> <font size=2 color=blue><? echo $resultsm['mapdetail'] ?></font> <? } } ?> </td> </tr> </table> </td> </tr> <? } } ?> </table> </form> <? include("footer.php"); ?>
$str = "Select * From map where amphuridstart = $amphuridstart and amphuridstop = $amphuridstop"; echo $str;
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง