<?php require_once ('connect.php'); connect() ; $sql = "SELECT stockmaster.* , branchstock.BranchName FROM stockmaster"; $sql =$sql . " INNER JOIN branchstock ON stockmaster.BranchId = branchstock.Id "; $sql =$sql . "where stockmaster.Id= " . $_GET["Id"]; $BrnrecordSet = mysql_query($sql, $objConnect) or die(mysql_error()); ?> <div align="center"> <form name="form1" method="post" action="EditDetail.php"> <?php while ($Row = mysql_fetch_array($BrnrecordSet)) { $BrnName = $Row["BranchName"]; $ProductCode = $Row["ProductCode"]; $SerialNo = $Row["SerialNo"]; $Spec = $Row["Spec"]; $ActualQTY = $Row["ActualQTY"]; $Status = $Row["Status"]; $StatusDate = $Row["StatusDate"]; } ?> <table> <tr> <td >สาขา:</td> <td> <input type="hidden" name = "Id" value="<?php echo $_GET["Id"]; ?>" /> <input type="text" name="BranchName" value="<?php echo $BrnName; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">รุ่นรถ:</td> <td width="64%"> <input type="text" name="ProductCode" value="<?php echo $ProductCode; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">SerialNo:</td> <td width="64%"> <input type="text" name="SerialNo" value="<?php echo $SerialNo; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">รายละเอียด:</td> <td width="64%"> <input type="text" name="Spec" value="<?php echo $Spec; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">จำนวน:</td> <td width="64%"> <input type="text" name="ActualQTY" value="<?php echo $ActualQTY; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">สถานะ:</td> <td width="64%"> <input type="text" name="Status" value="<?php echo $Status; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top">วันที่สาขารับมอบ:</td> <td width="64%"> <input type="text" name="StatusDate" value="<?php echo $StatusDate; ?>"> </td> </tr> <tr> <td width="36%" align="right" valign="top"></td> <td width="64%"> <input type="submit" name="submit" value="บันทึก"> <button name="BtnBack" onclick="location.href = ''stockplanlist.php"> กลับ</button> </td> </tr> </td> </tr> </table> </div> </form>
$sql = "DELETE FROM stockmaster WHERE Id"; $result = mysql_query($sql, $objConnect) or die(mysql_error()); $ProdCodeS = $_POST["ProductCode"] . "_Act"; $sql = "DELETE branchstock SET " . $ProdCodeS . ""; $sql = $sql . " WHERE Id=" . $_POST["Id"]; $result = mysql_query($sql, $objConnect) or die(mysql_error()); $result = mysql_query($sql, $objConnect) or die(mysql_error()); if ($result) { echo '<script language="javascript">javascript:alert("save complete");</script>'; header("location:stockactuallist.php"); }
$ProdCodeS = $_POST["ProductCode"] . "_Act"; $sql = "DELETE branchstock SET " . $ProdCodeS . ""; $sql = $sql . " WHERE Id=" . $_POST["Id"]; $result = mysql_query($sql, $objConnect) or die(mysql_error()); $result = mysql_query($sql, $objConnect) or die(mysql_error());
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง