$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); $idproduct2 = $getproduct['idproduct']; $delDiff = deleteDifference($idproduct2, $idshop); $addDiff = addDiff_edit($idproduct2, $idshop, $type, $DifferenceBath, $date_order); } /* echo "$DifferenceBATH"; echo "$DifferencePer"; echo "$type"; */ echo "1"; }
$idproduct2 = $getproduct['idproduct']; $delDiff[$i] = deleteDifference($idproduct2, $idshop); $addDiff[$i] = addDiff($idproduct2, $idshop, $products[$i]['type'], $products[$i]['DifferencePer'], $date_order); } if ($products[$i]['type'] === "BATH") { $val_idunit = $products[$i]['idUnit']; $val_idproduct = $products[$i]["productName"]; $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; } $idproduct[$i] = addProductOrder($products[$i]['idUnit'], $idorder, $products[$i]['AmountProduct'], $products[$i]['DifferenceBath'] / $amount, $products[$i]['type'], $products[$i]['total_price'] / $products[$i]['AmountProduct']); $getproduct = getIDProduct($products[$i]['idUnit']); $idproduct2 = $getproduct['idproduct']; $delDiff[$i] = deleteDifference($idproduct2, $idshop); $addDiff[$i] = addDiff($idproduct2, $idshop, $products[$i]['type'], $products[$i]['DifferenceBath'], $date_order); } //echo "555"; //$idUnit[$i] = addUnit($idshop, $underIdUnit, $units[$i]['AmountPerUnit'], $units[$i]['NameUnit'], $units[$i]['price'], $units[$i]['type']); } //echo "555"; unset($_SESSION["product"]); unset($_SESSION["countProduct"]); if (isset($_SESSION['addProductShipment'])) { header("location: ../../shipment/add_shipment3.php?idshipment_period=" . $_SESSION['idshipment_period'] . "&idfactory=" . $_SESSION['idfactory'] . "&price=" . $_SESSION['price'] . "&status_shipment=" . $_SESSION['status_shipment'] . "&action=editProduct_orderCompleted"); unset($_SESSION['ship']); unset($_SESSION['addProductShipment']); unset($_SESSION['idshipment_period']);