<td align="center"><a href="<?=$_SERVER["PHP_SELF"];?>?Action=Edit&CusID=<?=$objResult["id_repair"];?><?=Page=$i&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'?>">comment</a> <?php if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'>Next>></a> "; } ?>
<!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> admin </title> <style type="text/css"> body { background-color: #999; } </style> </head> <body> <form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>"> <table width="90%" border="1" align="center" cellpadding="1" cellspacing="1"> <tr> <th height="66">ชื่อและแผนก <input name="words" type="text" id="words" value="<?=$_POST["words"];?>"> <input type="submit" value="Search"> <br /></th> </tr> </table> </form> <p> <?php $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database"); $objDB = mysql_select_db("test"); mysql_query("SET NAMES utf8"); //*** Update Condition ***// if($_POST["hdnCmd"] == "Update") { $strSQL = "UPDATE service SET "; $strSQL .="comment = '".$_POST["txtEditCountryCode"]."' "; $strSQL .=",it_partner = '".$_POST["it_partner"]."' "; $strSQL .=",status = '".$_POST["status"]."' "; $strSQL .="WHERE id_repair = '".$_POST["hdnEditCustomerID"]."' "; $objQuery = mysql_query($strSQL); if(!$objQuery) { echo "Error Update [".mysql_error()."]"; } //header("location:$_SERVER[PHP_SELF]"); //exit(); } $strSQL = "SELECT * FROM test,service WHERE test.number = service.number_repair ORDER BY id_repair DESC";$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database"); $objDB = mysql_select_db("test"); // Search By Name or Email $strSQL = "SELECT * FROM service,test WHERE number = number_repair "; mysql_query("SET NAMES UTF8"); if($_GET["words"] != "") { $strSQL .= "AND (department LIKE '%".$_GET["words"]."%' or name LIKE '%".$_GET["words"]."%' ) "; } $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_repair DESC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> </p> <p> การแจ้งซ่อมทั้งหมด <?= $Num_Rows;?> หน้าที่มี <?=$Num_Pages;?> หน้า : <?php if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&words=$_GET[words]&txtKeyword=$_GET[txtKeyword]'>Next>></a> "; } ?> <br /> <br /> </p> <form name="frmMain" method="post" action="<?=$_SERVER["PHP_SELF"];?>"> <input type="hidden" name="hdnCmd" value=""> <table width="97%" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <th width="1%"> <div align="center">รูป </div></th> <th width="21%" >ชื่อ</th> <th width="23%"> <div align="center">ปัญหาที่เกิด </div></th> <th width="17%"> วิธีแก้ไข</th> <th width="10%"> สถานะ</th> <th width="5%"> comment <div align="center"></div></th> <th width="5%">review</th> </tr> <?php while($objResult = mysql_fetch_array($objQuery)) { if($objResult["id_repair"] == $_GET["id"] and $_GET["Action"] == "Edit") { ?> <tr> <td><div align="center"> <?=$objResult["id_repair"];?> <input type="hidden" name="hdnEditCustomerID" size="5" value="<?=$objResult["id_repair"];?>"> </div></td> <td><?=$objResult["name"];?></td> <td><?=$objResult["detail"];?></td> <td><div align="left"> <input type="text" name="txtEditCountryCode" size="20" value="<?=$objResult["comment"];?>"> </div></td> <td align="right"><div align="center"> <select name="status" > <option value="<?=$objResult["status"];?>"><?=$objResult["status"];?></option> <option value="กำลังดำเนินการ">กำลังดำเนินการ</option> <option value="จัดหาอุปกรณ์ทดแทน">จัดหาอุปกรณ์ทดแทน</option> <option value="แก้ไขเรียบร้อย">แก้ไขเรียบร้อย</option> </select> </div></td> <td align="left"> <select name="it_partner" > <option value="<?=$objResult["it_partner"];?>"> <?=$objResult["it_partner"];?> </option> <option value="บิน">บิน</option> <option value="ติน">ติน</option> <option value="วุด">วุด</option> <option value="โส้ย">โส้ย</option> </select> </label></td> <td align="left"><input name="btnUpdate" type="button" id="btnUpdate" value="Update" onclick="frmMain.hdnCmd.value='Update';frmMain.submit();" /> <input name="btnAdd" type="button" id="btnCancel" value="Cancel" onclick="window.location='<?=$_SERVER["PHP_SELF"];?>';" /></td> </tr> <?php } else { $status = $objResult["status"]; { if($status == "รอซ่อม") $bg="#ffffff"; // สีขาว if($status == "จัดหาอุปกรณ์ทดแทน") $bg="#adf4f3"; // สีฟ้า if($status == "กำลังดำเนินการ") $bg="#ff9af0"; // ชมภูู if($status == "แก้ไขเรียบร้อย") $bg="#ffad7e"; // สีส้ม } ?> <tr> <tr bgcolor="<?=$bg;?>"> <td height="97"><div align="center"><img src="myfile/<?=$objResult["Thumbnails"];?>" border="0"></div></td> <td> รหัสการซ่อม: <?=$objResult["id_repair"];?> <br /> ชื่อ: <?=$objResult["name"];?> <br /> แผนก: <?=$objResult["department"];?><br /> เบอร์: <?=$objResult["phone"];?> <br /> เวลา :<?=$objResult["date_create"];?> <br /></td> <td>ปัญหา : <?=$objResult["detail"];?> <br /> <br /> <br /> <br /> <br /> </td> <td><div align="top">วิธีแก้ไข: <?=$objResult["comment"];?> </div> <br /> <br /> <br /> By : <?=$objResult["it_partner"];?><br /></td> <td align="right"><div align="center"> <?=$objResult["status"];?> </div></td> <td align="center"><a href="<?=$_SERVER["PHP_SELF"];?>?Action=Edit&id=<?=$objResult["id_repair"];?>">comment</a></td> <td align="center"><a href="view.php?id=<?=$objResult["id_repair"];?>">view</a></td> </tr> <?php } ?> <?php } ?> </table> </form> <?php mysql_close($objConnect); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง