break; case "edit": $query = "select * from tb_salelist_tmp where fd_tmpsale_id='{$tmpid}'"; $db->query($query); if ($db->nf()) { while ($db->next_record()) { $tmp_paycardid = $db->f(fd_tmpsale_paycardid); } } $query = "select fd_stdetail_paycardid as paycardid from tb_salelistbackdetail where fd_stdetail_id = '{$vid}' "; $arr_data = $db->get_one($query); $arr_paycardid = explode(",", $arr_data['paycardid']); $arr_tmp_paycardid = explode(",", $tmp_paycardid); changepaycardstate($arr_paycardid, '1'); //修改刷卡器状态 changepaycardstate($arr_tmp_paycardid, '-2'); //修改刷卡器状态 $query = "update tb_salelistbackdetail set fd_stdetail_price = '{$price}' ,fd_stdetail_quantity='{$quantity}' , \n\t\t\t\t\t\t\t\t\tfd_stdetail_paycardid='{$tmp_paycardid}'\n\t\t\t\t\t\twhere fd_stdetail_id = '{$vid}' "; $db->query($query); //插入细节表 数据 countallsalepaycard($listid, 'tb_salelistback', 'tb_salelistbackdetail'); echo "<script>location.href='jxcsaleback.php?listid={$listid}';</script>"; break; } $t->set_file("salelist", "jxcsale_choosebackpaycard.html"); $arr_text = array("批次号", "刷卡器设备号", "销售价格", "供应商", "<INPUT onclick=CheckAll(this.form) type=checkbox \t value=on name=chkall class='checkall'>"); $theadth = "<thead>"; for ($i = 0; $i < count($arr_text); $i++) { $theadth .= ' <th>' . $arr_text[$i] . '</th>'; } $theadth .= "</thead>";
case "dellist": //删除整条单据数据 $query = "select * from tb_paycardstockbackdetail where fd_skdetail_stockid = '{$listid}' "; $db->query($query); while ($db->next_record()) { $skdetail_id = $db->f(fd_skdetail_id); if ($skdetail_paycardid) { $skdetail_paycardid .= "," . $db->f(fd_skdetail_paycardid); } else { $skdetail_paycardid = $db->f(fd_skdetail_paycardid); } $query = "delete from tb_salelist_tmp where fd_tmpsale_seltid = '{$skdetail_id}' and fd_tmpsale_type='stockback'"; $db->query($query); } $arr_skdetail_paycardid = explode(",", $skdetail_paycardid); changepaycardstate($arr_skdetail_paycardid, '1'); $query = "delete from tb_paycardstockback where fd_stock_id = '{$listid}'"; $db->query($query); //删除总表的数据 $query = "delete from tb_paycardstockbackdetail where fd_skdetail_stockid = '{$listid}' "; $db->query($query); //删除细节表数据 require "../include/alledit.2.php"; echo "<script>alert('删除成功!');location.href='{$gotourl}';</script>"; break; default: break; } //商品名称 $query = "select * from tb_product"; $db->query($query);