15 changed files with 1036 additions and 579 deletions
@ -1,4 +0,0 @@ |
|||
<?php |
|||
include_once "./wms/contract/conn.php"; |
|||
$contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : ''; |
|||
$facilityno = !empty($_POST['facilityno']) ? $_POST['facilityno'] : ''; |
@ -0,0 +1,38 @@ |
|||
<?php |
|||
require_once("../T8_Authorization_from_bpm.php"); |
|||
|
|||
function T8salIncomeApply($data, $api_url) |
|||
{ |
|||
|
|||
$validation = get_Auth(); |
|||
|
|||
$header = [ |
|||
"CHI_Authorization :" . $validation, |
|||
"GroupId:TEST" |
|||
]; |
|||
$ch = curl_init(); |
|||
curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL |
|||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
|||
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); |
|||
curl_setopt($ch, CURLOPT_POST, 1); // 使用 POST |
|||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE)); |
|||
$response = curl_exec($ch); |
|||
|
|||
if ($response === false) { |
|||
echo 'Curl error: ' . curl_error($ch); |
|||
} else { |
|||
$result = json_decode($response, true); |
|||
// 若 API 傳入失敗。 |
|||
if ($result['Status'] == 'Erroe') { |
|||
echo 'API傳入失敗,' . $result['ErrorMsg']; |
|||
return $result; |
|||
} else { |
|||
// print_r($result); |
|||
return $result; |
|||
} |
|||
return $result; |
|||
} |
|||
|
|||
curl_close($ch); |
|||
} |
@ -1,40 +1,43 @@ |
|||
{ |
|||
"apply_key": "MB24010007", |
|||
"register_code": "036B017432", |
|||
[ |
|||
{ |
|||
"apply_key": "11111111", |
|||
"register_code": "B32510261185", |
|||
"elevator_brand": "1", |
|||
"elevator_kind": "A", |
|||
"spec": "MAE100", |
|||
"weight": 550, |
|||
"speed": 60, |
|||
"stop": 12, |
|||
"floors": 12, |
|||
"persons": 8, |
|||
"elevator_num": 0, |
|||
"useful_years": 83, |
|||
"last_check_date": 1121109, |
|||
"speed_governors_check_expense": 0, |
|||
"maintain_times": 1, |
|||
"elevator_kind": "E", |
|||
"spec": "MAH100", |
|||
"weight": "450", |
|||
"speed": "45.00", |
|||
"stop": "3", |
|||
"floors": "3", |
|||
"persons": "6", |
|||
"elevator_num": "0", |
|||
"useful_years": "106", |
|||
"last_check_date": "1", |
|||
"speed_governors_check_expense": "0", |
|||
"maintain_times": "1", |
|||
"is_m1_bundle": "N", |
|||
"maintainance": "A", |
|||
"maintain_months": 12, |
|||
"maintain_period": 1, |
|||
"stand_price": 3140, |
|||
"contract_price": 1666.67, |
|||
"sold_price": 1667, |
|||
"maintainance": "B", |
|||
"maintain_months": "12", |
|||
"maintain_period": "1", |
|||
"stand_price": "1250.00", |
|||
"contract_price": "1250.00", |
|||
"sold_price": 1250, |
|||
"commission_expense": null, |
|||
"management_expense": null, |
|||
"annual_survey_expense": 0, |
|||
"service_expense": 8, |
|||
"annual_survey_expense": "0.00", |
|||
"service_expense": 0, |
|||
"cmstatus": "Y", |
|||
"updated_at": null, |
|||
"creater": null, |
|||
"created_at": "2024-01-10 11:16:26", |
|||
"discount": 53, |
|||
"opendoor": "2S", |
|||
"created_at": "2024-02-26 15:24:23", |
|||
"discount": 100, |
|||
"latitude": "112", |
|||
"longitude": "11", |
|||
"takecertificatedate": "112", |
|||
"opendoor": "2PCO", |
|||
"useful_date": "113-01-01", |
|||
"bonus_verson": "2.0", |
|||
"manager": "M0137" |
|||
} |
|||
"manager": "M0029", |
|||
"regular_contract_manger_id": "M0054" |
|||
} |
|||
] |
@ -1,17 +0,0 @@ |
|||
<?php |
|||
include_once("../conn.php"); |
|||
$sql = "SELECT * FROM salIncomeApplyDetail WHERE BillNo ='B24010032'"; |
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
$result = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
|
|||
|
|||
$aaa = intval($result['OAmountWithTax']) - 24; |
|||
$sql = "UPDATE salIncomeApplyDetail SET OAmountWithTax = $aaa WHERE BillNo = 'B24010032' AND RowCode = '1'"; |
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
|
|||
|
|||
echo "<pre>"; |
|||
print_r($result['OAmountWithTax']); |
|||
echo "</pre>"; |
@ -0,0 +1,10 @@ |
|||
<?php |
|||
include_once("../conn.php"); |
|||
$sql = "SELECT * FROM pricereview_pay WHERE mid = '441'"; |
|||
$stmt = $conn->prepare($sql); |
|||
$stmt->execute(); |
|||
$pay_kind = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
|
|||
echo "<pre>"; |
|||
print_r($pay_kind); |
|||
echo "</pre>"; |
@ -0,0 +1,66 @@ |
|||
<?php |
|||
include "header.php"; |
|||
include_once "./contract/conn.php"; |
|||
|
|||
if (isset($_POST['update'])) { |
|||
function user_input($data) |
|||
{ |
|||
$data1 = trim($data); |
|||
$data2 = stripslashes($data1); |
|||
$data3 = htmlspecialchars($data2); |
|||
return $data3; |
|||
} |
|||
|
|||
$id = $_POST['id']; |
|||
$sql = "SELECT * FROM schedule WHERE id = '$id'"; |
|||
$stmt = $conn->prepare($sql); |
|||
$stmt->execute(); |
|||
$checkRepaireIsit = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
if (!empty($checkRepaireIsit)) { |
|||
echo "<script type ='text/JavaScript'>"; |
|||
echo "alert('此單號已經有保養人員');"; |
|||
echo "location.href='schedule-index.php?function_name=schedule&" . $token_link . "';"; |
|||
echo "</script>"; |
|||
} |
|||
|
|||
|
|||
$contractno = user_input($_POST["contractno"]); |
|||
$facilityno = user_input($_POST["facilityno"]); |
|||
$repairerid = user_input($_POST["repairerid"]); |
|||
|
|||
|
|||
$creater = user_input($_POST["creater"]); |
|||
$create_at = date('Y/m/d H:i:s'); |
|||
|
|||
$sql = "SELECT name FROM account WHERE accountid = '$repairerid'"; |
|||
$stmt = $conn->prepare($sql); |
|||
$stmt->execute(); |
|||
$account = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
|
|||
$repairername = $account['name']; |
|||
|
|||
|
|||
$db_query = "UPDATE schedule set |
|||
repairerid = '$repairerid', |
|||
repairername = '$repairername', |
|||
updater = '$creater', |
|||
update_at = '$create_at' WHERE contractno='$contractno' AND facilityno='$facilityno'"; |
|||
|
|||
$stmt = $conn->prepare($db_query); |
|||
$stmt->execute(); |
|||
$affected = $stmt->rowCount(); |
|||
|
|||
if ($affected > 0) { |
|||
echo "<script type ='text/JavaScript'>"; |
|||
echo "alert('update成功');"; |
|||
echo "location.href='schedule-index.php?function_name=schedule&" . $token_link . "';"; |
|||
echo "</script>"; |
|||
} elseif ($affected == 0) { |
|||
echo "<script type ='text/JavaScript'>"; |
|||
echo "alert('無新增資料');"; |
|||
echo "location.href='schedule-index.php?function_name=schedule&" . $token_link . "';"; |
|||
echo "</script>"; |
|||
} else { |
|||
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: "; |
|||
} |
|||
} |
@ -0,0 +1,192 @@ |
|||
<?php |
|||
include "header.php"; |
|||
include_once "./contract/conn.php"; |
|||
|
|||
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.'); |
|||
|
|||
$data = array(); |
|||
// sql語法存在變數中 |
|||
$db_query = "SELECT * FROM schedule WHERE id=$id"; |
|||
|
|||
// 用mysqli_query方法執行(sql語法)將結果存在變數中 |
|||
$data = mysqli_query($link, $db_query); |
|||
|
|||
|
|||
$sql = "SELECT * FROM account WHERE accounttype = 'B' "; |
|||
$stmt = $conn->prepare($sql); |
|||
$stmt->execute(); |
|||
$repaire = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
|
|||
/* |
|||
|
|||
include "inc/record_update.php"; |
|||
|
|||
try { |
|||
// 設置一個空陣列來放資料 |
|||
$data = array(); |
|||
// sql語法存在變數中 |
|||
$db_query = "SELECT * FROM expert WHERE id=$id"; |
|||
|
|||
// 用mysqli_query方法執行(sql語法)將結果存在變數中 |
|||
$data = mysqli_query($link,$db_query); |
|||
}catch (Exception $e) { |
|||
echo 'Caught exception: ', $e->getMessage(), "\n"; |
|||
} |
|||
*/ |
|||
foreach ($data as $data) : |
|||
?> |
|||
|
|||
<div class="container"> |
|||
<form class="form-inline" method="post" action="schedule-setting-repaire-update.php" enctype="multipart/form-data"> |
|||
<input type="hidden" name="id" value="<?php echo $id; ?>"> |
|||
|
|||
<div> |
|||
<label for="contractno">合約號</label> |
|||
<input type="text" name="contractno" id="contractno" value="<?php echo $data['contractno']; ?>" disabled> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="facilityno">作番號</label> |
|||
<input type="text" name="facilityno" id="facilityno" value="<?php echo $data['facilityno']; ?>" disabled> |
|||
</div> |
|||
<!-- |
|||
<div> |
|||
<label for="combono">保養套餐編號</label> |
|||
<input type="text" name="combono" id="combono" value="<?php echo $data['combono']; ?>"> |
|||
</div> --> |
|||
|
|||
<div> |
|||
<label for="repairerid">保養人員工號</label> |
|||
<select name="repairerid" id="repairerid"> |
|||
<option value=""></option> |
|||
<?php |
|||
foreach ($repaire as $repaire) { |
|||
?> |
|||
<option value="<?= $repaire['accountid'] ?>"><?php echo $repaire['accountid'] . '---' . $repaire['name'] ?></option> |
|||
<?php |
|||
} |
|||
?> |
|||
</select> |
|||
</div> |
|||
<!-- |
|||
<div> |
|||
<label for="repairername">保養人員姓名</label> |
|||
<input type="text" name="repairername" id="repairername" value="<?php echo $data['repairername']; ?>"> |
|||
</div> --> |
|||
<!-- |
|||
<div> |
|||
<label for="duedate">應保養日期</label> |
|||
<input type="text" name="duedate" id="duedate" value="<?php echo $data['duedate']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="actualdate">實際保養日期</label> |
|||
<input type="text" name="actualdate" id="actualdate" data-date-format="yyyy-mm-dd" value="<?php echo $data['actualdate']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="item">保養項目編號</label> |
|||
<input type="text" name="item" id="item" value="<?php echo $data['item']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="item_detail">保養項目內容</label> |
|||
<input type="text" name="item_detail" id="item_detail" value="<?php echo $data['item_detail']; ?>"> |
|||
</div> --> |
|||
|
|||
<!-- <div> |
|||
<label for="result">保養結果</label> |
|||
<input type="text" name="result" id="result" value="<?php echo $data['result']; ?>"> |
|||
</div> --> |
|||
|
|||
<!-- |
|||
<div> |
|||
<label for="evidences">上傳照片</label> |
|||
<input type="text" name="evidences" id="evidences" > |
|||
</div> |
|||
--> |
|||
|
|||
<!-- <div> |
|||
<label for="descriptons">說明</label> |
|||
<input type="text" name="descriptons" id="descriptons" value="<?php echo $data['descriptons']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="customer_login_id">客戶評價登入帳號</label> |
|||
<input type="text" name="customer_login_id" id="customer_login_id" value="<?php echo $data['customer_login_id']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="customer_login_name">客戶姓名</label> |
|||
<input type="text" name="customer_login_name" id="customer_login_name" value="<?php echo $data['customer_login_name']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="stars">保養品質/評價等級(1-5星)</label> |
|||
<input type="text" name="stars" id="stars" onkeyup="if(value<0)value=0;if(value>5)value=5;value=value.replace(/^\D*(\d*(?:\.\d)?).*$/g, '$1')" value="<?php echo $data['stars_c1']; ?>"> |
|||
</div> |
|||
<div> |
|||
<label for="stars2">服務態度/評價等級(1-5星)</label> |
|||
<input type="text" name="stars2" id="stars2" onkeyup="if(value<0)value=0;if(value>5)value=5;value=value.replace(/^\D*(\d*(?:\.\d)?).*$/g, '$1')" value="<?php echo $data['stars_c2']; ?>"> |
|||
</div> |
|||
|
|||
<div> |
|||
<label for="details">內容</label> |
|||
<input type="text" name="details" id="details" value="<?php echo $data['details']; ?>"> |
|||
</div> --> |
|||
<!-- |
|||
<div> |
|||
<label for="customer_signature">簽名檔</label> |
|||
<input type="text" name="customer_signature" id="customer_signature" value="<?php echo $data['customer_signature']; ?>"> |
|||
</div> |
|||
--> |
|||
<div> |
|||
<label for="creater">建檔人</label> |
|||
<input type="text" name="creater" id="creater" value="<?php echo $data['creater']; ?>" readonly> |
|||
</div> |
|||
|
|||
|
|||
<div> |
|||
<br> |
|||
<button type="submit" name="update">確認</button> |
|||
<!-- <button onclick="updateRepaire(<?= $data['contractno'] ?>,<?= $data['facilityno'] ?>,<?= $user_id ?>)" style="text-align: right;">更新此作番保養人員</button> --> |
|||
</div> |
|||
<input type="hidden" name="token" value="<?php echo $token; ?>"> |
|||
<input type="hidden" name="reqaire" id="reqaire" value=""> |
|||
|
|||
</form> |
|||
</div> |
|||
|
|||
<?php |
|||
|
|||
endforeach; |
|||
|
|||
include "footer.php"; |
|||
// include_once "./bonus/api/postSchedule.php" |
|||
?> |
|||
<script src="./contract-repair/js/axios/axios.min.js"></script> |
|||
|
|||
<script> |
|||
document.getElementById('repairerid').onchange = function() { |
|||
var repaireridValue = this.value; |
|||
// 根據選擇的值做相應的處理 |
|||
document.getElementById('reqaire').value = repaireridValue; |
|||
console.log(repaireridValue); |
|||
}; |
|||
// function updateRepaire(contractno, facilityno, user_id) { |
|||
|
|||
|
|||
// const form = new FormData(); |
|||
// form.append("contractno", contractno); |
|||
// form.append("facilityno", facilityno); |
|||
// form.append("user_id", user_id) |
|||
// axios.post('./bonus/api/postSchedule.php', form).then((res) => { |
|||
// if (res.data == 'Success') { |
|||
// alert('更新成功'); |
|||
// location.reload(); |
|||
// } |
|||
// }).catch((err) => { |
|||
|
|||
// }) |
|||
// } |
|||
</script> |
Loading…
Reference in new issue