|
|
@ -6,7 +6,7 @@ $sql_str = "SELECT * FROM contract_r_signed_back WHERE id = :id ORDER BY id DE |
|
|
|
$stmt = $conn->prepare($sql_str); |
|
|
|
$stmt->bindParam(':id', $id); |
|
|
|
$stmt->execute(); |
|
|
|
$contract= $stmt->fetch(PDO::FETCH_ASSOC); |
|
|
|
$contract = $stmt->fetch(PDO::FETCH_ASSOC); |
|
|
|
// echo '<pre>'; |
|
|
|
// print_r($contract); |
|
|
|
// echo '</pre>'; |
|
|
@ -21,13 +21,13 @@ $accounttype = "M"; |
|
|
|
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype"; |
|
|
|
$stmt = $conn->prepare($sql_str); |
|
|
|
$stmt->bindParam(":accounttype", $accounttype); |
|
|
|
$stmt -> execute(); |
|
|
|
$stmt->execute(); |
|
|
|
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
|
|
$persons = array_map(function($person){ |
|
|
|
$persons = array_map(function ($person) { |
|
|
|
return [ |
|
|
|
'view'=>$person['accountid'] .'-'. $person['name'], |
|
|
|
'value'=>$person['accountid'], |
|
|
|
'name'=>$person['name'] |
|
|
|
'view' => $person['accountid'] . '-' . $person['name'], |
|
|
|
'value' => $person['accountid'], |
|
|
|
'name' => $person['name'] |
|
|
|
]; |
|
|
|
}, $persons); |
|
|
|
?> |
|
|
@ -39,12 +39,9 @@ $persons = array_map(function($person){ |
|
|
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> |
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js"></script> |
|
|
|
<link |
|
|
|
rel="stylesheet" |
|
|
|
href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css" |
|
|
|
/> |
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css" /> |
|
|
|
<div class="contract-management" x-data='contract_edit'> |
|
|
|
<div class="form" method="post" id="form" enctype="multipart/form-data" > |
|
|
|
<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%"> |
|
|
@ -56,7 +53,7 @@ $persons = array_map(function($person){ |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
|
|
|
|
<tbody style="font-weight: bolder;margin-bottom: 20px" > |
|
|
|
<tbody style="font-weight: bolder;margin-bottom: 20px"> |
|
|
|
<tr> |
|
|
|
<td colspan="7" style='vertical-align: middle;border-right:0px;'> |
|
|
|
<h4>檢視合約</h4> |
|
|
@ -69,7 +66,7 @@ $persons = array_map(function($person){ |
|
|
|
<tr> |
|
|
|
<td style="vertical-align: middle">立約人</td> |
|
|
|
<td> |
|
|
|
<input class="form-control disabled_select" type="text" x-model="data.company" > |
|
|
|
<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> |
|
|
|
|
|
|
@ -77,7 +74,7 @@ $persons = array_map(function($person){ |
|
|
|
<td style="vertical-align: middle"> |
|
|
|
<select class="repaireid" id="repaireid" x-model="data.repaireid"> |
|
|
|
<option value="">選擇營業員</option> |
|
|
|
<?php foreach($persons as $person): ?> |
|
|
|
<?php foreach ($persons as $person) : ?> |
|
|
|
<option value="<?php echo $person['value']; ?>"><?php echo $person['view']; ?></option> |
|
|
|
<?php endforeach ?> |
|
|
|
</select> |
|
|
@ -86,42 +83,42 @@ $persons = array_map(function($person){ |
|
|
|
|
|
|
|
<td style="vertical-align: middle">電梯編號</td> |
|
|
|
<td> |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.facilityno" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.facilityno"> |
|
|
|
<p class="alerttext" x-show="data.facilityno==''"><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" name="uscc" x-model="data.repair_no" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.repair_no"> |
|
|
|
<p class="alerttext" x-show="data.repair_no==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="vertical-align: middle">工程類別</td> |
|
|
|
<td> |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.type" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.type"> |
|
|
|
<p class="alerttext" x-show="data.type==''"><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" name="sign_date" x-model="data.sign_date" > |
|
|
|
<input class="form-control disabled_select" type="text" name="sign_date" x-model="data.sign_date"> |
|
|
|
<p class="alerttext" x-show="data.sign_date==''"><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" name="uscc" x-model="data.invoice" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.invoice"> |
|
|
|
<p class="alerttext" x-show="data.invoice==''"><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" name="uscc" x-model="data.taxid" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.taxid"> |
|
|
|
<p class="alerttext" x-show="data.taxid==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="vertical-align: middle">工程地址</td> |
|
|
|
<td colspan=3> |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.address" > |
|
|
|
<input class="form-control disabled_select" type="text" name="uscc" 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> |
|
|
@ -169,33 +166,31 @@ $persons = array_map(function($person){ |
|
|
|
|
|
|
|
|
|
|
|
<script src="./js/jquery/jquery-3.1.1.min.js"></script> |
|
|
|
<script src="semantic/dist/semantic.min.js" ></script> |
|
|
|
<script src="semantic/dist/semantic.min.js"></script> |
|
|
|
<script src="./js/alpine.js"></script> |
|
|
|
<script> |
|
|
|
const user_id = '<?php echo $user_id; ?>'; |
|
|
|
const user_name = '<?php echo $user_name; ?>'; |
|
|
|
const id = <?php echo $contract['id']?>; |
|
|
|
const repair_no = '<?php echo $contract['repair_no'];?>' |
|
|
|
const contractno = '<?php echo $contract['contractno'];?>' |
|
|
|
const company = '<?php echo $contract['company'];?>' |
|
|
|
const taxid = '<?php echo $contract['taxid'];?>' |
|
|
|
const facilityno = '<?php echo $contract['facilityno'];?>' |
|
|
|
const address = '<?php echo $contract['address'];?>' |
|
|
|
const type = '<?php echo $contract['type'];?>' |
|
|
|
const invoice = '<?php echo $contract['invoice'];?>' |
|
|
|
const repaireid = '<?php echo $contract['repaireid'];?>' |
|
|
|
// const total_price = '<?php echo $contract['total_price'];?>' |
|
|
|
const sign_date = '<?php echo $contract['sign_date'];?>' |
|
|
|
$('#table_index').DataTable( |
|
|
|
{ |
|
|
|
"order": [ |
|
|
|
[0, "desc"], |
|
|
|
] |
|
|
|
} |
|
|
|
); |
|
|
|
Fancybox.bind('[data-fancybox="gallery"]', { |
|
|
|
|
|
|
|
}); |
|
|
|
const id = <?php echo $contract['id'] ?>; |
|
|
|
const repair_no = '<?php echo $contract['repair_no']; ?>' |
|
|
|
const contractno = '<?php echo $contract['contractno']; ?>' |
|
|
|
const company = '<?php echo $contract['company']; ?>' |
|
|
|
const taxid = '<?php echo $contract['taxid']; ?>' |
|
|
|
const facilityno = '<?php echo $contract['facilityno']; ?>' |
|
|
|
const address = '<?php echo $contract['address']; ?>' |
|
|
|
const type = '<?php echo $contract['type']; ?>' |
|
|
|
const invoice = '<?php echo $contract['invoice']; ?>' |
|
|
|
const repaireid = '<?php echo $contract['repaireid']; ?>' |
|
|
|
const total_price = '<?php echo $contract['total_price']; ?>' |
|
|
|
const sign_date = '<?php echo $contract['sign_date']; ?>' |
|
|
|
// $('#table_index').DataTable( |
|
|
|
// { |
|
|
|
// "order": [ |
|
|
|
// [0, "desc"], |
|
|
|
// ] |
|
|
|
// } |
|
|
|
// ); |
|
|
|
// Fancybox.bind('[data-fancybox="gallery"]', { |
|
|
|
|
|
|
|
// }); |
|
|
|
</script> |
|
|
|
|
|
|
|