@ -25,6 +25,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
$stmt->execute();
$stmt->execute();
$contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
$contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
$contract = $contracts[0];
$contract = $contracts[0];
$contract_apply_id = $contract['id'];
if(($contract['status'] !== "YY" & & $user_id != 'M0107') & & $user_id != 'M0174'){
if(($contract['status'] !== "YY" & & $user_id != 'M0107') & & $user_id != 'M0174'){
echo '< script type = "text/javascript" >
echo '< script type = "text/javascript" >
alert("非法訪問。");
alert("非法訪問。");
@ -79,13 +80,17 @@ if(isset($_GET['id']) && $_GET['id']!=""){
}
}
}
}
print_r($buyArr);
$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 ){
catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage());
die("ERROR!!!: ". $e->getMessage());
}
}
echo $buy_total_price;
}
}
?>
?>
< link rel = "stylesheet" href = "./styles/style.css" >
< link rel = "stylesheet" href = "./styles/style.css" >
@ -113,7 +118,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
< input type = "number" x-model = "buyfill2" >
< input type = "number" x-model = "buyfill2" >
< / label > -->
< / label > -->
<?php } ?>
<?php } ?>
< label for = "" >
<!-- <label for="" >
< p > 附件數< / p >
< p > 附件數< / p >
< select x-model = "buyAffix" >
< select x-model = "buyAffix" >
< option value = "1" > 1< / option >
< option value = "1" > 1< / option >
@ -122,9 +127,9 @@ if(isset($_GET['id']) && $_GET['id']!=""){
< option value = "4" > 4< / option >
< option value = "4" > 4< / option >
< option value = "5" > 5< / option >
< option value = "5" > 5< / option >
< / select >
< / select >
< / label >
< / label > -->
< label for = "" >
< label for = "" >
< button @ click = "sendBuyInputFn()" > 確認 < / button >
< button @ click = "sendBuyInputFn()" > 生成買賣合約書 < / button >
< / label >
< / label >
< / div >
< / div >
< div class = "contract-material-component" x-show = "isbuyShow && !isBuyInputIng" >
< div class = "contract-material-component" x-show = "isbuyShow && !isBuyInputIng" >
@ -238,7 +243,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
< p > 免費保養月數(月)< / p >
< p > 免費保養月數(月)< / p >
< input type = "number" x-model = "installfill2" @ keyup = "sendInstallInputKeyupFn($event)" / >
< input type = "number" x-model = "installfill2" @ keyup = "sendInstallInputKeyupFn($event)" / >
< / label > -->
< / label > -->
< label for = "" >
<!-- <label for="" >
< p > 附件數< / p >
< p > 附件數< / p >
< select x-model = "installAffix" @ keyup = "sendInstallInputKeyupFn($event)" >
< select x-model = "installAffix" @ keyup = "sendInstallInputKeyupFn($event)" >
< option value = "1" > 1< / option >
< option value = "1" > 1< / option >
@ -247,9 +252,9 @@ if(isset($_GET['id']) && $_GET['id']!=""){
< option value = "4" > 4< / option >
< option value = "4" > 4< / option >
< option value = "5" > 5< / option >
< option value = "5" > 5< / option >
< / select >
< / select >
< / label >
< / label > -->
< label for = "" >
< label for = "" >
< button @ click = "sendInstallInputFn()" > 確認 < / button >
< button @ click = "sendInstallInputFn()" > 生成安裝合約書 < / button >
< / label >
< / label >
< / div >
< / div >
< div class = "contract-install-component" x-show = "!isbuyShow && !isInstallInputIng" x-cloak >
< div class = "contract-install-component" x-show = "!isbuyShow && !isInstallInputIng" x-cloak >
@ -348,7 +353,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
< / table >
< / table >
< / div >
< / div >
< form action = "prviewPdf.php?& <?php echo $token_link ; ?> " id = "form" method = "post" x-ref = "form" style = "display:none" >
< 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 = "list" id = "prview-list" / >
< input type = "hidden" name = "prviewType" id = "prview-type" / >
< input type = "hidden" name = "prviewType" id = "prview-type" / >
< input type = "hidden" name = "standardList" id = "standard-prview-list" / >
< input type = "hidden" name = "standardList" id = "standard-prview-list" / >
@ -390,7 +396,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
const people = <?php echo $noteArr [ 1 ]; ?> ;
const people = <?php echo $noteArr [ 1 ]; ?> ;
const floor = <?php echo $noteArr [ 2 ]; ?> ;
const floor = <?php echo $noteArr [ 2 ]; ?> ;
const speed = <?php echo $noteArr [ 3 ]; ?> ;
const speed = <?php echo $noteArr [ 3 ]; ?> ;
console.log(buyArr);
const buyAffix =' <?php echo $files_count ; ?> ';
console.log(buyAffix);
console.log(installArr);
console.log(installArr);
buyArr.forEach((item, idx) => {
buyArr.forEach((item, idx) => {
if(item.scale > 0){
if(item.scale > 0){