$idorder = $_GET['idorder']; $idproduct_order = $_GET['idproduct_order']; $getProduct_Order = edit_product_order($idproduct_order); $code_product = $getProduct_Order['code_product']; $nameFactory = $getProduct_Order['name_factory']; $nameProduct = $getProduct_Order['name_product']; $nameP = '[' . $code_product . ']' . $nameProduct . ' - ' . $nameFactory; $idUnit = $getProduct_Order['idunit']; $name_unit = $getProduct_Order['name_unit']; $idProduct = $getProduct_Order['idproduct']; $amount_product_order = $getProduct_Order['amount_product_order']; $difference = $getProduct_Order['difference_product_order']; $type = $getProduct_Order['type_product_order']; $price = $getProduct_Order['price_unit']; $amount = 1; $getDiff = getDiffBathaction($idProduct, $idUnit); foreach ($getDiff as $value) { $val_amount_unit = $value['amount_unit']; $val_price = $value['price_unit']; $amount = $val_amount_unit * $amount; } $difference_amount_factory = $getProduct_Order['difference_amount_product']; $totaldiffPer = $price * $amount_product_order - $price * $amount_product_order * $difference / 100; $totaldiffBath = $price * $amount_product_order + $amount_product_order * $difference / $amount; $totaldiff = $price * $amount_product_order - $price * $amount_product_order * $difference_amount_factory / 100; ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
$val_idproduct_order = $value['idproduct_order']; $val_idproduct = $value['idproduct']; $val_name_product = $value['name_product']; $val_name_unit = $value['name_unit']; $val_name_factory = $value['name_factory']; $val_amount_product_order = $value['amount_product_order']; $val_difference_product_order = $value['difference_product_order']; $val_type_product_order = $value['type_product_order']; $val_difference_amount_factory = $value['difference_amount_product']; $val_price_unit = $value['price_unit']; $total_open = $val_price_unit * $val_amount_product_order; $total_percent = $total_open - $total_open * ($val_difference_product_order / 100); $val_status_checktransport = $value['status_checktransport']; $val_idunit = $value['idunit']; $amount = 1; $getDiff = getDiffBathaction($val_idproduct, $val_idunit); foreach ($getDiff as $value) { $val_amount_unit = $value['amount_unit']; $val_price = $value['price_unit']; $amount = $val_amount_unit * $amount; } $total_bath = $total_open + $val_difference_product_order * $val_amount_product_order; ?> <tr> <td><?php echo $i; ?> </td> <td><?php echo $val_name_product; ?>
<?php require_once dirname(__FILE__) . '/../function/func_addorder.php'; $idunit = $_GET['q']; $getidProduct = getProductdiffBath($idunit); $idproduct = $getidProduct['idproduct']; $amount = 1; $getDiff = getDiffBathaction($idproduct, $idunit); foreach ($getDiff as $value) { $val_amount_unit = $value['amount_unit']; $val_price = $value['price_unit']; $amount = $val_amount_unit * $amount; } echo $amount; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */
$productName = $_GET['productName']; $factoryName = $_GET['factoryName']; $AmountProduct = $_GET['AmountProduct']; $difference = $_GET['difference']; $DifferencePer = $_GET['DifferencePer']; $DifferenceBath = $_GET['DifferenceBath']; $total_price = $_GET['total_price']; $price = $_GET['price']; $total = $_GET['total']; $type = $_GET['type']; $date_order = date("Y-m-d"); $getIdOrder = getEdit_Order($idProduct_order); $idshop = $getIdOrder['idshop']; echo $type . $idshop; $amount = 1; $getDiff = getDiffBathaction($productName, $idUnit); foreach ($getDiff as $value) { $val_amount_unit = $value['amount_unit']; $val_price = $value['price_unit']; $amount = $val_amount_unit * $amount; } if ($type === "PERCENT") { $idproductE = EditProductOrder($idProduct_order, $idUnit, $AmountProduct, $DifferencePer, $price); $getproduct = getIDProduct($idUnit); $idproduct2 = $getproduct['idproduct']; $delDiff = deleteDifference($idproduct2, $idshop); $addDiff = addDiff_edit($idproduct2, $idshop, $type, $DifferencePer, $date_order); echo $idshop; } elseif ($type === "BATH") { $idproductE = EditProductOrder($idProduct_order, $idUnit, $AmountProduct, $DifferenceBath / $amount, $price); $getproduct = getIDProduct($idUnit);
<th>ส่วนลด</th> <th>ราคาขาย</th> <th>การกระทำ</th> </tr> </thead> <tbody> <?php if (isset($_SESSION["countProduct"])) { for ($i = 1; $i <= $_SESSION["countProduct"]; $i++) { $sum += $_SESSION["product"][$i]["total"]; //$j = $_SESSION["unit"][$i]["under_unit"]; $idUnitS = $_SESSION["product"][$i]["idUnit"]; $idFactoryS = $_SESSION["product"][$i]["factoryName"]; $idProductS = $_SESSION["product"][$i]["productName"]; $amount_plus = 1; $getDiff = getDiffBathaction($idProductS, $idUnitS); foreach ($getDiff as $value) { $val_amount_unit = $value['amount_unit']; $val_price = $value['price_unit']; $amount_plus = $val_amount_unit * $amount_plus; } ?> <tr> <td><?php echo $i; ?> </td> <td><?php $getProduct = getProduct2($idProductS); foreach ($getProduct as $value) {
$_SESSION["countProduct"]++; } else { $_SESSION["countProduct"] = 1; } $_SESSION["product"][$_SESSION["countProduct"]]["idUnit"] = $idunitW; $_SESSION["product"][$_SESSION["countProduct"]]["productName"] = $idproductOld; $_SESSION["product"][$_SESSION["countProduct"]]["factoryName"] = $idfactoryOld; $_SESSION["product"][$_SESSION["countProduct"]]["AmountProduct"] = floor($amountUnitNew); $_SESSION["product"][$_SESSION["countProduct"]]["difference"] = $diff; if ($typeOld === "PERCENT") { $_SESSION["product"][$_SESSION["countProduct"]]["DifferencePer"] = $diffOld; $_SESSION["product"][$_SESSION["countProduct"]]["DifferenceBath"] = ""; $_SESSION["product"][$_SESSION["countProduct"]]["total"] = ($val_price - $val_price * $diffOld / 100) * floor($amountUnitNew); } else { $amountSSS = 1; $getDiff = getDiffBathaction($idproductOld, $idunitW); foreach ($getDiff as $value) { $val_amount_unitS = $value['amount_unit']; $amountSSS = $val_amount_unitS * $amountSSS; } $_SESSION["product"][$_SESSION["countProduct"]]["DifferencePer"] = ""; $_SESSION["product"][$_SESSION["countProduct"]]["DifferenceBath"] = $diffOld; $_SESSION["product"][$_SESSION["countProduct"]]["total"] = ($val_price * 1 + $diffOld * $amountSSS) * floor($amountUnitNew); } $_SESSION["product"][$_SESSION["countProduct"]]["price"] = $val_price * 1; $_SESSION["product"][$_SESSION["countProduct"]]["total_price"] = $val_price * floor($amountUnitNew); $_SESSION["product"][$_SESSION["countProduct"]]["type"] = $typeOld; } } } /* $amountLast = $amountUnitNew; */