一旦我单击php页面中的Submit按钮,我就会调用url和传递值,该值是从 do_order 表中动态获取的。...
对于每个 awb ,我正在ecomexpress_awb表中辅助订单:
因此,与do_order表值一起,我需要传递
中存在的awb列值ecomexpress_awb 表,所以我尝试了以下代码。
问题:
每次通过的第一个awb号码:仅14104918100000 ....但是我需要通过与订单相关联的awb。...
如果您需要其他任何信息,请告诉我。...
<?php
$sqlb="SELECT * FROM ecomexpress_awb";
$resultb = $db_handle->runSelectQuery($sqlb);
$order_id='';
if(isset($_POST['order_id']) && $_POST['order_id']!=''){
$order_id = $_POST['order_id'];
$sqlc = "select * from ecomexpress_awb WHERE status='unused' AND awb_type='COD' limit 1";
$resultc = $db_handle->runSelectQuery($sqlc);
$sqld = "select * from ecomexpress_awb WHERE status='unused' AND awb_type='PPD' limit 1";
$resultd = $db_handle->runSelectQuery($sqld);
$payment_type='';
$sqlg="SELECT * FROM do_order where payment_type='".$payment_type."'";
$resultg = $db_handle->runSelectQuery($sqlg);
if($payment_type=="Cash on delivery")
{
$awb = $resultc[0]['awb'];
$sqle = "update ecomexpress_awb set orderid = '".$order_id."',status='used' WHERE awb ='".$awb."' limit 1";
$resulte = $db_handle->runSelectQuery($sqle);
}
else
{
$awba = $resultd[0]['awb'];
$sqlf = "update ecomexpress_awb set orderid = '".$order_id."',status='used' WHERE awb ='".$awba."' limit 1";
$resultf = $db_handle->runSelectQuery($sqlf);
}
$sqlh="SELECT * FROM do_order where order_id='".$order_id."'";
$resulth = $db_handle->runSelectQuery($sqlh);
$data =
array ('CustomerName' => $resulth[0]['customer_name'],
'OrderNo' => $order_id,
'AirWayBillNO' => $resultb[0]['awb'],
);
$url = "http://114.143.206.69:803/";
$data = json_encode($data);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$curl_response = curl_exec($curl);
curl_close($curl);
echo $curl_response ."\n";
print_r($data);