<?php include("Connections/MyConnect.php"); mysql_select_db('pk_db'); $arrRoom = array(1,2,3,4); $arrFloor = array(4,3,2,1); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $strTable = '<table border = "0" width = "400" ><tr><td align = "center" bgcolor="#FFCCFF" ><font face="Waffle Regular" size = "6">ชั้น/ห้อง</font></td>'; foreach($arrRoom as $room){ $strTable.='<td bgcolor="#FFFF66" width="70" height="70" align = "center" ><font face="Waffle Regular" size = "6">'.$room.'</font></td>'; } $strTable.='</tr>'; foreach($arrFloor as $floor){ $strTable.='<tr><td bgcolor="#FFFF66" width="70" height="70" align = "center"><font face="Waffle Regular" size = "6">'.$floor.'</font></td>'; $sql="Select*From room_booking Where Floor = {$floor} Order by Room_ID ASC"; $rs = mysql_query($sql)or die(mysql_error()); $run=0; foreach($arrRoom as $room){ if(mysql_num_rows($rs)>$run && $room == mysql_result($rs,$run,'Room_ID')){ $strTable.='<td width="70" height="70" bgcolor="#FF0000" align = "center"><font face="Waffle Regular" size = "6">จองแล้ว</font></td>'; $run++; }else{ $strTable.='<td width="70" height="70" bgcolor="#00FF00" align = "center"> <font face="Waffle Regular" size = "6">ห้องว่าง</font></a></td>'; } } $strTable.='</tr>'; } echo $strTable.'</table>'; ?> </body> </html>
echo '<td>'.$floor.'/'.$room.'<br>จองแล้ว</td>';
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง