<title>ไฟ</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.1/jquery.mobile-1.2.1.min.css" /> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.1/jquery.mobile-1.2.1.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/jquery.screwdefaultbuttonsV2.js"></script> <script type="text/javascript"> $(function(){ $('input:radio').screwDefaultButtons({ image: 'url("images/radioSmall.jpg")', width: 20, height: 1 }); }); </script> <script language="JavaScript"> function dis() { var Rows = document.form1.count.value; for(x=1;x<=Rows;x++) { var bill1 = document.getElementById("bill"+x+"_1"); var bill2 = document.getElementById("bill"+x+"_2"); var bill3 = document.getElementById("bill"+x+"_3"); var jing1 = document.getElementById("jing"+x+"_1"); var jing2 = document.getElementById("jing"+x+"_2"); var jing3 = document.getElementById("jing"+x+"_3"); var error = document.getElementById("error"+x+"_1"); if(bill1.checked == true && jing3.checked==true) { error.checked=true; } else if(bill1.checked == true && jing1.checked==true) { error.checked=false; } else if(bill2.checked == true && jing2.checked==true) { error.checked=false; } else if(bill1.checked == true && jing2.checked==true) { error.checked=false; } else if(bill3.checked == true && jing1.checked==true) { error.checked=false; } else if(bill2.checked == true && jing3.checked==true) { error.checked=true; } else if(bill3.checked == true && jing3.checked==true) { error.checked=true; } } } </script> </head> <form action="save_chkmotor.php" method="post" name="form1"> <div data-role="page"> <div data-role="content" data-theme="d"> <table width="63%"> <tr align="center"> <td width="4%">#</td> <td width="13%">รายการตรวจสภาพ</td> <td width="20%">ตามใบตรวจสภาพ</td> <td width="20%">ตามที่ตรวจจริง</td> <td width="6%">รายการผิดลพาด</td> </tr> <? include "connect.php"; $strSQL = "SELECT * FROM spare_store WHERE brand_id = '".$_GET["bID"]."' AND class_id = '".$_GET["cID"]."' ORDER BY idno ASC"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $count = mysql_num_rows($objQuery); $x=0; while($objResult = mysql_fetch_array($objQuery)) { $x++; $sp_code = $objResult["sp_code"]; $sp_name = $objResult["sp_name"]; $price = $objResult["price"]; $brand = $objResult["brand_id"]; $class = $objResult["class_id"]; ?> <tr align="center"> <td><?=$x;?>.</td> <td align="left"><?=$sp_name?></td> <input name="strno" type="hidden" value="<?=$_GET["mID"];?>" /> <input name="sp_code[<?=$x;?>]" type="hidden" value="<?=$sp_code;?>" /> <input name="sp_name[<?=$x;?>]" type="hidden" value="<?=$sp_name;?>" /> <input name="price[<?=$x;?>]" type="hidden" value="<?=$price;?>" /> <td> <div data-role="fieldcontain"> <fieldset data-role="controlgroup" data-type="horizontal" > <input type="radio" name="bill[<?=$x;?>]" id="bill<?=$x;?>_1" value="1" onclick="dis()"/> <label for="bill<?=$x;?>_1">ใช้ได้</label> <input type="radio" name="bill[<?=$x;?>]" id="bill<?=$x;?>_2" value="2" onclick="dis()"/> <label for="bill<?=$x;?>_2">ชำรุด</label> <input type="radio" name="bill[<?=$x;?>]" id="bill<?=$x;?>_3" value="3" onclick="dis()"/> <label for="bill<?=$x;?>_3">ไม่มี</label> </fieldset> </div> </td> <td> <div data-role="fieldcontain"> <fieldset data-role="controlgroup" data-type="horizontal" > <input type="radio" name="jing[<?=$x;?>]" id="jing<?=$x;?>_1" value="1" onclick="dis()"/> <label for="jing<?=$x;?>_1">ใช้ได้</label> <input type="radio" name="jing[<?=$x;?>]" id="jing<?=$x;?>_2" value="2" onclick="dis()"/> <label for="jing<?=$x;?>_2">ชำรุด</label> <input type="radio" name="jing[<?=$x;?>]" id="jing<?=$x;?>_3" value="3" onclick="dis()"/> <label for="jing<?=$x;?>_3">ไม่มี</label> </fieldset> </div> </td> <td> <input type="checkbox" name="error[<?=$x;?>]" id="error<?=$x;?>_1" value="1" onclick="dis()" /> <label for="error<?=$x;?>_1">ผิดพลาด</label> </td> </tr> <? } ?> <tr> <td colspan="5"> <input type="hidden" name="count" value="<?=$x;?>" /> <input type="submit" id="submit" value="บันทึกข้อมูล" data-role="button" data-inline="true" data-theme="b"/> </td> </tr> </table> </div> </div> </form>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <? include "connect.php"; $sp_id = $_POST["sp_id"]; $error = $_POST["error"]; $count = $_POST["count"]; $strno = $_POST["strno"]; $spe_id = $_POST["spe_id"]; $sp_code = $_POST["sp_code"]; $sp_name = $_POST["sp_name"]; $drive = $_POST["drive"]; $bill = $_POST["bill"]; $jing = $_POST["jing"]; $error = $_POST["error"]; $price = $_POST["price"]; $brand = $_POST["brand"]; $class = $_POST["class"]; $type = $_POST["type"]; $userid = $_POST["emp_no"]; for($x=1;$x<=$count;$x++) { if($x != "") { echo $srtno; echo "<br>"; echo $sp_name[$x]; echo "<br>"; echo $sp_name[$x]; echo "<br>"; echo $bill[$x]; echo "<br>"; echo $jing[$x]; echo "<br>"; echo $error[$x]; echo "<br>"; echo $price[$x]; } } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง