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.
 
 
 
 
 
 

76 lines
2.3 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);
?>
<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>
<th>狀態</th>
</tr>
<?php foreach($result as $item): ?>
<tr>
<td><?php echo $item['id']; ?></td>
<td><?php echo $item['contractno']; ?></td>
<td><?php echo $item['person_name']; ?></td>
<td><?php echo $item['company']; ?></td>
<td><?php echo $item['case_name']; ?></td>
<td><?php echo $item['price_lowest']; ?></td>
<td><?php echo $item['price_total']; ?></td>
<td><?php echo ((int)$item['price_total'] / (int)$item['price_lowest'] * 100) ."%"; ?></td>
<td><?php echo $item['predeal_date']; ?></td>
<td><?php echo $item['facilitok_date']; ?></td>
<td><?php echo $item['creater']; ?></td>
<td><?php echo $item['create_at']; ?></td>
<td>
<?php
if($item['status'] == 'YY'){
echo "結案同意";
}elseif($item['status'] == 'YS'){
echo "簽核中";
}elseif($item['status'] == 'Y1'){
echo "暫存";
}elseif($item['status'] == 'YN'){
echo "結案不同意";
}else{
echo "---";
}
?>
</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>