開票(請款單)資料上載

readonly id="form_key" maxlength="12">
readonly id="yyyymm" maxlength="6">

"笔数", "date_seq" => "日期-號碼", "customerid" => "客戶/供應商編碼", "item_no" => "品項編碼", "num" => "數量", "unit_price" => "單價", "pre_tax_price" => "稅前價格", "business_tax" => "營業稅", "summary_price" => "合計", "enter_date" => "銷貨單最初輸入日期" ); echo ""; foreach (array_values($fields_mapping) as $val) { echo ""; } echo " "; echo " "; $sql_group_epot = " SELECT count(*) cnt, date_seq, customerid, item_no, num, unit_price, pre_tax_price, business_tax, summary_price, enter_date From ec_purchase_order_tmp WHERE form_key = '" . $_GET['error_form_key'] . "' GROUP BY date_Seq, customerid, item_no, num, unit_price, pre_tax_price, business_tax, summary_price, enter_date HAVING COUNT(*) > 1"; $res_group_epot = mysqli_fetch_all(mysqli_query($link, $sql_group_epot), MYSQLI_ASSOC); foreach ($res_group_epot as $row) { echo " "; foreach (array_keys($fields_mapping) as $val) { echo ""; } echo " "; } $sql_group_epot = " SELECT count(*) cnt, date_seq, customerid, item_no, num, unit_price, pre_tax_price, business_tax, summary_price, enter_date From ec_purchase_order_tmp WHERE form_key = '" . $_POST['form_key'] . "' GROUP BY date_Seq, customerid, item_no, num, unit_price, pre_tax_price, business_tax, summary_price, enter_date HAVING COUNT(*) > 1"; $res_group_epot = mysqli_fetch_row(mysqli_query($link, $sql_group_epot)); #存在重复的记录ec_purchase_order_import if (!empty($res_group_epot)) { header("location: ec_purchase_order_import.php?error_form_key=" . $_POST['form_key']); exit(); } $sql_group_epo = " SELECT count(*) cnt, a.date_seq, a.customerid, a.item_no, a.num, a.unit_price, a.pre_tax_price, a.business_tax, a.summary_price, a.enter_date FROM ec_purchase_order a, ec_purchase_order_tmp b WHERE a.date_seq = b.date_seq AND a.customerid = b.customerid AND a.item_no = b.item_no AND a.num = b.num AND a.unit_price = b.unit_price AND a.pre_tax_price = b.pre_tax_price AND a.business_tax = b.business_tax AND a.summary_price = b.summary_price AND a.enter_date = b.enter_date GROUP BY a.date_seq, a.customerid, a.item_no, a.num, a.unit_price, a.pre_tax_price, a.business_tax, a.summary_price, a.enter_date"; $res_group_epo = mysqli_fetch_all(mysqli_query($link, $sql_group_epo), MYSQLI_ASSOC); foreach ($res_group_epo as $row) { echo " "; foreach (array_keys($fields_mapping) as $val) { echo ""; } echo " "; } } ?>
异常!上传资料存在重复记录
$val
" . $row[$val] . "
" . $row[$val] . "