prepare("select * from tbl_product where `marketName`='$marketName' order by product asc "); $select->execute(); $result = $select->fetchAll(); foreach ($result as $row) { $output .= ''; } return $output; } if (isset($_POST['btnsaveorder'])) { $orderdate = date('Y-m-d'); $subtotal = $_POST['txtsubtotal']; $discount = $_POST['txtdiscount']; $sgst = $_POST['txtsgst']; $cgst = $_POST['txtcgst']; $total = $_POST['txttotal']; $payment_type = $_POST['rb']; $due = $_POST['txtdue']; $paid = $_POST['txtpaid']; ///// $arr_pid = $_POST['pid_arr']; $arr_barcode = $_POST['barcode_arr']; $arr_name = $_POST['product_arr']; $arr_stock = $_POST['stock_c_arr']; $arr_qty = $_POST['quantity_arr']; $arr_price = $_POST['price_c_arr']; $arr_total = $_POST['saleprice_arr']; $arr_purchaseprice = $_POST['purchaseprice_arr']; $companyName = $_POST['companyName']; $insert = $pdo->prepare("insert into tbl_invoice (order_date,subtotal,discount,sgst,cgst,total,payment_type,due,paid) values(:orderdate,:subtotal,:discount,:sgst,:cgst,:total,:payment_type,:due,:paid)"); $insert->bindParam(':orderdate', $orderdate); $insert->bindParam(':subtotal', $subtotal); $insert->bindParam(':discount', $discount); $insert->bindParam(':sgst', $sgst); $insert->bindParam(':cgst', $cgst); $insert->bindParam(':total', $total); $insert->bindParam(':payment_type', $payment_type); $insert->bindParam(':due', $due); $insert->bindParam(':paid', $paid); $insert->execute(); $invoice_id = $pdo->lastInsertId(); if ($invoice_id != null) { for ($i = 0; $i < count($arr_pid); $i++) { $rem_qty = $arr_stock[$i] - $arr_qty[$i]; if ($rem_qty < 0) { return "Order is not completed"; } else { $update = $pdo->prepare("update tbl_product SET stock='$rem_qty' where pid='" . $arr_pid[$i] . "'"); $update->execute(); } //else end here $insert = $pdo->prepare("insert into tbl_invoice_details (invoice_id,barcode,product_id,product_name,qty,rate,saleprice,order_date,purchaseprice,companyName) values (:invid,:barcode,:pid,:name,:qty,:rate,:saleprice,:order_date,:purchaseprice,:companyName)"); $insert->bindParam(':invid', $invoice_id); $insert->bindParam(':barcode', $arr_barcode[$i]); $insert->bindParam(':pid', $arr_pid[$i]); $insert->bindParam(':name', $arr_name[$i]); $insert->bindParam(':qty', $arr_qty[$i]); $insert->bindParam(':rate', $arr_price[$i]); $insert->bindParam(':saleprice', $arr_total[$i]); $insert->bindParam(':purchaseprice', $arr_purchaseprice[$i]); $insert->bindParam(':companyName', $companyName[$i]); $insert->bindParam(':order_date', $orderdate); if (!$insert->execute()) { print_r($insert->errorInfo()); } } //end for loop header('location:printbill.php?id=' . $invoice_id); } //1st if end //var_dump($arr_total); } if ($_SESSION['role'] == "Admin") { include_once 'header.php'; } else { include_once 'headeruser.php'; } ob_end_flush(); $select = $pdo->prepare("select * from tbl_taxdis "); $select->execute(); $row = $select->fetch(PDO::FETCH_OBJ); ?>

POS

بەرهەم هژمار بها هژمار کوژمێ گشتی ژێبرن
کۆژمە
داشکاندن
بهایێ داشکاندن کەتی سەر
SGST(%)
%
CGST(%)
%
SGST(Rs)
CGST(Rs)

TOTAL(Rs)


کۆژمە
وەرگرتن