<form id="frmSearch" name="frmSearch" method="post" action="update_shift.php" onSubmit="JavaScript:return fncSubmit();"> <TABLE width="294" border=1 align="center" cellPadding=2 cellSpacing=0 class="body"> <TBODY> <TR class="body"> <td height="27" colspan="2" align="center" bgcolor="#8DA5BD"> <b>MANAGE SHIFT</b></td> </TR> <TR class="body"> <td height="27"><strong>Departure Date :</strong></td> <TD ><label for="departuredate"></label> <input name="departuredate" type="text" id="departuredate" readonly="readonly" value="<?php echo $date_chack ?>" /></TD> </TR> <TR class="body"> <td height="27"><strong>Destination :</strong></td> <input name="tourID_id" type="hidden" id="tourID_id" readonly="readonly" value="<?php echo $tourID_id ?>" /> <TD ><input name="tourID" type="text" id="tourID" readonly="readonly" value="<?php echo $destination_name ?>" /></TD> </TR> <?php $queryzz2012 = "SELECT * FROM shift_management WHERE tourID = '$destination' and datediff(departuredate,'$departuredate') = 0"; $objQuery = mysql_query($queryzz2012); $i = 0; $staffID = array(); $shiftID = array(); while($objResuut = mysql_fetch_array($objQuery)) { $staffID[$i] = $objResuut["staffID"]; $i++; } ?> <TR class="body"> <td height="27"><strong>Captian :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="001" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[0] ?>" /></TD> </TR> <TR class="body"> <td height="27"><strong>Engineer :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="002" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[1] ?>" /></TD> </TR> <TR class="body"> <td height="27"><strong>Crew I :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="003" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[2] ?>"/></TD> </TR> <TR class="body"> <td height="27"><strong>Crew II :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="004" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[3] ?>"/></TD> </TR> <TR class="body"> <td height="27"><strong>Guide Leader :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="005" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[4] ?>"/></TD> </TR> <TR class="body"> <td height="27"><strong>Guide :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="006" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[5] ?>"/></TD> </TR> <TR class="body"> <td height="27"><strong>Photographer :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="007" /> <TD ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[6] ?>"/></TD> </TR> <TR class="body"> <td width="116" height="27"><strong>Video :</strong></td> <input name="dutyID[]" type="hidden" id="dutyID" value="008" /> <TD width="164" ><input type="text" name="staffID[]" id="staffID" value="<?php echo $staffID[7] ?>"/></TD> </TR> </TBODY> </TABLE> <p> <input type="submit" name="button" id="button" value="Submit Form" /> <input type="reset" name="button2" id="button2" value="Reset Form" /> </form>
<?php require('conn_mysql.php'); for($i=0;$i<count($_POST["staffID"]);$i++) { $date_go = $_POST['departuredate']; $tourID_id = $_POST['tourID_id']; $staffID = $_POST['staffID'][$i]; $dutyID = $_POST['dutyID'][$i]; $sql3 = "update shift_management set departuredate='$date_go',tourID='$tourID_id',staffID='$staffID',dutyID='$dutyID' WHERE tourID='$tourID_id' and departuredate='$date_go'"; echo $sql3; $query = mysql_query($sql3) or die(mysql_error()); } ?>
echo "รับค่าstaffID ตัวที่ $i = ".$_POST["$staffID"][$i]."<br />";
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง