<input name="chk_return" type="checkbox" value="1" <? if($test1!=$test2){ echo "checked";}?>/>
<form id="form1" name="form1" method="post" action=""> <table width="337" border="1"> <tr> <td width="118">ตามใบตรวจสภาพ</td> <td width="97">ตามที่ตรวจจริง</td> <td width="100">ผิดพลาด</td> </tr> <? $test1=1; $test2=2; if($test1!=$test2){ $chk="disabled"; } ?> <tr> <td><input name="rbt1" type="radio" value="1" <? echo $chk; ?>/></td> <td><input name="rbt2" type="radio" value="1" <? echo $chk; ?>/></td> <td><input name="chk_return" type="checkbox" value="1" <? if($test1!=$test2){ echo "checked";}?>/> </td> </tr> </table> </form>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="main_style.css" rel="stylesheet" type="text/css"> <title>ตรวจสภาพรถ</title> <? include "connect.php";?> <script src="http://code.jquery.com/jquery-2.0.2.min.js"></script> <script language="javascript"> $(document).ready(function(){ is_broke(); $("[id=bill1],[id=bill0],[id=real1],[id=real0]").change(function(){ is_broke(); }); }); function is_broke() { if(($("[id=bill1]").is(':checked')==true) && ($("[id=real0]").is(':checked')==true)) { document.all.error.checked=true; } if(($("[id=bill0]").is(':checked')==true) && ($("[id=real1]").is(':checked')==true)) { document.all.error.checked=true; } if(($("[id=bill0]").is(':checked')==true) && ($("[id=real0]").is(':checked')==true)) { document.all.error.checked=false; } if(($("[id=bill1]").is(':checked')==true) && ($("[id=real1]").is(':checked')==true)) { document.all.error.checked=false; } if(real0.checked==true) { sapab1.disabled=true; sapab2.disabled=true; sapab3.disabled=true; }else if(real1.checked==true) { sapab1.disabled=false; sapab2.disabled=false; sapab3.disabled=false; } } </script> <script type="text/javascript"> function OpenReport() { var myWindow=window.open("report_error.pdf?mID=<?=$mID;?>"); if (!myWindow.opener) myWindow.opener = self; } </script> <? $strSQL = "SELECT * FROM stock INNER JOIN brand ON brand.brand_id = stock.brand INNER JOIN class ON class.class_id = stock.class INNER JOIN model ON model.type_id = stock.type INNER JOIN color ON color.color_id = stock.color INNER JOIN color1 ON color1.color_id1 = stock.color1 WHERE machine_id = '$mID' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); $machine_id = $objResult["machine_id"]; $chassis_id = $objResult["chassis_id"]; $brand_name = $objResult["brand_name"]; $class_name = $objResult["class_name"]; $type_name = $objResult["type_name"]; $color_name = $objResult["color_name"]; $color_name1 = $objResult["color_name1"]; $brand_id = $objResult["brand_id"]; $class_id = $objResult["class_id"]; ?> <div id="leftBar3"> <table style="font-size:13px; font-weight:600;" > <tr align="center"> <th colspan="2" style="font-size:14px; color:#00F;">:: ข้อมูลรถ ::</th> </tr> <tr> <td colspan="2"><hr /></td> </tr> <tr> <th width="95" align="right">เลขเครื่อง :</th> <td width="173"><input type="text" name="machine_id" id="machine_id" value="<?=$mID;?>" readonly="readonly" /> <input type="hidden" name="machine_id" id="machine_id" value="<?=$machine_id;?>"/> </td> </tr> <tr> <th width="95" align="right">เลขถัง :</th> <td width="173"><input type="text" name="chassis_id" id="chassis_id" value="<?=$chassis_id;?>" disabled="disabled" /></td> </tr> <tr> <th align="right">ยี่ห้อ :</th> <td><input type="text" name="brand" id="brand" value="<?=$brand_name;?>" disabled="disabled" /></td> </tr> <tr> <th align="right">รุ่น:</th> <td><input type="text" name="class" id="class" value="<?=$class_name?>" disabled="disabled" /></td> </tr> <tr> <th align="right">แบบ:</th> <td><input type="text" name="type" id="type" value="<?=$type_name;?>" disabled="disabled" /></td> </tr> <tr> <th align="right">ป้ายทะเบียน :</th> <td><input type="text" name="plate" id="plate"value="<?=$objResult["plate"];?>" disabled="disabled" /> </td> </tr> <tr> <th align="right">สี :</th> <td><input type="text" name="color" id="color" value="<?=$color_name;?>/<?=$color_name1;?>" disabled="disabled" /></td> </tr> <tr> <td colspan="2"><hr /><br /></td> </tr> <? include"report_error.php"; ?> <tr> <td colspan="2"><button type="button" onClick="Javascript:OpenReport();"/><img src="image/print.png" width="18" height="18" />พิมพ์รายงาน</button></td> </tr> </table> </div> <? $sql = "SELECT * FROM sys_estimate ,spares WHERE sys_estimate.sp_code = spares.sp_code AND sys_estimate.brand_id = '$brand_id' AND sys_estimate.class_id = '$class_id' ORDER BY sys_estimate.sp_code "; $query = mysql_query($sql); $count = mysql_num_rows($query); //echo $sql; ?> <div id="leftBar3"> <form action="save_estchkmotor.php" method="post" name="form1" OnSubmit="return fncSubmit(); " > <table width="980px" class="three" style="font-size:12px;font-family:Verdana, Geneva, sans-serif;" > <tr bgcolor="#999999" height="30"> <th width="91" rowspan="2">ลำดับ</th> <th width="300" rowspan="2">รายการ</th> <th colspan="2">ตามใบตรวจสภาพ</th> <th colspan="2">ตามที่ตรวจจริง</th> <th colspan="3">มี</th> <th width="85" rowspan="2">ผิดพลาด</th> <th width="85" rowspan="2">ของแต่ง</th> </tr> <tr bgcolor="#999999" height="30"> <th width="102">มี</th> <th width="83">ไม่มี</th> <th width="102">มี</th> <th width="83">ไม่มี</th> <th width="102">ชำรุด</th> <th width="83">ใช้งานไม่ได้</th> <th width="85">ใช้ได้</th> </tr> <? $i = 1; $i = $i++; while($objResult = mysql_fetch_array($query)) { $sp_id = $objResult["sp_id"]; $sp_code = $objResult["sp_code"]; $sp_name = $objResult["sp_name"]; $brand_name = $objResult["brand_name"]; $class_name = $objResult["class_name"]; $brand_id = $objResult["brand_id"]; if($i%2==0) { $bg = "#FFFFFF"; } else { $bg = "#eff3fa"; } ?> <tr align="center" height="25" bgcolor="<?=$bg;?>" onMouseOver="this.bgColor='#cedbef'" onMouseOut ="this.bgColor = '<?=$bg;?>'" > <td align="center"><?=$i++;?></td> <td align="left"><?=$sp_name;?></td> <!--มี/ไม่มี ของใบตรวจสภาพ--> <td><input name="bill[<?=$i;?>]" id="bill<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="bill[<?=$i;?>]" id="bill<?=$i;?>_2" type="radio" value="2" /></td> <!--มี/ไม่มี ตามที่ตรวจจริง--> <td><input name="real[<?=$i;?>]" id="real<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="real[<?=$i;?>]" id="real<?=$i;?>_2" type="radio" value="2" /></td> <!-- ใช้ได้ ชำรุด ใช้ไม่ได้--> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_2" type="radio" value="2" /></td> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_3" type="radio" value="3" /></td> <!-- รายการผิดพลาด ชุดแต่ง--> <td><input name="error[<?=$i;?>]" id="error<?=$i;?>" type="checkbox" value="1" /></td> <td><input name="race[<?=$i;?>]" id="race<?=$i;?>" type="checkbox" value="1"/></td> </tr> <? } ?> </table> <button type="submit" id="bttn" name="bttn"><img src="image/save.png">บันทึก</button> </div> <input type="hidden" id="count" name="count" value="<?=$count;?>" /> </form>
<script src="http://code.jquery.com/jquery-2.0.2.min.js"></script> <script language="javascript"> $(document).ready(function() { var Rows = document.form1.count.value; for(i=1;i<=Rows;i++) { var jing1 = document.getElementById("jing"+i+"_1"); var jing2 = document.getElementById("jing"+i+"_2"); var bill1 = document.getElementById("bill"+i+"_1"); var bill2 = document.getElementById("bill"+i+"_2"); is_broke(); } }); function is_broke() { if(bill2.checked==true && jing1.checked==true) { document.all.error.checked=true; alert(ok); } if(($("[id=bill1]").is(':checked')==true) && ($("[id=jing2]").is(':checked')==true)) { document.all.error.checked=true; } if(($("[id=bill1]").is(':checked')==true) && ($("[id=jing1]").is(':checked')==true)) { document.all.error.checked=false; } if(($("[id=bill2]").is(':checked')==true) && ($("[id=jing2]").is(':checked')==true)) { document.all.error.checked=false; } if(jing1.checked==true) { sapab1.disabled=true; sapab2.disabled=true; sapab3.disabled=true; }else if(jing2.checked==true) { sapab1.disabled=false; sapab2.disabled=false; sapab3.disabled=false; } } </script>
<!--มี/ไม่มี ของใบตรวจสภาพ--> <td><input name="bill[<?=$i;?>]" id="bill<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="bill[<?=$i;?>]" id="bill<?=$i;?>_2" type="radio" value="2" /></td> <!--มี/ไม่มี ตามที่ตรวจจริง--> <td><input name="jing[<?=$i;?>]" id="jing<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="jing[<?=$i;?>]" id="jing<?=$i;?>_2" type="radio" value="2" /></td> <!-- ใช้ได้ ชำรุด ใช้ไม่ได้--> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_1" type="radio" value="1" /></td> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_2" type="radio" value="2" /></td> <td><input name="sapab[<?=$i;?>]" id="sapab<?=$i;?>_3" type="radio" value="3" /></td> <!-- รายการผิดพลาด ชุดแต่ง--> <td><input name="error[<?=$i;?>]" id="error<?=$i;?>_1" type="checkbox" value="1" /></td> <td><input name="race[<?=$i;?>]" id="race<?=$i;?>" type="checkbox" value="1"/></td>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง