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.
119 lines
3.5 KiB
119 lines
3.5 KiB
<?php
|
|
include("../header.php");
|
|
require_once("./conn.php");
|
|
$sql_str = "SELECT * FROM contract_m_signed_back ";
|
|
$stmt = $conn->prepare($sql_str);
|
|
$stmt->execute();
|
|
$contracts= $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
?>
|
|
<link rel="stylesheet" href="./styles/style.css">
|
|
<link rel="stylesheet" href="semantic/dist/semantic.min.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" />
|
|
<script defer src="./js/alpinejs/cdn.min.js"></script>
|
|
<script src="./js/axios/axios.min.js"></script>
|
|
|
|
<div class="contract-management" x-data="{
|
|
deleteFn(id){
|
|
if(confirm('確定要刪除嗎?')){
|
|
axios.get('./api/deleteNewContractData.php?contractid='+id).then(res=> {
|
|
console.log(res);
|
|
if(res.status === 204){
|
|
alert('刪除成功!')
|
|
location.reload();
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}">
|
|
|
|
<div style="overflow-x:auto;margin-top:12px">
|
|
<a href="contract-newelevator-input.php?function_name=repair&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</a>
|
|
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th>項次</th>
|
|
<th>合約號</th>
|
|
<th>客戶名稱</th>
|
|
<th>負責人</th>
|
|
<th>統編</th>
|
|
<th>建檔者</th>
|
|
<th>建立時間</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach($contracts as $contract): ?>
|
|
<tr>
|
|
<td><?php echo $contract['id']; ?></td>
|
|
<td><?php echo $contract['contract_no'] ?></td>
|
|
<td><?php echo $contract['customer'] ?></td>
|
|
<td><?php echo $contract['manager'] ?></td>
|
|
<td><?php echo $contract['vat'] ?></td>
|
|
<td><?php echo $contract['created_by'] ?></td>
|
|
<td><?php echo $contract['created_at'] ?></td>
|
|
<td style="width:30px">
|
|
<p>
|
|
<a href="contract-newelevator-edit.php?contractid=<?php echo $contract['id']; ?>&function_name=repair&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
</a>
|
|
<a href="javascript:;" class="btn btn-info btn-sm" style="margin-left:10px;" @click="deleteFn(<?php echo $contract['id']; ?>)">
|
|
<span class="glyphicon glyphicon-remove"></span>
|
|
</a>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
table {
|
|
table-layout:fixed;
|
|
width: 100%;
|
|
}
|
|
|
|
td {
|
|
word-wrap:break-word;
|
|
}
|
|
|
|
img {
|
|
width:125px;
|
|
}
|
|
|
|
.width_style_1 {
|
|
width:125px;
|
|
}
|
|
|
|
table{
|
|
width:100%;
|
|
}
|
|
#table_index_filter{
|
|
float:right;
|
|
}
|
|
#table_index_paginate{
|
|
float:right;
|
|
}
|
|
label {
|
|
display: inline-flex;
|
|
margin-bottom: .5rem;
|
|
margin-top: .5rem;
|
|
|
|
}
|
|
|
|
</style>
|
|
<script src="semantic/dist/semantic.min.js" ></script>
|
|
|
|
<script>
|
|
$('#table_index').DataTable(
|
|
{
|
|
"order": [
|
|
[0, "desc"],
|
|
]
|
|
}
|
|
);
|
|
|
|
</script>
|