<?php include "chksession.php"; //chack login include "header.php"; include "connect.php"; //=========== กรณีลบข้อมูลสมาชิก if($_GET["Action"]=="Delete") { //=========== ลบข้อมูล $sql_del= "delete from extra where ex_id='".$_GET["ex_id"]."'"; $dbquery_del = mysql_query($sql_del); echo"<script language='JavaScript'>"; echo"alert('ลบข้อมูลเรียบร้อยแล้ว');"; echo"window.location='extralist.php';"; echo"</script>"; } if($_GET[id]) { //กรณีเปลี่ยนสถานะ (ตัดเสร็จแล้ว) $ex_id=$_GET[id]; $sql="select * From extra where ex_id='$ex_id'"; $rst=mysql_query($sql); $arr=mysql_fetch_array($rst); if($arr[ex_type]=="เดิม"){ //นำจำนวนที่ตัดเพิ่มไปบวกในแฟ้ม suite mysql_query("Update suite Set suite_amount=suite_amount+$arr[suite_amount] Where suite_name='$arr[suite_name]' and suite_size='$arr[suite_size]'"); }elseif($arr[ex_type]=="ใหม่"){ $sqlinsert="Insert into suite values ('','$arr[type_id]','$arr[suite_name]','$arr[suite_size]','$arr[suite_detail]','$arr[suite_price_rent]','$arr[suite_price_cut]','$arr[suite_image]','$arr[suite_amount]' )"; mysql_query($sqlinsert); } mysql_query("Update extra Set ex_status='ตัดเสร็จแล้ว' Where ex_id='$ex_id'"); echo"<center>บันทึกตัดชุดเรียบร้อยแล้ว</center>"; echo"<meta http-equiv=\"refresh\" content=\"3; url=extralist.php\" />"; include "footer.php"; exit; } ?> <title>ข้อมูลการสั่งตัด</title> <table width="1000" border="0" align="center" bgcolor="#FFFFFF"> <tr> <td width="10%" height="23" align="left" valign="top" bgcolor="#FF99FF"> <?php if($_SESSION[sess_position]==2){ include "menu1.php"; }else{ include "menu2.php"; } ?> </td> <td valign="top" bgcolor="#FFFFFF"><table width="94%" border="0" align="center"> <tr> <td align="left" valign="top"><p align="center"> <table width="90%" border="0" align="center"> <tr> <td align="center"><form id="form1" name="form1" method="post" action="<? $PHP_SELF ?>"> <table width="78%" border="0"> <tr> <td height="191" align="left"><fieldset> <legend><strong>ค้นหาข้อมูลการจองชุด</strong></legend> <p> </p> <center> <table width="100%" border="0"> <tr> <td width="20%" align="left"><strong>ใส่คำค้นหา : </strong></td> <td width="19%" align="left"><label> <select name="type" id="type"> <option value="">---เลือก---</option> <option value="o_id">รหัสรายการ</option> <option value="cus_name">ชื่อลูกค้า</option> </select> </label> </td> <td width="20%" align="left"><strong>รายละเอียด :</strong></td> <td width="29%" align="left"><input type="text" name="keyword" id="keyword" /></td> <td width="12%" align="left"><input type="submit" name="button" id="button" value="ค้นหา" /></td> </tr> </table> <p> </p> </center> </fieldset></td> </tr> </table> </form></td> </tr> </table> <p align="center"> <p align="center"><strong>ข้อมูลการสั่งตัดชุด</strong> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999"> <tr align="center" bgcolor="#FF9900"> <td width="5%" bgcolor="#FF66FF">ลำดับ</td> <td width="15%" bgcolor="#FF66FF">วันที่สั่งตัด</td> <td width="21%" bgcolor="#FF66FF">ชื่อชุด</td> <td width="4%" bgcolor="#FF66FF">ไซส์</td> <td width="7%" bgcolor="#FF66FF">จำนวน </td> <td width="8%" bgcolor="#FF66FF">ประเภท</td> <td width="18%" bgcolor="#FF66FF">สถานะ</td> <td width="10%" bgcolor="#FF66FF">รายละเอียด</td> <td width="6%" bgcolor="#FF66FF">ลบ</td> </tr> <? $sql="select * From extra order by ex_id desc"; $rst=mysql_query($sql); $nrowpage=mysql_num_rows($rst); //แบ่งหน้า $list_page = 10; if (empty($page)) { $page=1; } $rt = $nrowpage%$list_page; if($rt != 0) { $totalpage = floor($nrowpage/$list_page)+1; } else { $totalpage = floor($nrowpage/$list_page); } $goto = ($page-1)*$list_page; $sql .= " limit $goto, $list_page "; $rst=mysql_query($sql); while ($row=mysql_fetch_array($rst)){ $start++; ?> <tr align="center" bgcolor="#FFFFFF"> <td><? echo $start ?></td> <td><? echo DateThai($row[ex_date],1); ?></td> <td><? echo $row[suite_name] ?></td> <td><? echo $row[suite_size] ?></td> <td><? echo $row[suite_amount] ?></td> <td><? echo $row[ex_type] ?></td> <td><? echo $row[ex_status ] ?> <? if($row[ex_status]=="สั่งตัด" and $_SESSION[sess_position]==3) {?> <a href="extralist.php?id=<? echo $row[ex_id] ?>" onclick="javascript:if(!confirm('ตัดชุดเสร็จแล้ว?'))return false;">[เสร็จแล้ว]</a> <? } ?> </td> <td><a href="extradetail.php?id=<? echo $row[ex_id];?>"><img src="inc/31.png" width="33" height="23" border="0" /></a></td> <td width="36" bgcolor="#FFFFFF"><div align="center"><a href="<?=$_SERVER['PHP_SELF'];?>?Action=Delete&ex_id=<?=$result["ex_id"];?>" onClick="return Conf<?=$result["ex_id"]; ?>(this)"><img src="inc/delete.gif" width="16" height="16" border="0"></a></div></td> </tr> <? } ?> </table> <center> <? for($i=1 ; $i<$page ; $i++) { print "<a href='$PHP_SELF?type=$type&keyword=$keyword&page=$i'> $i </a> "; } print "<font size='3' color='#EE0000'><b> [$page] </b></font> "; for($i=$page+1 ; $i<=$totalpage ; $i++) { print "<a href='$PHP_SELF?type=$type&keyword=$keyword&page=$i'> $i </a> "; } ?> </center> <p align="center">ทั้งหมด <? echo $nrowpage;?> รายการ</p> <p><br> <? if($_SESSION[sess_position]==2){?> </p> <div align="center"> <a href="extraform1.php">[สั่งตัดชุดรูปแบบเดิม]</a> <a href="extraform2.php">[สั่งตัดชุดรูปแบบใหม่]</a> </div> <? }?> </td> </tr> </table> </td> </tr> </table> <? include "footer.php";?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง