我想在每次使用时更新我选择的元素中的显示数据editqtycan.php在一个弹出窗口中。我正在创建一个条码系统。请帮助我如何在不刷新页面的情况下更新它。自动刷新显示表无需重新加载页面
<?php
$sql="SELECT allinvty3.*, barcode.* , pd_stock_transfer.*, barcode.qty as codeqty, barcode.id as barcodeid from pd_stock_transfer
LEFT JOIN barcode on pd_stock_transfer.in_code = barcode.itemcode
INNER JOIN allinvty3 on pd_stock_transfer.in_code = allinvty3.in_code
where pd_stock_transfer.refnumber='$temp' and barcode.refnumber='$temp' and barcode.receivestatus='INCLUDED' group by barcode.itemcode ORDER BY allinvty3.ecr_desc ASC ";
$result = $conn->query($sql);
echo"<div style='height:450px; overflow-y: scroll;'>";
echo "<table class='table table-bordered table-hover table-condensed '>";
echo"<tr class='info'><th>MODEL</th><th>ITEM CODE</th><th>ACTUAL REC.</th><th>REQUEST QTY.</th><th>DIFF.</th>
</tr>";
echo"<font size='5'><p class='text-primary'>ACTUAL</p></font>";
while($row = $result->fetch_assoc()){
$receivestatus =$row['receivestatus'];
$icount = $row['codeqty'];
$qty = $row['qty'];
$total1 = $row['codeqty'] - $qty;
//I want this division an auto update every time I want to edit the ***qty row***.
echo"<tr>";
echo "<td align= center>".$row['ecr_desc']."</td>";
echo "<td align= center>".$row['itemcode']."</td>";
echo "<td align=center>".$row['codeqty']."</td>";
echo "<td align=center>".$row['qty']."</td>";
if ($icount > $row['qty']){
echo"
<td bgcolor='#FF0000' align='center'>";}
else if ($icount < $row['qty']){
echo"<td bgcolor= '#006400' align='center'>";
}
else{
echo"
<td align='center'>";
}
{
echo " ".$total1."</td>";
}
//this link is where I can edit the qty in a popup window. I don't want to use bodyonunload.
echo"<td><a href='#' onclick=PopupCenter1('editqtyscan.php?Tid=".$row['barcodeid']."','myPop2',400,400)>Edit Qty</a></td>";
}?>
</tr>
</table></div></div>
谢谢你的建议,我会记住这一点。 – EHEM