diff --git a/wms/contract/contract-download.php b/wms/contract/contract-download.php index 169bbf06..17410b24 100644 --- a/wms/contract/contract-download.php +++ b/wms/contract/contract-download.php @@ -79,13 +79,19 @@ 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"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':contract_id', $id); + $stmt->execute(); + $files = $stmt->fetchAll(PDO::FETCH_ASSOC); + print_r($files); + echo "count=>" . count($files); + $files_count = count($files); } catch (PDOException $e ){ die("ERROR!!!: ". $e->getMessage()); } - echo $buy_total_price; } ?> @@ -113,7 +119,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){ --> - + - 確認 + 生成買賣合約書 @@ -238,7 +244,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){ 免費保養月數(月) --> - + - 確認 + 生成安裝合約書 @@ -348,7 +354,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){ - + @@ -390,7 +396,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){ const people = ; const floor = ; const speed = ; - console.log(buyArr); + const buyAffix =' '; + console.log(buyAffix); console.log(installArr); buyArr.forEach((item, idx) => { if(item.scale > 0){ diff --git a/wms/contract/contract-new-apply.php b/wms/contract/contract-new-apply.php index 7cf65fe2..1f2948ec 100644 --- a/wms/contract/contract-new-apply.php +++ b/wms/contract/contract-new-apply.php @@ -460,7 +460,7 @@ $person = $contract['person']; - + X diff --git a/wms/contract/js/alpine.js b/wms/contract/js/alpine.js index 7dc17355..cad94a2d 100644 --- a/wms/contract/js/alpine.js +++ b/wms/contract/js/alpine.js @@ -18,7 +18,7 @@ const contractDownload = ()=> { installAffix:1, buyfill1: buyfill1, buyfill2: secondPayDeadline, - buyAffix:1, + buyAffix: buyAffix, css: `table { background-color: #fff; border: none; margin-top: 30px; font-family: '標楷體'; width: 600px; } table tr:nth-child(even), table tr:nth-child(odd) { background-color: #fff; } table tr { font-size: 12pt; width: 100%; } table tr h2 { font-size: 18pt; } table tr td { width: 100%; height: 100%; line-height: 2; display: flex; } table tr td.center { display: flex; justify-content: center; align-items: center; } table tr td.list { width: 100%; height: 100%; white-space: nowrap; display: flex; } table tr td.list span { width: 60px; min-height: 100%; display: block; } table tr td.list > p { display: block; text-align: justify; } table tr td.list div { max-width: calc(100% - 60px); white-space: normal; } table tr td.list div.text-justify { display: flex; width: 100%; justify-content: space-between; } table tr.date td > div { width: 100%; text-align: right; } table tr.date td > div.text-justify { display: flex; justify-content: space-between; } table td, table th { padding: 8px; }`, data:{ illustrate:{ diff --git a/wms/contract/prviewPdf.php b/wms/contract/prviewPdf.php index b31ec39e..74e54d9a 100644 --- a/wms/contract/prviewPdf.php +++ b/wms/contract/prviewPdf.php @@ -2,6 +2,7 @@ include "../header.php"; require_once('./conn.php'); if($_POST['list']){ + $contract_id = $_GET['id']; if($_POST['prviewType'] == 1){ $isStand = ($_POST['buystandard']=="true") ? 1 : 0; }else{ @@ -50,6 +51,12 @@ if($_POST['list']){ window.history.back(); "; } + + $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 = ['', '十', '百', '千', '万']; @@ -163,6 +170,7 @@ if($_POST['list']){ css:'', random:'', init(){ + const characters = '012345678901234567890123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; const charactersLength = characters.length; let randomString = ''; @@ -172,7 +180,8 @@ if($_POST['list']){ const randomIndex = Math.floor(Math.random() * charactersLength); randomString += characters.charAt(randomIndex); } - this.random = randomString + this.random = randomString; + console.log(files); }, exportFn(){ @@ -224,6 +233,16 @@ if($_POST['list']){ link.click(); document.body.removeChild(link); this.store(newtoken, formattedDate) + + for(let i=0;i + const files = ; const axiosClient = axios.create({ baseURL : ``, });
免費保養月數(月)