Esempio n. 1
0
 $val_name_shop = $getShop['name_shop'];
 $val_name_region = $getShop['name_region'];
 $val_name_province = $getShop['name_province'];
 $val_tel_shop = $getShop['tel_shop'];
 if ($val_tel_shop == NULL) {
     $val_tel_shop = "-";
 }
 $sum_order = $_GET['sum_order'];
 $debt = $_GET['debt'];
 $price_product_refunds = $_GET['price_product_refunds'];
 //    $getPayByID2 = getPayByID2($idshop, $idshipment_period);
 //    $val_price_order_total = $getPayByID2['price_pay'];
 $Beforeid = getBeforeid($idshipment_period);
 //ได้ค่าidรอบถัดไป --> อัพเดทรอบนี้ด้วย
 $val_before_idshipment_period = $Beforeid['idshipment_period'];
 $Nextid = getNextid($idshipment_period);
 //ได้ค่าidรอบถัดไป --> อัพเดทรอบนี้ด้วย
 $val_next_idshipment_period = $Nextid['idshipment_period'];
 $val_next_date_end = $Nextid['date_end'];
 $date2 = str_replace('-', '/', $val_next_date_end);
 $endNextdate = date('Y-m-d', strtotime($date2 . "0 days"));
 $val_next_date_end2 = $getShipment_period['date_end'];
 $date_shop2 = str_replace('-', '/', $val_next_date_end2);
 $endNextdate2 = date('Y-m-d', strtotime($date_shop2 . "1 months"));
 //ไม่ต้องตรวจสอบวันที่เช็ค ของ2รอบถัดไป --> ใช้ fix 2เดือนถัดไปแทน($endNextdate_cheque2)
 //    $Nextid_cheque = getNextid($idshipment_period + 1);
 //    $val_next_date_end_cheque = $Nextid_cheque['date_end'];
 //    $date_cheque = str_replace('-', '/', $val_next_date_end_cheque);
 //    $endNextdate_cheque = date('Y-m-d', strtotime($date_cheque . "0 days"));
 $val_next_date_end_cheque2 = $getShipment_period['date_end'];
 $date_cheque2 = str_replace('-', '/', $val_next_date_end_cheque2);
    }
    $sum_order = $_GET['sum_order'];
    $debt = $_GET['debt'];
    $price_product_refunds = $_GET['price_product_refunds'];
    //    $getPayByID2 = getPayByID2($idshop, $idshipment_period);
    //    $val_price_order_total = $getPayByID2['price_pay'];
    $Beforeid = getBeforeid($idshipment_period);
    //ได้ค่าidรอบถัดไป --> อัพเดทรอบนี้ด้วย
    $val_before_idshipment_period = $Beforeid['idshipment_period'];
    $Nextid = getNextid($idshipment_period);
    //ได้ค่าidรอบถัดไป --> อัพเดทรอบนี้ด้วย
    $val_next_idshipment_period = $Nextid['idshipment_period'];
    $val_next_date_end = $Nextid['date_end'];
    $date2 = str_replace('-', '/', $val_next_date_end);
    $endNextdate = date('Y-m-d', strtotime($date2 . "0 days"));
    $Nextid_cheque = getNextid($idshipment_period + 1);
    $val_next_date_end_cheque = $Nextid_cheque['date_end'];
    $date_cheque = str_replace('-', '/', $val_next_date_end_cheque);
    $endNextdate_cheque = date('Y-m-d', strtotime($date_cheque . "0 days"));
    $getPayDetailByID_before_idshipment_period = getPayDetailByID($idshop, $val_before_idshipment_period);
    $val_debt_before_shipment = $getPayDetailByID_before_idshipment_period['debt'];
    //ยอดค้างชำระ(รอบที่แล้ว)
    $price_pay_repeat = $sum_order + $val_debt_before_shipment - $price_product_refunds;
    $price_pay = $price_pay_repeat * -2 + $price_pay_repeat;
    echo $price_pay;
}
?>
<script>
    var data = JSON.stringify(<?php 
echo getBankShop();
?>