24 changed files with 5776 additions and 4224 deletions
@ -0,0 +1,42 @@ |
|||
<?php |
|||
$envFile = __DIR__ . '/.env'; // .env 文件的路径 |
|||
|
|||
if (file_exists($envFile)) { |
|||
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|||
if ($lines !== false) { |
|||
foreach ($lines as $line) { |
|||
list($key, $value) = explode('=', $line, 2); |
|||
$key = trim($key); |
|||
$value = trim($value); |
|||
// 设置环境变量 |
|||
putenv("$key=$value"); |
|||
} |
|||
} |
|||
} |
|||
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱 |
|||
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號 |
|||
$db_password = getenv('DB_PASSWORD'); //登入密碼 |
|||
$db_name = getenv('DB_DATABASE'); //使用的資料庫 |
|||
$db_charset = 'utf8'; //設定字元編碼 |
|||
|
|||
//建立PDO的指定工作 |
|||
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset"; |
|||
|
|||
try { |
|||
//使用PDO連接到MySQL資料庫,建立PDO物件 |
|||
$conn = new PDO($dsn, $db_username, $db_password); |
|||
|
|||
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException) |
|||
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定 |
|||
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊 |
|||
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯 |
|||
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。 |
|||
//設定主動以警告的形式報錯 |
|||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
|||
//如果連接錯誤,將抛出一個PDOException異常對象 |
|||
} catch (PDOException $e) { |
|||
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 |
|||
die("ERROR!!!: " . $e->getMessage()); |
|||
} |
|||
|
|||
//$conn = null; //關閉資料庫的連線 |
@ -0,0 +1,567 @@ |
|||
<?php |
|||
include "../header.php"; |
|||
require_once('./conn.php'); |
|||
//買賣1、2、3,安裝5、6 (4跟7很少有) |
|||
if (!empty($_GET['apply_key'])) { |
|||
try { |
|||
$apply_key = $_GET['apply_key']; |
|||
// $sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid |
|||
// FROM pricereview_main |
|||
// JOIN pricereview_pay ON pricereview_main.id = pricereview_pay.mid |
|||
// JOIN pricereview_item ON pricereview_main.id = pricereview_item.mid |
|||
// JOIN account ON pricereview_main.person = account.accountid |
|||
// WHERE pricereview_main.id = :id AND pricereview_item.item_group = 'A' ORDER BY pay_kind ASC"; |
|||
|
|||
// 價審資料 |
|||
$sql = "SELECT * FROM con_maintance_examine_apply AS a LEFT JOIN hope_contract_customer AS b ON a.vol_no = b.vol_no WHERE a.apply_key = :apply_key"; |
|||
$stmt = $conn->prepare($sql); |
|||
$stmt->bindParam(':apply_key', $apply_key); |
|||
$stmt->execute(); |
|||
$contract_maintance = $stmt->fetchALL(PDO::FETCH_ASSOC); |
|||
echo '<pre>'; |
|||
print_r($contract_maintance); |
|||
echo '</pre>'; |
|||
// echo $contract_maintance; |
|||
// $stmt = $conn->prepare($sql_str); |
|||
// $stmt->bindParam(':id',$id); |
|||
// $stmt->execute(); |
|||
// $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
|
|||
|
|||
// $sql_str = "SELECT contract_new_apply.*, |
|||
// contract_new_apply_pays.pay_kind, contract_new_apply_pays.pay_scale, contract_new_apply_pays.pay_amount, contract_new_apply_pays.pay_period, contract_new_apply_pays.condition_date |
|||
// FROM contract_new_apply |
|||
// JOIN contract_new_apply_pays ON contract_new_apply.id = contract_new_apply_pays.contract_apply_id |
|||
// WHERE contract_new_apply.mid = :id"; |
|||
// $stmt = $conn->prepare($sql_str); |
|||
// $stmt->bindParam(':id', $id); |
|||
// $stmt->execute(); |
|||
// $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
// $contract = $contracts[0]; |
|||
// $contract_apply_id = $contract['id']; |
|||
// if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174' || $user_id != 'M0225') { |
|||
// echo '<script type="text/javascript"> |
|||
// alert("非法訪問。"); |
|||
// window.history.back(); |
|||
// </script>'; |
|||
// exit; |
|||
// } |
|||
|
|||
// 抓有望客戶的資料 |
|||
$sql_str = "SELECT * FROM hope_contract_customer WHERE vol_no = :vol_no"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':vol_no', $contract_maintance['vol_no']); |
|||
$stmt->execute(); |
|||
$customer = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
// if (count($customer) <= 0) { |
|||
// echo "<script> |
|||
// alert('資料不齊或合約書已生成過。'); |
|||
// window.history.back(); |
|||
// </script>"; |
|||
// exit; |
|||
// } |
|||
|
|||
$buyArr = []; |
|||
$buyNo2Pay = false; |
|||
$buy_total_price = 0; |
|||
$installArr = []; |
|||
$install_total_price = 0; |
|||
// $noteArr = explode(",", $contracts[0]['note']); |
|||
$noteArr = array(1, 1, 1, 1, 1); |
|||
$qty = $contract_maintance[0]['num']; |
|||
// echo $qty; |
|||
// foreach ($contract_maintance as $idx => $amount) { |
|||
// $isset = false; |
|||
// if ($amount['payment_kind'] == 5 || $amount['payment_kind'] == 6) { |
|||
// if ($amount['pay_scale'] >= 0) { |
|||
// $install_total_price = $install_total_price + $amount['pay_amount']; |
|||
// $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; |
|||
// } |
|||
// } |
|||
// if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) { |
|||
// if ($amount['pay_scale'] > 0) { |
|||
// $buy_total_price = $buy_total_price + $amount['pay_amount']; |
|||
// foreach ($buyArr as $buy) { |
|||
// if ($buy['installment'] == $amount['pay_kind']) { |
|||
// $isset = true; |
|||
// } |
|||
// } |
|||
// if (!$isset) { { |
|||
// $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; |
|||
// } |
|||
// if ($amount['pay_kind'] == 2) { |
|||
// $buyNo2Pay = true; |
|||
// } |
|||
// } |
|||
// } |
|||
// } |
|||
// } |
|||
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; |
|||
$sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $id); |
|||
$stmt->execute(); |
|||
$files = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$files_count = count($files); |
|||
} catch (PDOException $e) { |
|||
die("ERROR!!!: " . $e->getMessage()); |
|||
} |
|||
} |
|||
?> |
|||
<link rel="stylesheet" href="./styles/style.css"> |
|||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> |
|||
<main x-data="contractDownload"> |
|||
<div class="sidebar"> |
|||
<ul> |
|||
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button> |
|||
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button> |
|||
<a href="..wms/cont/sign_list.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a> |
|||
</ul> |
|||
</div> |
|||
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng"> |
|||
<!-- <label for=""> |
|||
<p>交貨期限(日)</p> |
|||
<input type="number" x-model="buyfill1" @keyup="sendBuyInputKeyupFn($event)" /> |
|||
</label> --> |
|||
<?php if ($buyNo2Pay) { ?> |
|||
<!-- <label for=""> |
|||
<p>第二期款交貨期限(日)</p> |
|||
<input type="number" x-model="buyfill2"> |
|||
</label> --> |
|||
<?php } ?> |
|||
<!-- <label for=""> |
|||
<p>附件數</p> |
|||
<select x-model="buyAffix"> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
</select> |
|||
</label> --> |
|||
<label for=""> |
|||
<button @click="sendBuyInputFn()">生成買賣合約書</button> |
|||
</label> |
|||
</div> |
|||
<div class="contract-material-component" x-show="isbuyShow && !isBuyInputIng"> |
|||
<div class="btn-list"> |
|||
<label for="standardBuyBtn"> |
|||
<p>制式合約</p> |
|||
<input type="checkbox" class="scorll" x-model="toggleBuyStandard"> |
|||
<!-- <input type="radio" checked id="standardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = true" /> --> |
|||
</label> |
|||
<!-- <label for="noStandardBuyBtn"> |
|||
<input type="radio" id="noStandardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = false" /> |
|||
非制式合約 |
|||
</label> --> |
|||
</div> |
|||
<button @click="isBuyInputIng = true" class="rebtn">重新輸入</button> |
|||
<button @click="exportFn(1)" class="prviewbtn">預覽</button> |
|||
<div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard"> |
|||
<table class="my-2 contract" x-ref="contract1" id="contract1"> |
|||
<tr> |
|||
<td class="center"> |
|||
<h2 style="text-align:center">電梯買賣合約書</h2> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="1"> |
|||
立契約人 甲方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article> |
|||
</td> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
乙方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>立合約書人</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p>永佳捷科技股份有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr :class="buyonstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate', false)" x-on:mouseout="mouseout('illustrate')"> |
|||
<td> |
|||
<span x-html='buydata.illustrate.plaintext'></span> |
|||
<div class="buttons" x-show="buyonstandardViewData.illustrate.editshow" x-cloak> |
|||
<button class="edit" @click="modelshowEditFn('更新合約書內容', 'illustrate', false, false)"><i class="glyphicon glyphicon-pencil"></i></button> |
|||
<button class="delete"><i class="glyphicon glyphicon-trash"></i></button> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
<template x-for="(item, idx) in buyonstandardViewData.list.plaintext" :key="item.id"> |
|||
<tr :class="buyonstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx, false)" @mouseout="mouseoutlist(idx)"> |
|||
<td class="list"> |
|||
<div class="buttons" x-show="buyonstandardViewData.list.plaintext[idx].editshow" x-cloak> |
|||
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, false)"><i class="glyphicon glyphicon-pencil"></i></button> |
|||
<button class="add" @click="modelshowAddUpFn(idx, false)"><i class="glyphicon glyphicon-arrow-up"></i></button> |
|||
<button class="add" @click="modelshowAddDownFn(idx, false)"><i class="glyphicon glyphicon-arrow-down"></i></button> |
|||
<button class="delete" @click="deleteEditor(idx, false)"><i class="glyphicon glyphicon-trash"></i></button> |
|||
</div> |
|||
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span> |
|||
<article x-html="buyonstandardViewData.list.plaintext[idx].text"></article> |
|||
</td> |
|||
</tr> |
|||
</template> |
|||
</table> |
|||
</div> |
|||
<div class="contract" id="standardBuyContract" x-show="toggleBuyStandard"> |
|||
<table class="my-2 contract" id="contract0"> |
|||
<tr> |
|||
<td class="center"> |
|||
<h2 style="text-align:center">電梯買賣合約書</h2> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="1"> |
|||
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p x-html="data.partyA.plaintext"> </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>立合約書人</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p>永佳捷科技股份有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr :class="buystandardData.illustrate.editshow ? 'mouseover' : '' "> |
|||
<td> |
|||
<span x-html='buystandardData.illustrate.plaintext'></span> |
|||
</td> |
|||
</tr> |
|||
<template x-for="(item, idx) in buystandardData.list.plaintext" :key="item.id"> |
|||
<tr :class="buystandardData.list.plaintext[idx].editshow ? 'mouseover' : '' "> |
|||
<td class="list"> |
|||
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span> |
|||
<article x-html="buystandardData.list.plaintext[idx].text"></article> |
|||
</td> |
|||
</tr> |
|||
</template> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="contract-model" x-show="modelshow" x-cloak> |
|||
<div class="contract-back"></div> |
|||
<div class="contract-content"> |
|||
<div class="model-header"><span x-text='modelText'></span><i @click='modelcloseFn()' class="glyphicon glyphicon-remove"></i></div> |
|||
<div class="content"> |
|||
<textarea name="content" id="editor" x-ref="editor"></textarea> |
|||
<input type="submit" value="update" @click='updateEditor()' /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="inputDiv" x-show="!isbuyShow && isInstallInputIng"> |
|||
<!-- <label for=""> |
|||
<p>安裝試車期限(日)</p> |
|||
<input type="number" x-model="installfill1" @keyup="sendInstallInputKeyupFn($event)" /> |
|||
</label> |
|||
<label for=""> |
|||
<p>免費保養月數(月)</p> |
|||
<input type="number" x-model="installfill2" @keyup="sendInstallInputKeyupFn($event)" /> |
|||
</label> --> |
|||
<!-- <label for=""> |
|||
<p>附件數</p> |
|||
<select x-model="installAffix" @keyup="sendInstallInputKeyupFn($event)"> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
</select> |
|||
</label> --> |
|||
<label for=""> |
|||
<button @click="sendInstallInputFn()">生成安裝合約書</button> |
|||
</label> |
|||
</div> |
|||
<div class="contract-install-component" x-show="!isbuyShow && !isInstallInputIng" x-cloak> |
|||
|
|||
<div class="btn-list"> |
|||
<label for="standardBtn"> |
|||
<p>制式合約</p> |
|||
<input type="checkbox" class="scorll" x-model="toggleBuyStandard"> |
|||
<!-- <input type="radio" checked id="standardBtn" name="standardBtn" @change="toggleInstallStandard = true" /> --> |
|||
</label> |
|||
<!-- <label for="noStandardBtn"> |
|||
<input type="radio" id="noStandardBtn" name="standardBtn" @change="toggleInstallStandard = false" /> |
|||
非制式合約 |
|||
</label> --> |
|||
</div> |
|||
<button @click="isInstallInputIng = true" class="rebtn">重新輸入</button> |
|||
<button @click="exportFn(2)" class="prviewbtn">預覽</button> |
|||
|
|||
|
|||
<div class="contract" id="noStandardContract" x-show="!toggleInstallStandard"> |
|||
<table class="my-2 contract" x-ref="contract1" id="contract1"> |
|||
<tr> |
|||
<td class="center"> |
|||
<h2 style="text-align:center">電梯安裝合約書</h2> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="1"> |
|||
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>立合約書人</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p>永佳捷科技股份有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr :class="onstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate')" x-on:mouseout="mouseout('illustrate')"> |
|||
<td> |
|||
<span x-html='onstandardViewData.illustrate.plaintext'></span> |
|||
<div class="buttons" x-show="onstandardViewData.illustrate.editshow" x-cloak> |
|||
<button class="edit" @click="modelshowEditFn('更新合約書內容', 'illustrate', false, true)"><i class="glyphicon glyphicon-pencil"></i></button> |
|||
<button class="delete"><i class="glyphicon glyphicon-trash"></i></button> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
<template x-for="(item, idx) in onstandardViewData.list.plaintext" :key="item.text"> |
|||
<tr :class="onstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx)" @mouseout="mouseoutlist(idx)"> |
|||
<td class="list"> |
|||
<div class="buttons" x-show="onstandardViewData.list.plaintext[idx].editshow" x-cloak> |
|||
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, true)"><i class="glyphicon glyphicon-pencil"></i></button> |
|||
<button class="add" @click="modelshowAddUpFn(idx)"><i class="glyphicon glyphicon-arrow-up"></i></button> |
|||
<button class="add" @click="modelshowAddDownFn(idx)"><i class="glyphicon glyphicon-arrow-down"></i></button> |
|||
<button class="delete" @click="deleteEditor(idx)"><i class="glyphicon glyphicon-trash"></i></button> |
|||
</div> |
|||
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span> |
|||
<article x-html="onstandardViewData.list.plaintext[idx].text"></article> |
|||
</td> |
|||
</tr> |
|||
</template> |
|||
</table> |
|||
</div> |
|||
|
|||
<div class="contract" id="standardContract" x-show="toggleInstallStandard"> |
|||
<table class="my-2 contract" id="contract0"> |
|||
<tr> |
|||
<td class="center"> |
|||
<h2 style="text-align:center">電梯安裝合約書</h2> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="1"> |
|||
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p x-html="data.partyA.plaintext">一二營造有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>立合約書人</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div style="margin-left: 100px"> |
|||
<p>永佳捷科技股份有限公司 </p> |
|||
</div> |
|||
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div> |
|||
</td> |
|||
</tr> |
|||
<tr :class="standardData.illustrate.editshow ? 'mouseover' : '' "> |
|||
<td> |
|||
<span x-html='standardData.illustrate.plaintext'></span> |
|||
</td> |
|||
</tr> |
|||
<template x-for="(item, idx) in standardData.list.plaintext"> |
|||
<tr :class="standardData.list.plaintext[idx].editshow ? 'mouseover' : '' "> |
|||
<td class="list"> |
|||
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span> |
|||
<article x-html="standardData.list.plaintext[idx].text"></article> |
|||
</td> |
|||
</tr> |
|||
</template> |
|||
</table> |
|||
</div> |
|||
|
|||
<form action="prviewPdf.php?id=<?php echo $id; ?>&<?php echo $token_link; ?>" id="form" method="post" x-ref="form" style="display:none"> |
|||
<input type="hidden" name="contract_apply_id" id="contract_apply_id" value="<?php echo $contract_apply_id; ?>" /> |
|||
<input type="hidden" name="list" id="prview-list" /> |
|||
<input type="hidden" name="prviewType" id="prview-type" /> |
|||
<input type="hidden" name="standardList" id="standard-prview-list" /> |
|||
<input type="hidden" name="illustrate" id="illustrate" /> |
|||
<input type="hidden" name="standardIllustrate" id="standard-illustrate" /> |
|||
<input type="hidden" name="partyA" id="partyA" /> |
|||
<input type="hidden" name="partyAcontractno" id="partyAcontractno" /> |
|||
<input type="hidden" name="buystandard" x-model="toggleBuyStandard" /> |
|||
<input type="hidden" name="installstandard" x-model="toggleInstallStandard" /> |
|||
<input type="hidden" name="total_price" x-model="total_price" id="total_price" /> |
|||
<input type="hidden" name="person" id="person" value="<?php echo $contract['accountname']; ?>" /> |
|||
<input type="hidden" name="personid" id="personid" value="<?php echo $contract['accountid']; ?>" /> |
|||
<input type="hidden" name="delivery_term" id="delivery_term" x-model="buyfill1" /> |
|||
<input type="hidden" name="install_period" id="install_period" x-model="installfill1" /> |
|||
<input type="hidden" name="free_maintainance" id="free_maintainance" x-model="installfill2" /> |
|||
</form> |
|||
|
|||
</div> |
|||
</main> |
|||
<!-- <script src="../ckeditor4/ckeditor.js"></script> --> |
|||
<script> |
|||
const partyAcompany = <?php echo json_encode($contract_maintance['customer']); ?>; |
|||
const partyAcontractno = <?php echo json_encode($contract_maintance['apply_key']); ?>; |
|||
const partyAaddress = <?php echo json_encode($contcontract_maintanceract['address']); ?>; |
|||
const totalPrice = 0; |
|||
const totalInstallPrice = <?php echo $install_total_price; ?>; |
|||
const totalBuyPrice = <?php echo $buy_total_price; ?>; |
|||
// const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>; |
|||
// const buyfill1 = <?php echo $contract['tradedeadline']; ?>; |
|||
// const installfill1 = "<?php echo $contract_maintance['test_time']; ?>"; |
|||
// const installfill2 = "<?php echo $contract_maintance['freedeadline']; ?>"; |
|||
// const buyArr = [...<?php echo json_encode($buyArr); ?>]; |
|||
// const installArr = [...<?php echo json_encode($installArr); ?>]; |
|||
let install_pay_text = '付款方式:<br> '; |
|||
let buy_pay_text = '' |
|||
const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七'] |
|||
const bigChineseArr = ['零', '壹', '貳', '參', '肆', '伍', '陸', '柒', '捌', '玖', '拾']; |
|||
const num = <?php echo $qty; ?>; |
|||
const people = <?php echo $noteArr[1]; ?>; |
|||
const floor = <?php echo $noteArr[2]; ?>; |
|||
const speed = <?php echo $noteArr[3]; ?>; |
|||
const buyAffix = ' <?php echo $files_count; ?>'; |
|||
// console.log(buyAffix); |
|||
// console.log(installArr); |
|||
buyArr.forEach((item, idx) => { |
|||
if (item.scale > 0) { |
|||
if (item.installment == 1) { |
|||
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽定時,甲方應付合約定金新台幣 ${numberToChinese(item.amount)} 元整( ${numberWithCommas(item.amount)} )(含5%加值型營業稅)(${item.pay_period}天期票)。<br>` |
|||
} else if (item.installment == 2) { |
|||
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽訂後 ____ 天付第二期款新台幣 ${numberToChinese(item.amount)} 元整( ${numberWithCommas(item.amount)} )(含5%加值型營業稅)(${item.pay_period}天期票)。<br>` |
|||
} else if (item.installment == 3) { |
|||
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:產品貨到工地時應付新台幣 ${numberToChinese(item.amount)} 元整( ${numberWithCommas(item.amount)} )( 含5%加值型營業稅)(${item.pay_period}天期票)。<br>` |
|||
} |
|||
} |
|||
});; |
|||
buy_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br>乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。' |
|||
buy_pay_text = buy_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim(); |
|||
installArr.forEach((item, idx) => { |
|||
if (item.scale > 0) { |
|||
if (item.installment == 5) { |
|||
install_pay_text = `${install_pay_text}第${chineseArr[idx+1]}期款:甲方應於安裝及試車完成後給付安裝費用 ${numberToChinese(item.amount)} 元整( ${numberWithCommas(item.amount)} )(含5%加值型營業稅)(${item.pay_period}天期票)。<br>` |
|||
} else if (item.installment == 6) { |
|||
install_pay_text = `${install_pay_text}第二期款:甲方應於交車後給付 ${numberToChinese(item.amount)} 元整( ${numberWithCommas(item.amount)} )(含5%加值型營業稅)(${item.pay_period}天期票)。<br>` |
|||
} |
|||
} |
|||
}) |
|||
install_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br> 乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。' |
|||
install_pay_text = install_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim(); |
|||
|
|||
function numberWithCommas(x) { |
|||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|||
} |
|||
|
|||
function numberToChinese(n) { |
|||
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return "Invalid number."; |
|||
let unit = "仟佰拾億仟佰拾萬仟佰拾元角分"; |
|||
let str = ""; |
|||
n += "00"; |
|||
let pos = n.indexOf('.'); |
|||
if (pos >= 0) { |
|||
n = n.substring(0, pos) + n.substr(pos + 1, 2); |
|||
} |
|||
unit = unit.substr(unit.length - n.length); |
|||
for (let i = 0; i < n.length; i++) { |
|||
str += '零壹貳參肆伍陸柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i); |
|||
} |
|||
str = ('_' + str + '_'); |
|||
return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(萬|億|元)/g, "$1").replace(/(億)萬|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "").replace("元", "").replace(/^\s+|\s+$/g, ''); |
|||
} |
|||
|
|||
function numberToSmallChinese(num) { |
|||
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; |
|||
const chineseUnits = ['', '十', '百', '千']; |
|||
|
|||
const numStr = num.toString(); |
|||
const numLength = numStr.length; |
|||
let chineseStr = ''; |
|||
|
|||
for (let i = 0; i < numLength; i++) { |
|||
const digit = parseInt(numStr.charAt(i)); |
|||
const unitPos = numLength - i - 1; |
|||
|
|||
if (digit !== 0) { |
|||
chineseStr += chineseNumbers[digit] + chineseUnits[unitPos]; |
|||
} else { |
|||
// 处理连续的零,只添加一个零到结果中 |
|||
if (i < numLength - 1 && parseInt(numStr.charAt(i + 1)) !== 0) { |
|||
chineseStr += chineseNumbers[digit]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
return chineseStr; |
|||
} |
|||
</script> |
|||
<script src="./js/alpine.js"></script> |
|||
<script> |
|||
const axiosClient = axios.create({ |
|||
baseURL: './', |
|||
}); |
|||
|
|||
|
|||
axiosClient.interceptors.request.use((config) => { |
|||
config.headers.Authorization = 'Bearer <?php echo $token ?>' |
|||
return config; |
|||
}, (error) => { |
|||
return Promise.reject(error); |
|||
}); |
|||
|
|||
axiosClient.interceptors.response.use((response) => { |
|||
return response; |
|||
}, (error) => { |
|||
if (error.response.status === 401) { |
|||
console.error(error); |
|||
} |
|||
throw error; |
|||
}); |
|||
</script> |
|||
<script> |
|||
</script> |
@ -0,0 +1,662 @@ |
|||
<?php |
|||
include_once("../header.php"); |
|||
require_once("./conn.php"); |
|||
// if (!(isset($_GET['id']) && !empty($_GET['id']))) { |
|||
// $para = "function_name=pricereview&" . $token_link; |
|||
// echo "<script>alert('非法訪問!!!');</script>"; |
|||
// echo "<script>window.history.go(-1);</script>"; |
|||
// exit; |
|||
// } |
|||
$id = $_GET["id"]; |
|||
|
|||
$sql_str = "SELECT contract_new_apply.*, account.name as review_person_name |
|||
FROM contract_new_apply |
|||
LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid |
|||
WHERE contract_new_apply.mid = :mid"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $id); |
|||
$stmt->execute(); |
|||
$contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$contract = $contract_new_apply; |
|||
$isFirst = empty($contract_new_apply) ? 1 : 0; |
|||
if (empty($contract_new_apply)) { |
|||
$sql_str = "SELECT pricereview_main.contractno, pricereview_main.ekind, pricereview_main.person, pricereview_main.company, pricereview_main.case_name, pricereview_main.address, pricereview_main.price_lowest, pricereview_main.price_total, pricereview_main.price_rate, pricereview_main.status as priceview_status, pricereview_main.id as mainid, account.name as accountname |
|||
FROM pricereview_main |
|||
JOIN account ON pricereview_main.person = account.accountid |
|||
WHERE pricereview_main.id = :id"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':id', $id); |
|||
$stmt->execute(); |
|||
$contract = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
// print_r($contract); |
|||
$accounttype = "M"; |
|||
$sql_str = "SELECT * FROM account WHERE accounttype = :accounttype"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':accounttype', $accounttype); |
|||
$stmt->execute(); |
|||
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no ORDER BY created_at DESC"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':vol_no', $contract['contractno']); |
|||
$stmt->execute(); |
|||
$customer = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
|
|||
$mid = $contract['mainid']; |
|||
|
|||
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $mid); |
|||
$stmt->execute(); |
|||
$items = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$total_items = 0; |
|||
foreach ($items as $item) { |
|||
$total_items += $item['item_qty']; |
|||
} |
|||
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $mid); |
|||
$stmt->execute(); |
|||
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$price_a = 0; |
|||
$price_b = 0; |
|||
foreach ($pays as $pay) { |
|||
if ($pay['pay_kind'] <= 4) { |
|||
$price_a = $price_a + $pay['pay_amount']; |
|||
} else { |
|||
$price_b = $price_b + $pay['pay_amount']; |
|||
} |
|||
} |
|||
} else { |
|||
$mid = $contract['mid']; |
|||
$contract_new_apply_id = $contract_new_apply['id']; |
|||
$sql_str = "SELECT * FROM contract_new_apply_pays WHERE mid = :mid ORDER BY pay_kind ASC"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $mid); |
|||
$stmt->execute(); |
|||
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
|
|||
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':mid', $mid); |
|||
$stmt->execute(); |
|||
$items = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$price_a = 0; |
|||
$price_b = 0; |
|||
foreach ($pays as $pay) { |
|||
if ($pay['pay_kind'] <= 4) { |
|||
$price_a = $price_a + $pay['pay_amount']; |
|||
} else { |
|||
$price_b = $price_b + $pay['pay_amount']; |
|||
} |
|||
} |
|||
|
|||
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':contract_id', $id); |
|||
$stmt->execute(); |
|||
$files = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
print_r($files); |
|||
} |
|||
$secondPayDeadline = $contract['secondPayDeadline'] ?? 0; |
|||
$status = isset($contract['status']) ? $contract['status'] : -1; |
|||
$person = $contract['person']; |
|||
|
|||
?> |
|||
<link rel="stylesheet" href="./styles/style.css"> |
|||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> |
|||
<link rel="stylesheet" href="semantic/dist/semantic.min.css"> |
|||
<script defer src="./js/alpinejs/cdn.min.js"></script> |
|||
<script src="./js/axios/axios.min.js"></script> |
|||
<div class="contract-new-apply-component" x-data="contractNewApply"> |
|||
<div class="form" method="post" id="form" enctype="multipart/form-data"> |
|||
<input type="hidden" name='form_name' value="main_form" /> |
|||
<div> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead> |
|||
<tr> |
|||
<td colspan="8"> |
|||
<h3 style='text-align:center'>合約書申請(新梯)</h3> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1"> |
|||
<tr> |
|||
<td colspan="7" style='vertical-align: middle;border-right:0px;'> |
|||
<h4>業務確認項</h4> |
|||
</td> |
|||
<td class="text-right" style='border-left:0px;'> |
|||
<button type="button" id="btn_close" class="btn btn-default" onclick="window.history.back();">返回</button> |
|||
<button type="button" id="btn_close" class="btn btn-default" onclick="window.close();">關閉分頁</button> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">卷號</td> |
|||
<td> |
|||
<div class="fixed" x-text="data.vol_no"></div> |
|||
<!-- <input class="form-control disabled_select" type="text" x-model="data.vol_no" > --> |
|||
<!-- <p class="alerttext" x-show="data.vol_no==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> --> |
|||
</td> |
|||
<td style="vertical-align: middle">統一編號</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="text" x-model="data.vat"> |
|||
<p class="alerttext" x-show="data.vat==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">合約書申請日期</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="date" x-model="data.apply_date"> |
|||
<p class="alerttext" x-show="data.apply_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">申請類別</td> |
|||
<td style="vertical-align: middle"> |
|||
<select class="" id="apply_type" x-model="data.apply_type"> |
|||
<option value="A">制式新合約</option> |
|||
</select> |
|||
<p class="alerttext" x-show="data.apply_type==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">案件名稱</td> |
|||
<td style="vertical-align: middle" colspan="3"> |
|||
<input class="form-control disabled_select" type="text" x-model="data.case_name"> |
|||
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">立約人</td> |
|||
<td style="vertical-align: middle"> |
|||
<input class="form-control disabled_select" type="text" x-model="data.company"> |
|||
<p class="alerttext" x-show="data.company==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">負責人</td> |
|||
<td style="vertical-align: middle"> |
|||
<input class="form-control disabled_select" type="text" x-model="data.manager"> |
|||
<p class="alerttext" x-show="data.manager==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">含稅給約總價</td> |
|||
<td colspan="3" style="vertical-align: middle"> |
|||
<input class="form-control disabled_select lock" type="number" x-model="data.total_price"> |
|||
<p class="alerttext" x-show="data.total_price==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">含稅貸款(A)</td> |
|||
<td style="vertical-align: middle"> |
|||
<input class="form-control disabled_select lock" type="number" x-model="data.price_a"> |
|||
<p class="alerttext" x-show="data.price_a==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">含稅安裝款(A)</td> |
|||
<td style="vertical-align: middle"> |
|||
<input class="form-control disabled_select lock" type="number" x-model="data.price_b"> |
|||
<p class="alerttext" x-show="data.price_b==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">聯絡地址</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<input class="form-control disabled_select" type="text" x-model="data.address"> |
|||
<p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">完工期限</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<div class="ui labeled input"> |
|||
<div class="ui label"> |
|||
貨抵工地 |
|||
</div> |
|||
<input type="text" placeholder="30" style="width:45px;padding:0 12px;" x-model="data.workdeadline_a"> |
|||
<div class="ui label"> |
|||
天內安裝完成,甲方應於貨底工地前 |
|||
</div> |
|||
<input type="text" placeholder="7" style="width:45px;padding:0 12px;" x-model="data.workdeadline_b"> |
|||
<div class="ui label"> |
|||
天完成並整理完善。 |
|||
</div> |
|||
</div> |
|||
<!-- <input class="form-control disabled_select" type="text" x-model="data.deadline" > --> |
|||
<p class="alerttext" x-show="data.deadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">附則</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<div class="ui labeled input"> |
|||
<div class="ui label"> |
|||
乙方應於 |
|||
</div> |
|||
<input type="text" placeholder="10" style="width:45px;padding:0 12px;" x-model="data.regulations"> |
|||
<div class="ui label"> |
|||
天內試車完成 |
|||
</div> |
|||
</div> |
|||
<p class="alerttext" x-show="data.regulations==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">免保期限</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<div class="ui labeled input"> |
|||
<input type="text" placeholder="18" style="width:45px;padding:0 12px;" x-model="data.freedeadline"> |
|||
<div class="ui label"> |
|||
個月 |
|||
</div> |
|||
</div> |
|||
<p class="alerttext" x-show="data.freedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
|
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">交貨地點</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<input class="form-control disabled_select" type="text" x-model="data.tradeaddress"> |
|||
<p class="alerttext" x-show="data.tradeaddress==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">交貨期限</td> |
|||
<td style="vertical-align: middle" colspan=3> |
|||
<div class="ui labeled input"> |
|||
<div class="ui label"> |
|||
圖色確認第 |
|||
</div> |
|||
<input type="text" placeholder="90" style="width:45px;padding:0 12px;" x-model="data.tradedeadline"> |
|||
<div class="ui label"> |
|||
天出貨 |
|||
</div> |
|||
</div> |
|||
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead style="font-weight: bolder;margin-bottom: 20px"> |
|||
<tr> |
|||
<td colspan="1"> |
|||
<p style='text-align:center'>項次</p> |
|||
</td> |
|||
<td colspan="3"> |
|||
<p style='text-align:center'>規格</p> |
|||
</td> |
|||
<td colspan="1"> |
|||
<p style='text-align:center'>數量</p> |
|||
</td> |
|||
<td colspan="3"> |
|||
<p style='text-align:center'>金額</p> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px"> |
|||
<template x-for="(item, idx) in data.items"> |
|||
<tr> |
|||
<td style="vertical-align: middle"> |
|||
<p x-text="idx+1"></p> |
|||
</td> |
|||
<td colspan="3" style="vertical-align: middle"> |
|||
<input class="form-control disabled_select lock" type="text" x-model="item.item_spec"> |
|||
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle"> |
|||
<span x-text="item.item_qty + '台'" style="padding:0 20px"></span> |
|||
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td colspan="3" style="vertical-align: middle"> |
|||
<input class="form-control disabled_select lock" type="number" x-model="item.item_price_ct"> |
|||
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
</template> |
|||
<tr> |
|||
<td colspan=4></td> |
|||
<td>電梯總數</td> |
|||
<td colspan='3'> <span x-text="data.total_items + '台'" style="padding:0 20px"></span></td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
|
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead style="font-weight: bolder;margin-bottom: 20px"> |
|||
<tr> |
|||
<td> |
|||
<p style='text-align:center'>合約類別</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>款別</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>條件名稱</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>收款條件日期區分</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>條件日期</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>票期</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>付款比率</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'>金額</p> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px"> |
|||
<?php |
|||
$day = 0; |
|||
$styles = [ |
|||
1 => "訂金", |
|||
2 => "二次款", |
|||
3 => "貨到款", |
|||
4 => "", |
|||
5 => "安裝款", |
|||
6 => "尾款", |
|||
7 => "", |
|||
]; |
|||
$paydate = [ |
|||
1 => "合約日", |
|||
2 => "合約日", |
|||
3 => "出貨日", |
|||
4 => "", |
|||
5 => "竣檢日", |
|||
6 => "交車日", |
|||
7 => "" |
|||
]; |
|||
?> |
|||
<?php foreach ($pays as $pay) : |
|||
if ($pay['pay_scale'] == 0) continue; |
|||
?> |
|||
<tr> |
|||
<td> |
|||
<p style='text-align:center'><?php echo ($pay['pay_kind'] <= 4) ? "銷售" : "按裝"; ?></p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'><?php echo $styles[$pay['pay_kind']]; ?></p> |
|||
</td> |
|||
<td> |
|||
<?php if ($pay['pay_kind'] == 1) { ?> |
|||
<template x-if="pays[1] > 0"> |
|||
<p style='text-align:center'>簽約後<span x-text="pays[1]"></span>天付訂金</p> |
|||
</template> |
|||
<template x-if="pays[1] <= 0"> |
|||
<p style='text-align:center'>簽約後付訂金</p> |
|||
</template> |
|||
<?php } elseif ($pay['pay_kind'] == 2) { ?> |
|||
<template x-if="pays[2] > 0"> |
|||
<p style='text-align:center'>簽約後<span x-text="pays[2]"></span>天付二次款</p> |
|||
</template> |
|||
<template x-if="pays[2] <= 0"> |
|||
<p style='text-align:center'>簽約後付二次款</p> |
|||
</template> |
|||
<?php } elseif ($pay['pay_kind'] == 3) { ?> |
|||
<p style='text-align:center'>貨抵工地付貨到款</p> |
|||
<?php } elseif ($pay['pay_kind'] == 5) { ?> |
|||
<template x-if="pays[5] > 0"> |
|||
<p style='text-align:center'>安裝完成後<span x-text="pays[5]"></span>天收款</p> |
|||
</template> |
|||
<template x-if="pays[5] <= 0"> |
|||
<p style='text-align:center'>安裝完成後收款</p> |
|||
</template> |
|||
<?php } elseif ($pay['pay_kind'] == 6) { ?> |
|||
<template x-if="pays[6] > 0"> |
|||
<p style='text-align:center'>交車後<span x-text="pays[6]"></span>天付尾款</p> |
|||
</template> |
|||
<template x-if="pays[6] <= 0"> |
|||
<p style='text-align:center'>交車後付尾款</p> |
|||
</template> |
|||
<?php } else { ?> |
|||
<p style='text-align:center'>-</p> |
|||
<?php } ?> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center'><?php echo $paydate[$pay['pay_kind']]; ?></p> |
|||
</td> |
|||
<td> |
|||
<div class="ui labeled input"> |
|||
<input type="number" placeholder="90" style="width:65px;padding:0 12px;" x-model="pays[<?php echo $pay['pay_kind']; ?>].condition_date"> |
|||
<div class="ui label"> |
|||
天 |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="ui labeled input"> |
|||
<input type="number" placeholder="90" style="width:65px;padding:0 12px;" x-model="pays[<?php echo $pay['pay_kind']; ?>].pay_period"> |
|||
<div class="ui label"> |
|||
天 |
|||
</div> |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center' x-text="pays[<?php echo $pay['pay_kind']; ?>].scale + '%'"><?php echo $pay['pay_scale'] ?>%</p> |
|||
</td> |
|||
<td> |
|||
<p style='text-align:center' x-text="localnumber(data.total_price * pays[<?php echo $pay['pay_kind']; ?>].scale/100)"></p> |
|||
</td> |
|||
</tr> |
|||
<?php endforeach; ?> |
|||
</tbody> |
|||
</table> |
|||
<template x-if="pays[2].pay_period > 0"> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px"> |
|||
<tr> |
|||
<td>第二期款交貨期限(日)</td> |
|||
<td> |
|||
<input type="number" class="form-control" x-model="data.secondPayDeadline" /> |
|||
<p class="alerttext" x-show="data.secondPayDeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</template> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead style="font-weight: bolder;margin-bottom: 20px;"> |
|||
<tr> |
|||
<td colspan=8> |
|||
<h4 style='text-align:center;font-weight: bolder'>附件上傳</h4> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
|
|||
<tbody> |
|||
<tr> |
|||
<td colspan="4">附件上傳</td> |
|||
<td colspan="4"> |
|||
<?php if ($status < 1) : ?> |
|||
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" /> |
|||
<?php endif; ?> |
|||
<?php foreach ($files as $file) : ?> |
|||
<a href="./images/contracts_new_files/<?php echo $file['file_name']; ?>" download><?php echo $file['file_name']; ?></a> <?php if ($status < 1) : ?><span style="margin-left:10px;cursor:pointer;color:#f019">X</span><?php endif; ?><br /> |
|||
<?php endforeach; ?> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead style="font-weight: bolder;margin-bottom: 20px;"> |
|||
<tr> |
|||
<td colspan=8> |
|||
<h4 style='text-align:center;font-weight: bolder'>簽核流程</h4> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<td>審核</td> |
|||
<td>審核人</td> |
|||
<td>結果</td> |
|||
<td colspan=2>意見</td> |
|||
<td>時間</td> |
|||
<td colspan=2><?php if ($user_id === "M0174" && $status == 1) : ?>審核意見<?php endif; ?></td> |
|||
</tr> |
|||
<tr> |
|||
<td>營業員</td> |
|||
<td><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td> |
|||
<td> |
|||
<?php if ($status >= 1) : ?><span class="successtext">已送審</span><?php endif; ?> |
|||
<?php if ($status == 0) : ?><span class="readtext">暫存</span><?php endif; ?> |
|||
<?php if ($status == -1) : ?><span class="">未提交</span><?php endif; ?> |
|||
</td> |
|||
<td colspan=2>---</td> |
|||
<td><?php echo ($contract['submit_date']) ?? "---"; ?> </td> |
|||
<td colspan=2 rowspan="2"> |
|||
<?php if ($user_id === "M0174" && $status == 1) : ?> |
|||
<textarea class="form-control opinion" x-model="data.review_comment"></textarea> |
|||
<?php endif; ?> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>業務承辦人</td> |
|||
<td><span><?php echo (isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] . "(" . $contract['review_person_id'] . ")"; ?></span></td> |
|||
<td> |
|||
<?php if ($status == 3) : ?><span class="successtext">結案同意</span><?php endif; ?> |
|||
<?php if ($status == 2) : ?><span class="failtext">結案不同意</span><?php endif; ?> |
|||
<?php if ($status < 2) : ?><span>---</span><?php endif; ?> |
|||
</td> |
|||
<td colspan=2><?php echo $contract['review_comment'] ?? "---"; ?></td> |
|||
<td><?php echo $contract['review_date'] ?? "---"; ?></td> |
|||
</tr> |
|||
<!-- <tr> |
|||
<td colspan="2" style="font-weight:bold">業務部承辦人</td> |
|||
<td colspan="2"> |
|||
<template x-if="false"> |
|||
<span class="failtext">已退件</span> |
|||
</template> |
|||
<?php if ($status == 1) : ?> |
|||
<span class="readtext">審核中...</span> |
|||
<?php endif; ?> |
|||
<template x-if="false"> |
|||
<span class="successtext">已通過</span> |
|||
</template> |
|||
</td> |
|||
<td colspan="2" style="font-weight:bold">營業員</td> |
|||
<td colspan="2"><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td> |
|||
</tr> --> |
|||
</tbody> |
|||
</table> |
|||
<button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn">回前頁</button> |
|||
<?php if (($isFirst == 1 && ($person == $user_id || $user_id == "M0174")) || ($isFirst == 0 && $status == 0 && ($person == $user_id || $user_id == "M0174"))) : ?> |
|||
<button x-show="true" x-on:click="submit()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>送審</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<button x-show="true" x-on:click="storageFn()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>暫存</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<?php endif; ?> |
|||
<?php if ($status == 1 && ($user_id == "M0107" || $user_id == "M0060" || $user_id == "M0174")) : ?> |
|||
<button x-show="true" x-on:click="agree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>同意(結案)</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<button x-show="true" x-on:click="disagree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>不同意(退回)</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<?php endif; ?> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script src="./js/jquery/jquery-3.1.1.min.js"></script> |
|||
<script src="semantic/dist/semantic.min.js"></script> |
|||
<script src="./js/alpine.js"></script> |
|||
<script> |
|||
window.onload = () => { |
|||
const lock = document.getElementsByClassName('lock'); |
|||
for (let i = 0; i < lock.length; i++) { |
|||
lock[i].disabled = true |
|||
} |
|||
} |
|||
</script> |
|||
<?php if (empty($contract_new_apply)) : ?> |
|||
<script> |
|||
const contractno = '<?php echo $contract['contractno'] ?? ''; ?>'; |
|||
const salesman = '<?php echo $contract['person'] ?? ''; ?>'; |
|||
const salesmanname = '<?php echo $contract['accountname'] ?? ''; ?>'; |
|||
const apply_date = '<?php echo date('Y-m-d') ?>'; |
|||
const case_name = '<?php echo $contract['case_name'] ?? ''; ?>'; |
|||
const company = '<?php echo $contract['company'] ?? ''; ?>'; |
|||
const manager = '<?php echo $customer['manager'] ?? ''; ?>'; |
|||
const vat = '<?php echo $customer['uscc'] ?? ''; ?>'; |
|||
const price_total = <?php echo $contract['price_total'] ?? ''; ?>; |
|||
const address = '<?php echo $contract['address'] ?? ''; ?>'; |
|||
const price_a = <?php echo $price_a ?? ''; ?>; |
|||
const price_b = <?php echo $price_b ?? ''; ?>; |
|||
const items = [...<?php echo json_encode($items) ?? []; ?>]; |
|||
const user_id = '<?php echo $user_id ?>'; |
|||
const mid = '<?php echo $_GET['id']; ?>'; |
|||
const pays = [...<?php echo json_encode($pays) ?? []; ?>]; |
|||
const secondPayDeadline = ''; |
|||
const tradeaddress = '<?php echo $contract['address'] ?? ''; ?>'; |
|||
const tradedeadline = 90 |
|||
const freedeadline = 18; |
|||
const regulations = 10; |
|||
const workdeadline_a = 60; |
|||
const workdeadline_b = 7; |
|||
const total_items = <?php echo $total_items ?? ''; ?>; |
|||
const isFirst = <?php echo $isFirst; ?>; |
|||
</script> |
|||
<?php else : ?> |
|||
<script> |
|||
const contractno = '<?php echo $contract['contractno'] ?? ''; ?>'; |
|||
const salesman = '<?php echo $contract['person'] ?? ''; ?>'; |
|||
const salesmanname = '<?php echo $contract['personname'] ?? ''; ?>'; |
|||
const apply_date = '<?php echo date('Y-m-d') ?>'; |
|||
const case_name = '<?php echo $contract['case_name'] ?? ''; ?>'; |
|||
const company = '<?php echo $contract['customer'] ?? ''; ?>'; |
|||
const manager = '<?php echo $contract['manager'] ?? ''; ?>'; |
|||
const vat = '<?php echo $contract['vat'] ?? ''; ?>'; |
|||
const price_total = <?php echo $contract['total_price'] ?? ''; ?>; |
|||
const address = '<?php echo $contract['contact_address'] ?? ''; ?>'; |
|||
const price_a = <?php echo $contract['buy_fee'] ?? ''; ?>; |
|||
const price_b = <?php echo $contract['install_fee'] ?? ''; ?>; |
|||
const items = [...<?php echo json_encode($items) ?? []; ?>]; |
|||
const user_id = '<?php echo $user_id ?? ''; ?>'; |
|||
const mid = '<?php echo $_GET['id']; ?>'; |
|||
const pays = [...<?php echo json_encode($pays) ?? []; ?>]; |
|||
const isFirst = <?php echo $isFirst; ?>; |
|||
const tradeaddress = '<?php echo $contract['trade_address'] ?? ''; ?>'; |
|||
const tradedeadline = '<?php echo $contract['tradedeadline'] ?? ''; ?>'; |
|||
const freedeadline = '<?php echo $contract['freedeadline'] ?? ''; ?>'; |
|||
const regulations = '<?php echo $contract['test_time'] ?? ''; ?>'; |
|||
const workdeadline_a = '<?php echo $contract['workdeadline_a'] ?? ''; ?>'; |
|||
const workdeadline_b = '<?php echo $contract['workdeadline_b'] ?? ''; ?>'; |
|||
const secondPayDeadline = <?php echo $secondPayDeadline ?? ''; ?>; |
|||
const total_items = <?php echo $contract['total_items'] ?? ''; ?>; |
|||
const contract_new_apply_id = <?php echo $contract_new_apply_id; ?>; |
|||
</script> |
|||
|
|||
|
|||
<?php endif; ?> |
|||
<?php if ($status > 0 || ($person != $user_id && $user_id != "M0174")) : ?> |
|||
<script> |
|||
window.onload = () => { |
|||
const input = document.querySelectorAll('input'); |
|||
const alerttext = document.querySelectorAll('p.alerttext'); |
|||
const select = document.querySelectorAll('select'); |
|||
for (let i = 0; i < input.length; i++) { |
|||
input[i].disabled = true |
|||
} |
|||
for (let i = 0; i < select.length; i++) { |
|||
select[i].disabled = true |
|||
} |
|||
for (let i = 0; i < alerttext.length; i++) { |
|||
alerttext[i].style.display = "none" |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<?php endif; ?> |
@ -0,0 +1,649 @@ |
|||
<?php |
|||
include "../header.php"; |
|||
require_once('./conn.php'); |
|||
if ($_POST['list']) { |
|||
$contract_id = $_POST['contract_apply_id']; |
|||
if ($_POST['prviewType'] == 1) { |
|||
$isStand = ($_POST['buystandard'] == "true") ? 1 : 0; |
|||
} else { |
|||
$isStand = $_POST['installstandard'] == "true" ? 1 : 0; |
|||
} |
|||
$type = $_POST['prviewType'] == '1' ? "電梯買賣合約書" : "電梯安裝合約書"; |
|||
$list = json_decode($_POST['list']); |
|||
$standardList = json_decode($_POST['standardList']); |
|||
$illustrate = $_POST['illustrate']; |
|||
$updatedIllustrate = false; |
|||
$standardIllustrate = $_POST['standardIllustrate']; |
|||
$partyA = $_POST['partyA']; |
|||
$partyAcontractno = $_POST['partyAcontractno']; |
|||
$total_price = $_POST['total_price']; |
|||
$person = $_POST['person']; |
|||
$personid = $_POST['personid']; |
|||
$delivery_term = $_POST['delivery_term']; |
|||
$install_period = $_POST['install_period']; |
|||
$free_maintainance = $_POST['free_maintainance']; |
|||
// $originArr = array_filter(json_decode(json_encode($list), true), fn($item)=> $item['origin'] == 1); |
|||
$standardArr = json_decode(json_encode($standardList), true); |
|||
$nostandardArr = json_decode(json_encode($list), true); |
|||
$newlist = array_values(array_filter($list, fn ($item) => $item->deleted == 0)); |
|||
foreach ($nostandardArr as $idx => &$item) { |
|||
if ($item['origin'] === 1) { |
|||
if (strip_tags($item['text']) != strip_tags($standardArr[$item['id']]['text'])) { |
|||
$item['updated'] = 1; |
|||
} else { |
|||
$item['updated'] = 0; |
|||
} |
|||
} |
|||
} |
|||
unset($item); |
|||
if (strip_tags($illustrate) != strip_tags($standardIllustrate)) { |
|||
$updatedIllustrate = true; |
|||
} |
|||
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':vol_no', $partyAcontractno); |
|||
$stmt->execute(); |
|||
$customer = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
if (count($customer) <= 0) { |
|||
echo "<script> |
|||
alert('資料不齊或合約書已生成過。'); |
|||
window.history.back(); |
|||
</script>"; |
|||
} |
|||
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':contract_id', $contract_id); |
|||
$stmt->execute(); |
|||
$files = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
function numberToChinese($num) |
|||
{ |
|||
$chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']; |
|||
$units = ['', '十', '百', '千', '万']; |
|||
|
|||
if ($num <= 10) { |
|||
return $chineseNumbers[$num]; |
|||
} elseif ($num < 20) { |
|||
return $units[1] . $chineseNumbers[$num % 10]; |
|||
} elseif ($num < 100) { |
|||
return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : ''); |
|||
} else { |
|||
// 處理大於 99 的数字 |
|||
$result = ''; |
|||
$strNum = strval($num); |
|||
$length = strlen($strNum); |
|||
for ($i = 0; $i < $length; $i++) { |
|||
$currentDigit = intval($strNum[$i]); |
|||
if ($currentDigit > 0) { |
|||
$result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1]; |
|||
} else { |
|||
$result .= $chineseNumbers[$currentDigit]; |
|||
} |
|||
} |
|||
return $result; |
|||
} |
|||
} |
|||
function removeTrailingBr($string) |
|||
{ |
|||
//刪除字串尾巴的<br>或<br /> |
|||
return preg_replace('/(<br\s*\/?>)+$/', '', $string); |
|||
} |
|||
|
|||
?> |
|||
|
|||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> |
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js" integrity="sha512-E8QSvWZ0eCLGk4km3hxSsNmGWbLtSCSUcewDQPQWZF6pEU8GlT8a5fF32wOl1i8ftdMhssTrF/OhyGWwonTcXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
|||
<style> |
|||
.container { |
|||
background-color: transparent !important; |
|||
width: 100% !important; |
|||
} |
|||
|
|||
.prview, |
|||
.footer { |
|||
width: 800px; |
|||
border: 1px #ccc solid; |
|||
padding: 20px; |
|||
font-family: '標楷體'; |
|||
} |
|||
|
|||
.prview.none { |
|||
display: none; |
|||
} |
|||
|
|||
.prview h2 { |
|||
font-size: 18pt; |
|||
text-align: center; |
|||
} |
|||
|
|||
.prview p { |
|||
font-size: 12pt; |
|||
margin: 0; |
|||
padding: 0; |
|||
} |
|||
|
|||
td tr table th { |
|||
border: none !important; |
|||
background-color: #fff !important; |
|||
} |
|||
|
|||
tr:nth-child(even) { |
|||
background-color: #fff !important; |
|||
} |
|||
|
|||
.colorDiv { |
|||
display: flex; |
|||
margin: 10px 0; |
|||
} |
|||
|
|||
.colorDiv .block { |
|||
width: 18px; |
|||
height: 18px; |
|||
} |
|||
|
|||
.colorDiv span { |
|||
font-size: 15px; |
|||
margin: 0 5px 0 2px; |
|||
font-weight: 600; |
|||
} |
|||
|
|||
.colorDiv .block.gray { |
|||
background-color: #DDDDDD; |
|||
} |
|||
|
|||
.colorDiv .block.green { |
|||
background-color: #00B900; |
|||
} |
|||
|
|||
.colorDiv .block.red { |
|||
background-color: #D11919; |
|||
} |
|||
|
|||
#btn, |
|||
.pre { |
|||
background-color: #0D559D; |
|||
color: #fff; |
|||
outline: none; |
|||
border: none; |
|||
border: 1px #ccc solid; |
|||
width: 100px; |
|||
height: 32px; |
|||
font-weight: 600; |
|||
border-radius: 6px; |
|||
margin-right: 5px; |
|||
} |
|||
|
|||
.pre { |
|||
background-color: #40C474; |
|||
} |
|||
</style> |
|||
|
|||
<div class="container" x-data="{ |
|||
css:'', |
|||
random:'', |
|||
init(){ |
|||
|
|||
const characters = '012345678901234567890123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
|||
const charactersLength = characters.length; |
|||
let randomString = ''; |
|||
const length = 15; |
|||
|
|||
for (let i = 0; i < length; i++) { |
|||
const randomIndex = Math.floor(Math.random() * charactersLength); |
|||
randomString += characters.charAt(randomIndex); |
|||
} |
|||
this.random = randomString; |
|||
console.log(files); |
|||
}, |
|||
exportFn(){ |
|||
|
|||
const now = new Date(); |
|||
|
|||
// 獲取年、月、日、小時、分鐘、秒 |
|||
const year = now.getFullYear(); |
|||
const month = now.getMonth() + 1; // 月份是從0開始的,所以要加1 |
|||
const day = now.getDate(); |
|||
const hours = now.getHours(); |
|||
const minutes = now.getMinutes(); |
|||
const seconds = now.getSeconds(); |
|||
// 格式化日期和時間 |
|||
const formattedDate = `${year}${month}${day}${hours}${minutes}${seconds}`; |
|||
|
|||
let token = formattedDate + '<?php echo $partyAcontractno; ?><?php echo $partyA; ?>永佳捷<?php echo $total_price; ?>' |
|||
let newtoken = formattedDate + '-' + CryptoJS.MD5(CryptoJS.SHA256(CryptoJS.SHA256(CryptoJS.MD5(token).toString()).toString() + this.random).toString()).toString() |
|||
console.log(newtoken); |
|||
let html = this.$refs.prview.innerHTML |
|||
let footer = this.$refs.footer.innerHTML |
|||
let affix1 = this.$refs.affix1.innerHTML |
|||
// html = this.$refs.footer.innerHTML |
|||
// axios.post('./export-pdf.php', {'html':html}).then(res=>{ |
|||
// console.log(res); |
|||
// }) |
|||
const form = new FormData(); |
|||
form.append('html', html); |
|||
form.append('footer', footer); |
|||
form.append('affix1', affix1); |
|||
form.append('css',this.css); |
|||
form.append('user_name', '<?php echo $user_name; ?>'); |
|||
form.append('contract_no', '<?php echo $partyAcontractno; ?>'); |
|||
form.append('party_a', '<?php echo $partyA; ?>'); |
|||
form.append('total_price', '<?php echo $total_price; ?>'); |
|||
form.append('person', '<?php echo $person; ?>'); |
|||
form.append('token', newtoken); |
|||
form.append('formattedDate', formattedDate); |
|||
axiosClient({ |
|||
method:'post', |
|||
responseType:'blob', |
|||
url:'./export-pdf.php', |
|||
data:form |
|||
}).then(response=>{ |
|||
const url = window.URL.createObjectURL(new Blob([response.data])); |
|||
const link = document.createElement('a'); |
|||
link.href = url; |
|||
link.setAttribute('download', formattedDate + '.pdf'); // 指定下载的文件名 |
|||
document.body.appendChild(link); |
|||
link.click(); |
|||
document.body.removeChild(link); |
|||
this.store(newtoken, formattedDate) |
|||
|
|||
for(let i=0;i<files.length;i++){ |
|||
let filename = document.createElement('a'); |
|||
filename.href = './images/contracts_new_files/' + files[i].file_name; |
|||
filename.setAttribute('download', filename.href); // 指定下载的文件名 |
|||
document.body.appendChild(filename); |
|||
filename.click(); |
|||
document.body.removeChild(filename); |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
store(newtoken, formattedDate){ |
|||
const form = new FormData(); |
|||
form.append('contract_id', '<?php echo $partyAcontractno; ?>') |
|||
form.append('uscc', '<?php echo $customer['uscc']; ?>') |
|||
form.append('ekind', '新梯') |
|||
form.append('new_elevator', '<?php $_POST['prviewType'] == '1' ? "買賣" : "安裝"; ?>') |
|||
form.append('party_a', '<?php echo $partyA; ?>') |
|||
form.append('total_price', <?php echo (int)$total_price; ?>) |
|||
form.append('accound_id', '<?php echo $personid; ?>') |
|||
form.append('times', 1) |
|||
form.append('random', this.random) |
|||
form.append('hash', newtoken) |
|||
form.append('url', formattedDate+'.pdf' ); |
|||
form.append('created_by', '<?php echo $user_id; ?>') |
|||
form.append('delivery_term', '<?php echo $delivery_term; ?>') |
|||
form.append('install_period', '<?php echo $install_period; ?>') |
|||
form.append('free_maintainance', '<?php echo $free_maintainance; ?>') |
|||
axiosClient({ |
|||
method:'post', |
|||
url:'./store-contract.php', |
|||
data:form |
|||
}).then(res=>{ |
|||
console.log(res); |
|||
}) |
|||
}, |
|||
}"> |
|||
|
|||
|
|||
<button @click="history.go(-1)" class="pre">回前頁</button> |
|||
<button id="btn" @click="exportFn()">點我下載</button> |
|||
<?php if ($isStand == 0) { ?> |
|||
<div class="colorDiv"> |
|||
<div class="block gray"></div> |
|||
<span>修改的條列</span> |
|||
<div class="block green"></div> |
|||
<span>新增的條列</span> |
|||
<div class="block red"></div> |
|||
<span>刪除的條列</span> |
|||
</div> |
|||
<?php } ?> |
|||
<div class="prview" id="prview" x-ref="prview" style="font-family:'標楷體'" x-show="false"> |
|||
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2> |
|||
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p> |
|||
<table> |
|||
<tr> |
|||
<td style="width:100px"></td> |
|||
<td style="width:200px"><?php echo $_POST['partyA'] ?></td> |
|||
<td>(即買方,以下簡稱為甲方)</td> |
|||
</tr> |
|||
</table> |
|||
<p style="font-size: 12pt;">立合約書人</p> |
|||
<table> |
|||
<tr> |
|||
<td style="width:100px"></td> |
|||
<td style="width:200px">永佳捷科技股份有限公司</td> |
|||
<td>(即賣方,以下簡稱為乙方)</td> |
|||
</tr> |
|||
</table> |
|||
<p style="font-size: 12pt;width:440px"><?php echo $illustrate; ?></p> |
|||
<table style="width:100%"> |
|||
<?php foreach ($newlist as $idx => $item) { |
|||
?> |
|||
<tr style="display:block;"> |
|||
<td style="width:60px;">第<?php echo numberToChinese($idx + 1); ?>條</td> |
|||
<td style="width:445px;"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td> |
|||
</tr> |
|||
<?php } ?> |
|||
</table> |
|||
</div> |
|||
|
|||
|
|||
<section style="display:flex;justify-content:center;"> |
|||
<div class="prview" style="font-family:'標楷體';background-color:#fff;"> |
|||
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2> |
|||
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p> |
|||
<table style="border:none"> |
|||
<tr style="border:none;"> |
|||
<td style="border:none;width:100px;"></td> |
|||
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td> |
|||
<td style="border:none">(即買方,以下簡稱為甲方)</td> |
|||
</tr> |
|||
</table> |
|||
<p style="font-size: 12pt;">立合約書人</p> |
|||
<table style="border:none"> |
|||
<tr style="border:none;"> |
|||
<td style="border:none;width:100px"></td> |
|||
<td style="border:none;width:200px">永佳捷科技股份有限公司</td> |
|||
<td style="border:none">(即賣方,以下簡稱為乙方)</td> |
|||
</tr> |
|||
</table> |
|||
<p style="font-size: 12pt;width:800px"><?php echo $standardIllustrate; ?></p> |
|||
<table style="width:100%;border:none"> |
|||
<?php foreach ($standardList as $idx => $item) { |
|||
?> |
|||
<tr style="margin-bottom:10px;display:block;border:none"> |
|||
<td style="width:100px;border:none">第<?php echo numberToChinese($idx + 1); ?>條</td> |
|||
<td style="border:none"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td> |
|||
</tr> |
|||
<?php } ?> |
|||
</table> |
|||
</div> |
|||
<?php if ($isStand == 0) { ?> |
|||
<div class="prview nostandard" style="font-family:'標楷體'" x-ref="nostandard"> |
|||
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2> |
|||
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p> |
|||
<table style="border:none"> |
|||
<tr style="border:none;"> |
|||
<td style="border:none;width:100px;"></td> |
|||
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td> |
|||
<td style="border:none">(即買方,以下簡稱為甲方)</td> |
|||
</tr> |
|||
</table> |
|||
<p style="font-size: 12pt;">立合約書人</p> |
|||
<table style="border:none"> |
|||
<tr style="border:none;"> |
|||
<td style="border:none;width:100px"></td> |
|||
<td style="border:none;width:200px">永佳捷科技股份有限公司</td> |
|||
<td style="border:none">(即賣方,以下簡稱為乙方)</td> |
|||
</tr> |
|||
</table> |
|||
|
|||
<p style="font-size: 12pt;width:800px;<?php if ($updatedIllustrate) { |
|||
echo 'background-color:#ddd'; |
|||
} ?>"><?php echo $illustrate; ?></p> |
|||
<table style="width:100%;border:none"> |
|||
<?php foreach ($nostandardArr as $idx => $item) { |
|||
?> |
|||
|
|||
<tr style="margin-bottom:10px;display:block;border:none"> |
|||
<td style="width:100px;border:none">第<?php echo numberToChinese($idx + 1); ?>條</td> |
|||
<?php if ($item['updated'] == 1) { ?> |
|||
<td style="border:none;background-color:#ddd;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td> |
|||
<?php } elseif ($item['deleted'] == 1) { ?> |
|||
<td style="border:none;background-color:#D11919;text-decoration:line-through"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td> |
|||
<?php } elseif ($item['id'] > 15) { ?> |
|||
<td style="border:none;background-color:#00B900;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td> |
|||
<?php } else { ?> |
|||
<td style="border:none"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td> |
|||
<?php } ?> |
|||
</tr> |
|||
<?php } ?> |
|||
</table> |
|||
</div> |
|||
<?php } ?> |
|||
</section> |
|||
<div class="footer" x-ref="footer" x-show="false"> |
|||
<br /> |
|||
<p> 立合約書人:</p> |
|||
<table> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:30px;border:none">甲</td> |
|||
<td style="width:30px;border:none;text-align:right">方</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
<td style="border:none"> <?php echo $_POST['partyA']; ?></td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:20px;border:none;">代</td> |
|||
<td style="width:20px;border:none;text-align:center">表</td> |
|||
<td style="width:20px;border:none;text-align:right">人</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
<td style="border:none"> <?php echo $customer['manager']; ?></td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:15px;border:none;">統</td> |
|||
<td style="width:15px;border:none;text-align:center">一</td> |
|||
<td style="width:15px;border:none;text-align:center">編</td> |
|||
<td style="width:15px;border:none;text-align:right">號</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
<td style="border:none"> <?php echo $customer['uscc']; ?></td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:30px;border:none;">地</td> |
|||
<td style="width:30px;border:none;text-align:right">址</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
<td style="border:none"> <?php echo $customer['address']; ?></td> |
|||
</tr> |
|||
</table> |
|||
<p style="line-height:0.1"> </p> |
|||
<table> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:30px;border:none">乙</td> |
|||
<td style="width:30px;border:none;text-align:right">方</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
<td style="border:none"> 永佳捷科技股份有限公司</td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:20px;border:none;">總</td> |
|||
<td style="width:20px;border:none;text-align:center">經</td> |
|||
<td style="width:20px;border:none;text-align:right">理</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
<td style="border:none"> 蔡定憲</td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:15px;border:none;">統</td> |
|||
<td style="width:15px;border:none;text-align:center">一</td> |
|||
<td style="width:15px;border:none;text-align:center">編</td> |
|||
<td style="width:15px;border:none;text-align:right">號</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
<td style="border:none"> 90493119</td> |
|||
</tr> |
|||
<tr style="line-height:2"> |
|||
<td style="width:100px;border:none"> |
|||
<table> |
|||
<tr> |
|||
<td style="width:30px;border:none;">地</td> |
|||
<td style="width:30px;border:none;text-align:right">址</td> |
|||
<td style="width:10px;border:none;text-align:right">:</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
<td style="border:none"> 臺北市中山區敬業一路128巷39號3樓之1</td> |
|||
</tr> |
|||
</table> |
|||
<p> </p> |
|||
<!-- <table> |
|||
<tr> |
|||
<td style="width:200px;border:none;text-align:justify">中華民國</td> |
|||
<td style="width:100px;border:none;text-align:right">年</td> |
|||
<td style="width:100px;border:none;text-align:right">月</td> |
|||
<td style="width:100px;border:none;text-align:right">日</td> |
|||
</tr> |
|||
</table> --> |
|||
</div> |
|||
<div class="affix1" x-ref="affix1" x-show="false"> |
|||
<h1 style="text-align:center">升降設備除外工程表</h1> |
|||
<table> |
|||
<tr> |
|||
<td style="width:40px">一、</td> |
|||
<td>機械室之建造,含預留出入口、通風照明、自動閉鎖裝置,及天花板上之保養用吊鉤。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">二、</td> |
|||
<td style="width:460px">通往機械室之樓梯及加護欄杆工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">三、</td> |
|||
<td style="width:460px">機械室基礎台需用防濕之瀝青鐵筋混凝土及地板防塵工事。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">四、</td> |
|||
<td style="width:460px">機械室及升降路中間之橫樑或工字樑之安裝工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">五、</td> |
|||
<td style="width:460px">自屋外至機械室之動力及照明用配線電源開關插座,及接地線等電路工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">六、</td> |
|||
<td style="width:460px">升降路及機械室以外監視盤、電鈴、電話之配管與配線工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">七、</td> |
|||
<td style="width:460px">升降路之建造及底部之防水工程及緩衝器水泥台工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">八、</td> |
|||
<td style="width:460px">機坑照明保養用之開關及插座,鐵爬梯。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">九、</td> |
|||
<td style="width:460px">各樓按鈕開關之留洞工程及安裝後之固定與週邊裝飾工程。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">十、</td> |
|||
<td style="width:460px">升降路內甲方不得裝設有任何與升降設備無關之配線、電線配管、水管、風管等設備。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">十一、</td> |
|||
<td style="width:460px">安裝所需水泥、砂石、水電與供試車用動力電源。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">十二、</td> |
|||
<td style="width:460px">升降路及機房之建造,電源設備之容量及位置等,需符合國家標準(CNS-2866)及建築法規等規定。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:40px">十三、</td> |
|||
<td style="width:460px">機械運抵工地後供給儲存倉庫。</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2">備註:CNS-2866國家標準建築物電梯有關之法規: </td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">1.</td> |
|||
<td style="width:475px">機械室內應設有照明及通風設備,以利管理檢查,照明應在100LUX(米一燭光)以上,通風設備應能使室內溫度保持在攝氏40度以下。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">2.</td> |
|||
<td style="width:475px">機械室之出入口應加鎖,其裝置應良好。 </td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">3.</td> |
|||
<td style="width:475px">由機械室至走廊,樓梯間應便於通行,樓梯應加裝扶手,其與水平面之傾斜角度,應不超過60度。 </td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">4.</td> |
|||
<td style="width:475px">機械室出入門之構造,應有下述裝置: <br> |
|||
A:能自動關閉者。 <br> |
|||
B:有彈簧鎖或其類似裝置,以便室內不用鎖匙,而能開門。 <br> |
|||
C:除屋頂開口部份以外,機械式牆壁,應能耐火。(二小時防火時效) |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">5.</td> |
|||
<td style="width:475px">升降路內不得設置與升降機無關之配管及配線。 </td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">6.</td> |
|||
<td style="width:475px">任一升降路下部之任何部份,供人使用或類似使用時配重側比照車廂,同樣必須裝設緊急安全裝置。</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="width:25px">7.</td> |
|||
<td style="width:475px">若有火警受信總機時,甲方需提供"火警受信總機"檢出信號及通往升降道內之配管配線(0.75MM² × 3) </td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<script> |
|||
const files = <?php echo json_encode($files); ?>; |
|||
const axiosClient = axios.create({ |
|||
baseURL: ``, |
|||
}); |
|||
|
|||
|
|||
axiosClient.interceptors.request.use((config) => { |
|||
config.headers.Authorization = `Bearer ${123}` |
|||
return config; |
|||
}, (error) => { |
|||
return Promise.reject(error); |
|||
}); |
|||
|
|||
axiosClient.interceptors.response.use((response) => { |
|||
return response; |
|||
}, (error) => { |
|||
if (error.response.status === 401) {} |
|||
throw error; |
|||
}); |
|||
|
|||
|
|||
const btn = document.getElementById('btn') |
|||
console.log(<?php echo $contract_id; ?>); |
|||
</script> |
|||
<?php |
|||
} else { |
|||
echo "<script>alert('非法訪問!');window.history.back();</script>"; |
|||
} |
|||
?> |
File diff suppressed because it is too large
Loading…
Reference in new issue