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.
 
 
 
 
 
 

112 lines
2.4 KiB

<?php
include "header.php";
// 載入db.php來連結資料庫
require_once "database.php";
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "select distinct maintance_contract_id from maintance_contract_review";
$data = mysqli_query($link,$sql);
?>
<?php
if ($data):
?>
<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>
<div style="overflow-x:auto;">
<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>
</tr>
</thead>
<tbody>
<?php
foreach($data as $s=>$data) :
$maintance_contract_id=$data['maintance_contract_id'];
$sign='';
$signresult='';
$reviewsql = "SELECT * FROM maintance_contract_review where maintance_contract_id='$maintance_contract_id'";
$reviewdata=mysqli_query($link,$reviewsql);
foreach($reviewdata as $k=>$review){
$re=$review['signrole']."/".$review['signer']."<br>";
$sign=$sign.$re;
$isresult=$review['signresult'];
if($isresult==''){
$isresult='待簽核';
}
$re1=$review['signer']."/".$isresult."<br>";
$signresult=$signresult.$re1;
}
?>
<tr>
<td><?php echo $s+1; ?></td>
<td><?php echo $data['maintance_contract_id']; ?></td>
<td><?php echo $sign; ?></td>
<td><?php echo $signresult; ?></td>
<td>
<p>
<a href="review-detail.php?id=<?php echo $data['maintance_contract_id']; ?>&&account=<?php echo $_GET['account'];?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else:
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>