You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.4 KiB
69 lines
2.4 KiB
<?php
|
|
|
|
require_once "./conn.php";
|
|
|
|
// $sql_str = "SELECT pricereview_main.*, account.name AS person_name FROM pricereview_main
|
|
// LEFT JOIN account ON account.accountid = pricereview_main.person
|
|
// WHERE pricereview_main.status <> 'D'
|
|
// AND pricereview_main.create_at >= '2024-01-01'
|
|
// AND pricereview_main.create_at <= '2024-01-31'
|
|
// AND ekind = '汰改'";
|
|
// $stmt = $conn->prepare($sql_str);
|
|
// // $stmt->bindParam(':vol_no', $vol_no);
|
|
// $stmt->execute();
|
|
// $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
|
|
$sql_str = "SELECT con_maintance_examine_apply.*, account.name AS person_name, con_maintance_examine_clear.* FROM con_maintance_examine_apply
|
|
LEFT JOIN con_maintance_examine_clear ON con_maintance_examine_clear.apply_key = con_maintance_examine_apply.apply_key
|
|
LEFT JOIN account ON account.accountid = con_maintance_examine_apply.salesman
|
|
WHERE con_maintance_examine_apply.create_at >= '2024-01-01' AND con_maintance_examine_apply.create_at <= '2024-01-31'";
|
|
$stmt = $conn->prepare($sql_str);
|
|
// $stmt->bindParam(':vol_no', $vol_no);
|
|
$stmt->execute();
|
|
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
?>
|
|
|
|
|
|
<table border=1>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>卷號</th>
|
|
<th>營業員</th>
|
|
<th>客戶名稱</th>
|
|
<th>案件名稱</th>
|
|
<th>標準價</th>
|
|
<th>售價總額</th>
|
|
<th>契約成交價</th>
|
|
<th>保養月數</th>
|
|
<th>建檔人</th>
|
|
<th>建檔時間</th>
|
|
<th>狀態</th>
|
|
</tr>
|
|
<?php foreach($result as $key=>$item): ?>
|
|
<tr>
|
|
<td><?php echo $key+1; ?></td>
|
|
<td><?php echo $item['vol_no']; ?></td>
|
|
<td><?php echo $item['person_name']; ?></td>
|
|
<td><?php echo $item['customer']; ?></td>
|
|
<td><?php echo $item['case_name']; ?></td>
|
|
<td><?php echo $item['stand_price']; ?></td>
|
|
<td><?php echo $item['contract_price']; ?></td>
|
|
<td><?php echo $item['sold_price']; ?></td>
|
|
<td><?php echo $item['maintain_months'] . '月'; ?></td>
|
|
<td><?php echo $item['creater']; ?></td>
|
|
<td><?php echo $item['create_at']; ?></td>
|
|
<td>
|
|
簽核中
|
|
</td>
|
|
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
|
|
<script src="table2excel/dist/table2excel.min.js"></script>
|
|
<script>
|
|
const table2Excel = new Table2Excel('table') // new Table2Excel('table')
|
|
table2Excel.export('保養價審', 'xlsx') // table2Excel.export('my-exported-table', 'xlsx')
|
|
</script>
|