<!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>รับอะไหล่เ้ข้าสต๊อก</title> </head> <script language="JavaScript"> function check() { for(i=1;i<=document.form1.count.value;i++) { //*** จำนวนการรับเข้า ***/ if(eval("document.form1.spt_id"+i+".checked")) { eval(document.getElementById("receive"+i+"").disabled=false); eval("document.form1.receive"+i+".style.backgroundColor='#FFFFFF'"); }else{ eval(document.getElementById("receive"+i+"").disabled=true); eval("document.form1.receive"+i+".style.backgroundColor='#999999'"); } } } function freecheck() { for(i=1;i<=document.form1.count.value;i++) { if(eval("document.form1.receive"+i+".disabled=false.value")=="") { alert('กรุณาเลือกอะไหล่ลำดับที่ ' + i); eval("document.form1.receive"+i+".focus();") return false; }else{ return true; } } } function ClickCheckAll(vol) { var i=1; for(i=1;i<=document.form1.count.value;i++) { if(vol.checked == true) { eval("document.form1.spt_id"+i+".checked=true"); } else { eval("document.form1.spt_id"+i+".checked=false"); } } } <!-- function enable_text(status) { for(i=1;i<=document.form1.count.value;i++) { status=!status; document.form1.receive<?=$i;?>.disabled = status; } } //--> </script> <? include ("config.inc.php"); include ("css.php");?> <body> <table width="930" height="325" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC"> <tr> <td height="25" colspan="10"><? include("header.php");?></td> </tr> <tr> <td height="25" colspan="10"><div align="center"><? include('all_check_stat.php');?></div></td> </tr> <tr> <td height="25" colspan="10"> </td> </tr> <tr> <td height="25" colspan="10"><div align="center"><strong>รับอะไหล่เ้ข้าสต๊อก</strong></div></td> </tr> <form name="form1" action="add_purchase_receive.php" method="post" onSubmit="return freecheck(this);" > <tr> <td height="25" colspan="10"><br></td> </tr> <tr> <td width="9"> </td> <td width="29" height="25"><div align="center"> <input name="CheckAll" type="checkbox" value="Y" onclick="ClickCheckAll(this);check(this.checked);" /> </div></td> <td width="51" height="25"><div align="center">ลำดับ</div></td> <td width="111" height="25">เลขที่การสั่งซื้อ</td> <td width="81" height="25">รหัสอะไหล่</td> <td width="160" height="25">รหัสสินค้า</td> <td width="218" height="25">ชื่อ</td> <td width="80" height="25">จำนวนที่สั่ง</td> <td width="99" height="25"><div align="center">วันที่สั่งอะไหล่</div></td> <td width="92" height="25"><div align="center">รับเข้า</div></td> </tr> <?php $sql = " SELECT a.*,b.name,b.spt_code FROM purchase_order a , spares_part b where a.spt_id = b.spt_id and a.status = '0' ORDER BY dd,mm,yy "; $query = mysql_db_query($dbname,$sql); $numrows = mysql_num_rows($query); if($numrows == 0) { ?> <tr> <td height="25" colspan="10"><br></td> </tr> <tr> <td height="25" colspan="10"><div align="center" class="style1">ไม่พบข้อมูลการสั่งซื้อะไหล่</div></td> </tr> <tr> <td height="25" colspan="10"><br><br><br><br><br><br></td> </tr> <? }else{ // เริ่มวนรอบแสดงข้อมูล $x = 0; while($result = mysql_fetch_array($query)) { $x++; $po_id = $result['po_id']; $spt_id = $result['spt_id']; $spt_code = $result['spt_code']; $name = $result['name']; $buy_order = $result['buy_order']; $dd = $result['dd']; $mm = $result['mm']; $yy = $result['yy']; ?> <tr> <td> </td> <td height="25"><div align="center"> <input type="checkbox" name="spt_id[]" id="spt_id<?=$x;?>" value="<?php echo $spt_id; ?>" onclick="check(this.checked)" > </div></td> <td height="25"><div align="center"><?=$x; ?></div></td> <td height="25"><?=$po_id; ?></td> <td height="25"><?=$spt_id; ?></td> <td height="25"><?=$spt_code; ?></td> <td height="25"><?=$name; ?></td> <td height="25"><div align="center"> <?=$buy_order; ?> </div></td> <td height="25"><div align="center"><? echo " ".$dd."-".$mm."-".$yy." "; ?></div></td> <td height="25"><div align="center"> <input type="text" name="receive[<?=$x;?>]" id="receive<?=$x;?>" style="width:30px;background-color:#999999;" onKeyPress="return number(event,this.value)" maxlength="3" disabled="disabled" > </div></td> </tr> <input name="po_id[]" type="hidden" value="<?=$po_id;?>" /> <input name="spt_id[]" type="hidden" value="<?=$spt_id;?>" /> <input name="spt_code[]" type="hidden" value="<?=$spt_code;?>" /> <input name="name[]" type="hidden" value="<?=$name;?>" /> <input name="buy_order[]" type="hidden" value="<?=$buy_order;?>" /> <? }// end while } //end else?> <tr> <td height="25" colspan="10"><br><br><br><br></td> </tr> <tr> <td></td> <td height="25"></td> <td height="25" colspan="2"> <input type="submit" name="submit" value="รับรถเข้าสต็อกฝ่ายประเมิน" onclick="return confirm('คุณต้องการรับอะไหล่เข้าสต๊อกใช่หรือไม่ ?')" /> </td> <input type="hidden" name="count" value="<?=$x;?>"> <td height="25"> </td> <td height="25"> </td> <td height="25"> </td> <td height="25"> </td> <td height="25"> </td> <td height="25"> </td> </tr> </form> <tr> <td height="25" colspan="10"> </td> </tr> <tr> <td height="25" colspan="10"> </td> </tr> <tr> <td height="25" colspan="10"> </td> </tr> </table> <p> <? mysql_close($objConnect);?> </p> <p><? include("footer.php");?></p> </body> </html> <? include("pp_key.php"); ?>
function freecheck(){ for(i=1;i<=document.form1.count.value;i++){ if(eval("document.form1.spt_id"+i+".checked")){ if(eval("document.form1.receive"+i+".disabled=false.value")==""){ alert('กรุณาเลือกอะไหล่ลำดับที่ ' + i); return false; } } } }
function freecheck() { for(i=1;i<=document.form1.count.value;i++) { if(eval("document.form1.spt_id"+i+".checked")) { if(eval("document.form1.receive_"+i+".value")=="") { alert('กรุณาเลือกอะไหล่ลำดับที่ ' + i); eval("document.form1.receive_"+i+".focus();") return false; } } } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง