4 changed files with 152 additions and 98 deletions
@ -1,38 +1,77 @@ |
|||
<?php |
|||
require_once("../connt8.php"); |
|||
$now = gmdate("YmdHis"); |
|||
$data = 'M0000.' . $now; |
|||
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false); |
|||
?> |
|||
|
|||
try { |
|||
$contractno = 'M0225202300'; |
|||
$user_id = 'M0225'; |
|||
// $sql = "INSERT INTO comBusinessPartner (BizPartnerId,TaxNo,CreatorId) VALUES('M0225202301','0923373895','$userid')"; |
|||
// $stmt = $connT8->prepare($sql); |
|||
// $stmt->execute(); |
|||
|
|||
$sql = "UPDATE comBusinessPartner SET WorkTelNo = '' WHERE BizPartnerId= 'M0225202301'"; |
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
|
|||
echo 'Success'; |
|||
} catch (PDOException $e) { |
|||
echo '<script>alert("更新失敗")</script>'; |
|||
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script> |
|||
<script> |
|||
var body = [{ |
|||
"name": "salIncomeApplyMaster", |
|||
"rows": [{ |
|||
"BillNo": "Z001", |
|||
"BillDate": 20160811, |
|||
"OrgId": "1000", |
|||
"FOrgId": "1000", |
|||
"TypeId": "RR", |
|||
"BpOrgId": "1000", |
|||
"BizPartnerId": "C002", |
|||
"CurrId": "RMB", |
|||
"CurrOAmount": 1, |
|||
"CurrLAmount": 1, |
|||
"PersonId": "T001", |
|||
"DtOrgId": "1000", |
|||
"DueToId": "C002", |
|||
"TaxId": "123", |
|||
"CompId": "1000" |
|||
}] |
|||
}, |
|||
{ |
|||
"name": "salIncomeApplyDetail", |
|||
"rows": [{ |
|||
"BillNo": "Z001", |
|||
"IncomeId": "F203", |
|||
"TaxId": "ST003", |
|||
"RowCode": 1, |
|||
"ItemType": "1", |
|||
"SPrice": 50, |
|||
"SQuantity": 1, |
|||
"FromSourceTag": 0, |
|||
"FromBillNo": "123" |
|||
}] |
|||
} |
|||
// $sql = "SELECT * FROM comCustomer WHERE BizPartnerId = :BizPartnerId"; |
|||
// $stmt = $conn->prepare($sql); |
|||
// $stmt->bindParam(':BizPartnerId', $contractno); |
|||
// $stmt->execute(); |
|||
// $result = $stmt->fetch(PDO::FETCH_NUM); |
|||
// $arr = array(); |
|||
// if (!empty($result)) { |
|||
// foreach ($result as $key => $value) { |
|||
// $arr[$key] = $value; |
|||
// } |
|||
// } |
|||
// $count = empty($result) == '' ? 0 : COUNT($result); |
|||
// echo '<pre>'; |
|||
// print_r($result); |
|||
// echo '</pre>'; |
|||
// echo '<br/>'; |
|||
] |
|||
|
|||
// $createTime = Date('Y-m-sH-i-s'); |
|||
|
|||
// echo str_replace('-', '', $createTime); |
|||
var json = JSON.stringify(body); |
|||
console.log(json); |
|||
// obj = { |
|||
// type: 'POST', |
|||
// // url: `${corsurl}${apiurl}`, |
|||
// url: `${apiurl}`, |
|||
// dataType: 'json', |
|||
// headers: headerParam, |
|||
// data: json, |
|||
// // dataType: "json", |
|||
// success: function(res) { |
|||
// console.log(res.Status); |
|||
// console.log(res.ErrorMsg); |
|||
// console.log(res.Data); |
|||
// } |
|||
// }; |
|||
// jQuery.ajax(obj); |
|||
// // } |
|||
// }) |
|||
$.ajax({ |
|||
url: 'https://127.0.0.1:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData', |
|||
method: 'POST', |
|||
dataType: 'json', |
|||
// headers: headerParam, |
|||
data: body, |
|||
success: function(res) { |
|||
console.log('Success'); |
|||
}, |
|||
error: function(err) { |
|||
console.log(err); |
|||
} |
|||
}) |
|||
</script> |
Loading…
Reference in new issue