Esempio n. 1
0
        $complaint_erp_url_test = $complaint_erp_url;
        $complaint_erp_url = substr($complaint_erp_url, 0, strpos($complaint_erp_url, "?"));
        /**
        		$complaint_erp_url=str_replace(":platname", $platname, $complaint_erp_url);
        		$complaint_erp_url=str_replace(":orderid", $orders_id, $complaint_erp_url);
        		$complaint_erp_url=str_replace(":type", $complaint_type, $complaint_erp_url);
        		$complaint_erp_url=str_replace(":content", $content, $complaint_erp_url);
        		/**/
        $erp_context = array('platname' => $web_platname, 'orderid' => $orders_id, 'type' => $complaint_type, 'content' => $content, 'cid' => $cid);
        if (!empty($_REQUEST['test'])) {
            echo 'complaint_erp_url:' . $complaint_erp_url;
            print_r($erp_context);
            echo '<br>erp_result:' . $erp_result;
            echo $complaint_erp_url . '?' . http_build_query($erp_context);
        }
        $erp_result = PostERP($complaint_erp_url, $erp_context);
        if (strpos($erp_result, "200") !== false) {
            $insert_erp_error = false;
        } else {
            $insert_erp_error = true;
        }
        //echo $complaint_erp_url;print_r($erp_context);echo '$erp_result:'.$erp_result;
    } else {
        $order_is_not_valid = true;
    }
}
$_SESSION['add_token'] = time();
//不能放在insert操作的上面
//所有的订单id
$orderid_query = "SELECT orders_id from " . TABLE_ORDERS . " where customers_id = :customersID ORDER BY   orders_id DESC";
$orderid_query = $db->bindVars($orderid_query, ':customersID', $_SESSION['customer_id'], 'integer');
Esempio n. 2
0
    $db->Execute($refund_add_query);
    $token = "";
    //发送数据到erp
    $erp_url = getERPInterface('refund');
    $erp_url = substr($erp_url, 0, strpos($erp_url, "?"));
    /**
    		$complaint_erp_url=str_replace(":platname", $platname, $complaint_erp_url);
    		$complaint_erp_url=str_replace(":orderid", $orders_id, $complaint_erp_url);
    		$complaint_erp_url=str_replace(":type", $complaint_type, $complaint_erp_url);
    		$complaint_erp_url=str_replace(":content", $content, $complaint_erp_url);
    		/**/
    $erp_context = array('platname' => $web_platname, 'orders_id' => $orders_id, 'product' => $product, 'return_type' => $return_type, 'customers_name' => $customers_name, 'telphone' => $telphone, 'email' => $email, 'address' => $address, 'apply_reason' => $apply_reason);
    if (isset($_REQUEST['debug']) && $_REQUEST['debug'] == 'debug') {
        echo $erp_url . '?' . http_build_query($erp_context);
    }
    $erp_result = PostERP($erp_url, false, stream_context_create($erp_context));
    if (strpos($erp_result, "200") !== false) {
        $insert_erp_error = false;
    } else {
        $insert_erp_error = true;
    }
}
$_SESSION['add_token'] = time();
//不能放在insert操作的上面
/**
//所有可用的退款类型
$refund_types_query = "select * from 2011refund_types  
					   where refund_type_status=1 ";
$refund_types = $db->Execute($refund_types_query);
$refund_types_arr = array();
while(!$refund_types->EOF) {