<?php

require_once 'function/func_addorder.php';
session_start();
$idproduct_refunds = $_GET['idproduct_refunds'];
$idorder_product_refunds = $_GET['idorder_product_refunds'];
//echo $idorder_product_refunds;
$getEdit = get_edit_product_refunds($idproduct_refunds);
$idunit = $getEdit['idunit'];
$amount = $getEdit['amount_product_refunds'];
$price = $getEdit['price_product_refunds'];
$total = $price * $amount;
$getUnit = getUnit3($idunit);
$idProduct = $getUnit['idproduct'];
$nameUnit = $getUnit['name_unit'];
$nameFactory = $getUnit['name_factory'];
$price_unit = $getUnit['price_unit'];
$nameProduct = "[" . $getUnit['code_product'] . "] " . $getUnit['name_product'] . " - " . $nameFactory;
$idFactory = $getUnit['idfactory'];
$type_factory = $getUnit['type_factory'];
$total_price_all = 0;
$idshop = $_GET['idshop'];
$getProductRefunds = getProductRefunds_total($idorder_product_refunds, $idproduct_refunds);
foreach ($getProductRefunds as $value) {
    $val_price = $value['price_product_refunds'];
    $val_amount = $value['amount_product_refunds'];
    $total_price_all += $val_price * $val_amount;
}
//echo $total_price_all;
$getHisdiff = hisDiff($idProduct, $idshop);
$diff = $_GET['diff'];
<?php

require_once 'function/func_shipment.php';
$idproduct_order = $_GET['idproduct_order'];
$idshipment_period = $_GET['idshipment_period'];
$idfactory = $_GET['idfactory'];
$getProduct_order = getProduct_orderByID($idproduct_order);
$val_amount_product_order = $getProduct_order['amount_product_order'];
$val_name_unit = $getProduct_order['name_unit'];
$val_idunit = $getProduct_order['idunit'];
$val_idproduct = $getProduct_order['idproduct'];
$val_idunitOld = $getProduct_order['idunit'];
$price = $_GET['price'];
$status_shipment_factorys = $_GET['status_shipment'];
$getCode = getUnit3($val_idunit);
$code = $getCode['code_product'];
$val_name_product = '[' . $code . "] " . $getProduct_order['name_product'] . " - " . $getCode['name_factory'];
/* echo $val_idproduct . " ";
  echo $val_idunitOld . " ";
  echo $val_amount_product_order; */
?>

<script>
    function LoadData(str) {
        var idunitOld = <?php 
echo $val_idunitOld;
?>
;
        //alert(idunitOld);
        var idproduct = document.getElementById('idP').value;
        //alert(idproduct);