@ -46,6 +46,7 @@ if(empty($contract_new_apply)){
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
$total_items = 0;
print_r($items);
foreach($items as $item){
$total_items += $item['item_qty'];
}
@ -94,6 +95,7 @@ if(empty($contract_new_apply)){
$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" / >
@ -167,17 +169,17 @@ $person = $contract['person'];
< tr >
< td style = "vertical-align: middle" > 含稅給約總價< / td >
< td colspan = "3" style = "vertical-align: middle" >
< input class = "form-control disabled_select" type = "number" x-model = "data.total_price" >
< 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" type = "number" x-model = "data.price_a" >
< 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" type = "number" x-model = "data.price_b" >
< 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 >
@ -276,7 +278,7 @@ $person = $contract['person'];
< 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" type = "text" x-model = "item.item_spec" >
< 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" >
@ -284,7 +286,7 @@ $person = $contract['person'];
< 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" type = "number" x-model = "item.item_price_ct" >
< 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 >
@ -398,7 +400,7 @@ $person = $contract['person'];
< / 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 " >
< 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 >
@ -406,7 +408,7 @@ $person = $contract['person'];
< / 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 " >
< 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 >
@ -422,11 +424,34 @@ $person = $contract['person'];
<?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%" >
< tbody style = "font-weight: bolder;margin-bottom: 20px" >
< 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 > < input type = "number" class = "form-control" x-model = "data.secondPayDeadline" / > < / td >
< td colspan = "4" > 附件上傳< / td >
< td colspan = "4" >
< input type = "file" name = "file[]" multiple draggable = "true" @ change = "uploadFiles($event)" / >
< / td >
< / tr >
< / tbody >
< / table >
@ -437,7 +462,7 @@ $person = $contract['person'];
< h4 style = 'text-align:center;font-weight: bolder' > 簽核流程< / h4 >
< / td >
< / tr >
< / thead >
< / thead >
< tbody >
< tr >
< td > 審核< / td >
@ -536,6 +561,14 @@ $person = $contract['person'];
< 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' ] ?? '' ; ?> ';
@ -555,11 +588,11 @@ $person = $contract['person'];
const mid = '<?php echo $_GET [ 'id' ]; ?> ';
const pays = [...<?php echo json_encode ( $pays ) ?? []; ?> ];
const secondPayDeadline = '';
const tradeaddress = "" ;
const tradeaddress = '<?php echo $contract [ 'address' ] ?? '' ; ?> ' ;
const tradedeadline = 90
const freedeadline = 18;
const regulations = 45 ;
const workdeadline_a = 3 0;
const regulations = 10 ;
const workdeadline_a = 6 0;
const workdeadline_b = 7;
const total_items = <?php echo $total_items ?? '' ; ?> ;
const isFirst = <?php echo $isFirst ; ?> ;