<form name="checkForm" method="post" action="repairconfirm_req2.php" id="checkForm" onsubmit="return check()"> <br /> <table width="71%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style27"> <td width="34%" bgcolor="#C4C4C4" class="style27"><span class="style10 style20 style6">หมายเลขใบส่งซ่อม</span></td> <td width="1%"><h5><span class="style17"><span class="style6"></span></span></h5></td> <td width="65%" bgcolor="#FFFFCC" class="style27"><span class="style28 style6"> <label> <input name="number" type="text" id="number" size="15" /> </label> </span></td> </tr> <tr class="style27"> <td bgcolor="#C4C4C4" class="style27"><span class="style10 style20 style17 style20 style6">สาเหตุของปัญหา</span></td> <td> </td> <td bgcolor="#FFFFCC" class="style27"><span class="style20 style28 style6"><strong> <label> <textarea name="problem" id="problem" cols="35" rows="5"></textarea> </label> </strong></span></td> </tr> <tr class="style27"> <td bgcolor="#C4C4C4" class="style27 style6">การซ่อมแก้ไข</td> <td><span class="style6"></span></td> <td bgcolor="#FFFFCC" class="style27"><span class="style6"> <label> <textarea name="repair_method" id="repair_method" cols="35" rows="5"></textarea> </label> </span></td> </tr> <tr> <td bgcolor="#C4C4C4" class="style27"><span class="style17 style20 style20 style6">อะไหล่ที่ต้องใช้</span></td> <td><span class="style6"></span></td> <td bgcolor="#FFFFCC" class="style27"><span class="style20 style28 style6"><strong> <select name="spares_id" id="spares_id"> <option value="">--เลือก--</option> <? $sql = "Select * From spares_type order by spares_id;"; $result = mysql_query($sql); while($dbarr = mysql_fetch_array($result)) { echo "<option value=$dbarr[spares_id]>$dbarr[spares_name]</option>"; } ?> </select> </strong> (หากไม่มีไม่ต้องเลือก) </span></td> </tr> <tr> <td bgcolor="#C4C4C4" class="style27"><span class="style5 style20"><span class="style27 style20 style6">ค่าบริการ</span></span></td> <td> </td> <td bgcolor="#FFFFCC" class="style27"><span class="style29 style6"> <label> <input name="service_price" type="text" id="service_price" size="15" /> บาท</label> </span></td> </tr> <tr> <td bgcolor="#C4C4C4" class="style27"><span class="style11 style17 style20 style20 style6">ดำเนินการซ่อมเสร็จภายใน</span></td> <td><span class="style6"></span></td> <td bgcolor="#FFFFCC" class="style27"><span class="style11 style15 style17 style6">วันที่ <select name="day" id="day"> <option value="1" selected="selected">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> เดือน <select name="month" id="month"> <option value="1" selected="selected">มกราคม</option> <option value="2">กุมภาพันธ์</option> <option value="3">มีนาคม</option> <option value="4">เมษายน</option> <option value="5">พฤษภาคม</option> <option value="6">มิถุนายน</option> <option value="7">กรกฎาคม</option> <option value="8">สิงหาคม</option> <option value="9">กันยายน</option> <option value="10">ตุลาคม</option> <option value="11">พฤศจิกายน</option> <option value="12">ธันวาคม</option> </select> พ.ศ. <input name="year" type="text" id="year" size="5" /> <input name="repair_status" type="hidden" id="repair_status" value="รอการยืนยันการซ่อมจากผู้ใช้บริการ" /> </span></td> </tr> <tr bgcolor="#C4C4C4"> <td class="style27"><h5><span class="style20"><span class="style17"></span></span></h5></td> <td bgcolor="#FFFFFF"><h5> </h5></td> <td bgcolor="#FFFFCC" class="style29"><input type="submit" name="button" id="button" value="ตกลง" /> <input type="reset" name="button2" id="button2" value="ล้างข้อมูล" /></td> </tr> </table> <script language="JavaScript" type="text/javascript"> function check() { } if(document.checkForm.member.value=="") { alert("กรุณากรอกหมายเลขใบส่งซ่อมที่ต้องการแจ้มผลการตรวจซ่อม") ; document.checkForm.member.focus() ; return false ; } else if(document.checkForm.spares_id.selectedIndex==0) { alert("กรุณาเลือกประเภทอะไหล่ที่สามารถใช้ในการเปลี่ยนถ่าย") ; return false ; } else if(document.checkForm.service_price.value=="") { alert("กรุณากรอก ค่าบริการในการซ่อม") ; document.checkForm.service_price.focus() ; return false ; } if(document.checkForm.year.value=="") { alert("กรุณากรอก วัน/เดือน/ปีที่ส่งซ่อม ให้ครบถ้วนด้วยนะครับ") ; document.checkForm.year.focus() ; return false ; } else if(isNaN(document.checkForm.year.value)) { alert("ปีที่ส่งซ่อมของท่าน กรุณากรอกเฉพาะตัวเลขนะครับ") ; document.checkForm.year.focus() ; return false ; } } else return true ; } </script> </form>
<? $repair_number=$_POST[number]; $problem=$_POST[problem]; $repair_method=$_POST[repair_method]; $service_price=$_POST[service_price]; $spares = $_POST[spares_id]; $date=$_POST[day]; $month=$_POST[month]; $year=$_POST[year]; $repair_status=$_POST[repair_status]; include"../config.php"; $sql = "Update service_confirm set problem = '$problem', repair_method = '$repair_method', spares_change = '$spares', service_price = '$service_price',succ_date = '$date',succ_month = '$month',succ_year = '$year' where service_id ='$repair_number'"; // // $result = mysql_query($sql); if ($result) { echo "<p><center>การแจ้งผลการตรวจซ่อมได้ถูกบันทึกแล้ว</center>"; $sql="select * from member a,service_member b where a.member_id=b.member_id and b.service_id='$repair_number' "; $result=mysql_query($sql); $dbarr=mysql_fetch_array($result); $phone=$dbarr[phone]; $sql2="update service_member set repair_status='$repair_status',repair_status_id = '02' where service_id='$repair_number'"; $result=mysql_query($sql2); //$username = "InputUserName"; //$password ="InputPassword"; //$to = "$phone"; //$baseurl ="http://messagedd.com"; //$text = urlencode("ทดลองส่งข้อความจากระบบ pcservice"); //$url ="$baseurl/httpapi/sendsms/sendsms.aspx?username=$username&password=$password&to=$to&text=$text"; // do sendmsg call //$ret = file($url); //echo $ret[0]; //mysql_close(); } else { echo "<p><center>ไม่สามารถแจ้งผลการตรวจซ่อมได้</center>"; echo "<meta http-equiv='refresh' content='2;url=repairconfirm_req.php'>" ; } echo "<meta http-equiv='refresh' content='2;url=repairconfirm_req.php'>" ; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง