<? session_start(); if($_SESSION['username'] == "") { echo "Please Login!"; exit(); } include('connect.php'); $strSQL = "SELECT * FROM ordertour INNER JOIN customer ON (ordertour.username = customer.username) WHERE customer.username = '".$_SESSION['username']."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL =" order by ID DESC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <html> <head> <title>Customer Data</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <a href="history_page.php">ประวัติการทำรายการ</a> >> ข้อมูลการจองทัวร์<br><br> <table width="900" border="1"> <tr> <th> <div align="center">วันที่ </div></th> <th> <div align="center">เวลา </div></th> <th> <div align="center">ชื่อลูกค้า</div></th> <th> <div align="center">ชื่อแพคเกจทัวร์ </div></th> <th> <div align="center">จำนวนที่นั่ง</div></th> <th> <div align="center">สถานะทัวร์ </div></th> <th> <div align="center">การชำระเงิน</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr HEIGHT="30"> <td><div align="center"><?=$objResult["doDate"];?></div></td> <td><div align="center"><?=$objResult["doTime"];?></div></td> <td><div align="center"><?=$objResult["name"];?></div></td> <td><div align="center"><?=$objResult["tour"];?></div></td> <td><div align="center"><?=$objResult["Seat"];?></div></td> <td><div align="center"><?=$objResult["TourStatus"];?></div></td> <td><div align="center"><?=$objResult["MoneyStatus"];?></div></td> </tr> <? } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } mysql_close(); ?> </body> </html>
<? $current_page = 1; if(isset($_GET['page'])){ $current_page = $_GET['page']; } $row_per_page = 10; $start_row = ($current_page -1) * $row_per_page; $sql_cheak = "select SQL_CALC_FOUND_ROWS *"; $sql_cheak .=" from tb_rent_customer, tb_type_room, tb_rent_room, tb_room, tb_status_room where tb_rent_customer.R_id = tb_room.R_id AND tb_rent_customer.RR_code_room = tb_rent_room.RR_day_room AND tb_rent_customer.T_id_type = tb_type_room.T_id_type AND tb_rent_customer.S_idcode_status = tb_status_room.S_idcode_status "; $sql_cheak .="order by R_rent_cus DESC "; $sql_cheak .= "LIMIT $start_row, $row_per_page;"; $rscheak = mysql_query($sql_cheak); ?> <table cellspacing="0" cellpadding="5" width="100%"> <tr bgcolor="#99CC99"> <th>ลำดับที่</th> <th>เลขที่ห้อง</th> <th>เช็คอินท์</th> <th>เช็คเอาท์</th> <th>พักกี่วัน</th> <th>ประเภทห้อง</th> <th>สถานะห้องพัก</th> </tr> <? while($arrchek = mysql_fetch_assoc($rscheak)){ if($arrchek['S_idcode_status'] == '2' or $arrchek['S_idcode_status'] == '3'){ if($bg == "white"){ $bg = "99cc99"; } else { $bg = "white"; } ?> <tr align="center" bgcolor="<? echo $bg;?>"> <td><? echo $arrchek['R_rent_cus']; ?></td> <td><? echo $arrchek['R_Number_room']; ?></td> <td><? echo $arrchek['start_date']; ?></td> <td><? echo $arrchek['end_date']; ?></td> <td><? echo $arrchek['RR_name_room']; ?></td> <td><? echo $arrchek['T_name_type']; ?></td> <td><? echo $arrchek['S_name_status']; ?></td> </tr> <? } } ?> </table> <p><center> <? $found_rows = mysql_query("select FOUND_ROWS();"); $total_row = mysql_result($found_rows,0,0); $total_pages = ceil($total_row / $row_per_page); $url = $_SERVER['PHP_SELF']; if($current_page > 1 ) { $pg = $current_page - 1; echo "<a href=\"$url?page=$pg\">Previous</a>"; } echo "$current_page"; if($current_page < $total_pages){ $pg = $current_page + 1; echo "<a href=\"home.php?page=$pg&url=cheak_new_room.php\">Next</a>"; } ?> </center>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง