|
|
|
เรื่อง form อยู่ใน form เเล้วเวลา submit มันไม่ตรง form |
|
|
|
|
|
|
|
Code (PHP)
<form name="frmMain" action="so_process.php" method="post" OnSubmit="return onDelete();">
<table width="100%" class="table table-bordered" align="center">
<thead>
<tr height="50">
<td width="20%"><h3>หมายเลข S/O : <?php echo $number_so;?></h3></td>
<td width="50%"><h3>ชื่อลูกค้า : <?php echo $name_customer;?></h3></td>
<td colspan="3" width="30%"><h3> วันที่เปิด : <?php echo $time;?>
<input name="name_customer" type="hidden" id="name_customer" value="<?php echo $name_customer;?>" />
<input name="time" type="hidden" id="time" value="<?php echo $time;?>" />
<input name="number_so" type="hidden" id="number_so" value="<?php echo $number_so;?>" />
<input name="date_shipping" type="hidden" value="<?=$date_shipping;?>" />
</h3></td>
</tr>
<tr>
<td colspan="5"><div align="center">รายระเอียดสินค้า</div></td>
</tr>
<tr>
<td><div align="center">รหัสบาร์โค้ด</div></td>
<td colspan="2"><div align="center">ชื่อสินค้า</div> </td>
<td width="20%"><div align="center">จำนวน</div></td>
<td>
<div align="center">
ลบทั้งหมด
<input name="CheckAll" type="checkbox" id="CheckAll" value="Y" onclick="ClickCheckAll(this);" />
</div></td>
</tr>
</thead>
<?php
$sql5 = "select * from oder LEFT JOIN item ON oder.barcode_item = item.barcode_item where number_so = '$number_so'";
$qr5 =dbQuery($sql5) or die("error $sql5");
$row =dbNumRows($qr5);
$i =0;
while($objResult = dbFetchArray($qr5))
{
$barcode_item = $objResult['barcode_item'];
$number = $objResult['number'];
$i = $i + 1;
$status5 = $objResult["status"];
$sql="select SUM(number),barcode_item from s_stock Where barcode_item = '$barcode_item' group by barcode_item";
$qr =dbQuery($sql);
$rs=dbFetchArray($qr);
$number5 = $rs['SUM(number)'];
$sql6="select SUM(number),SUM(number_widen),barcode_item from oder Where barcode_item = '$barcode_item' group by barcode_item";
$qr6 =dbQuery($sql6);
$rs6=dbFetchArray($qr6);
$number6 = $rs6['SUM(number)'];
$number_widen6= $rs6['SUM(number_widen)'];
$balance = $number5-($number6-$number_widen6);
?>
<tr>
<td >
<form method="post" name="edit" action="so_process.php?edit=edit">
<input name="barcode_item" type="hidden" id="barcode_item" value="<?php echo $barcode_item;?>" />
<input name="number1" type="hidden" id="Stock<?=$i;?>" value="<?php echo $balance+$number;?>"/>
<input name="hdnnumber" type="hidden" id="hdnnumber" value="<?php echo $number;?>" />
<div class="modal fade" id="myModal<?=$objResult["barcode_item"];?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" align="center">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">แก้ไขจำนวน</h4>
</div>
<div class="modal-body">
<input type="hidden" name="category_id" value="<?=$objResult["barcode_item"];?>" />
<div class="col-md-10" align="center"><?=$objResult["name_item"];?></div><div class="col-md-2" align="center"><input name="number" type="text" id="number<?=$i;?>" onkeyup="check('<?=$i;?>');" value="<?php echo $number;?>" size="5" class="form-control" required /></div>
<br />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">ปิด</button>
<button type="submit" class="btn btn-primary">ตกลง</button>
</div>
</div>
</div>
</div>
</form><div align="center"><a href="" data-toggle="modal" data-target="#myModal<?=$objResult["barcode_item"];?>"><?=$objResult["barcode_item"];?></a></div></td>
<td colspan="2"> <?=$objResult["name_item"];?> </td>
<td><div align="center"><?=$objResult["number"];?></div></td>
<td><div align="center">
<input type="checkbox" name="chkDel[]" id="chkDel<?=$i;?>" value="<?=$objResult["barcode_item"];?>">
<input name="hdnnumber_so<?=$i;?>" type="hidden" id="hdnnumber_so<?=$i;?>" value="<?=$objResult["number_so"];?>" size="5" />
</div></td>
</tr>
<?php
}
?>
</table>
<div class="col-md-10"> </div> <div class="col-md-2"> <input type="submit" name="btnDelete" value="Delete" class="form-control"></div>
<input type="hidden" name="hdnCount" value="<?=$i;?>">
</form>
|
ประวัติการแก้ไข 2014-04-19 11:36:57
|
|
|
|
Date :
2014-04-19 11:36:30 |
By :
maojunghi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช้ Javascript Onclick ครับ
onclick="document.formname.submit();"
ก็ได้เช่นกันครับ
|
|
|
|
|
Date :
2014-04-21 01:48:25 |
By :
โสภณ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาไปใส่ตรงปุ่มหรอคับ
onclick="document.formname.submit();"
|
|
|
|
|
Date :
2014-04-21 17:02:33 |
By :
maojunghi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|