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.
147 lines
3.9 KiB
147 lines
3.9 KiB
<?php
|
|
include "header.php";
|
|
|
|
// 設置一個空陣列來放資料
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$sql_cmd = sql_myself($user_id, "orderer_id");
|
|
$sql = "SELECT * FROM delivery_info $sql_cmd ORDER BY id";
|
|
|
|
// 用mysqli_query方法執行(sql語法)將結果存在變數中
|
|
$data = mysqli_query($link,$sql);
|
|
|
|
?>
|
|
|
|
<!-- <a href="create.php"><h2>新增</h2></a> -->
|
|
<?php if ($user_auth&2) { ?>
|
|
<p>
|
|
<a href="delivery_info-create.php?function_name=delivery_info&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</a>
|
|
</p>
|
|
|
|
<?php
|
|
}
|
|
|
|
|
|
|
|
if($data):
|
|
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){
|
|
echo "<p class='error'>Please fill up the required field!</p>";
|
|
} else {
|
|
header("Location:delivery_info-index.php");
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
<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>
|
|
<th>連絡電話</th>
|
|
<th>收件地址</th>
|
|
<th>物料總價</th>
|
|
<th>運費</th>
|
|
<th>稅金</th>
|
|
<th>合計</th>
|
|
<th>建檔日</th>
|
|
<?php if ($user_auth&2) { ?>
|
|
<th>修改</th>
|
|
<th>刪除</th>
|
|
<?php } ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php foreach($data as $data) : ?>
|
|
<tr>
|
|
<td><?php echo $data['id']; ?></td>
|
|
<td><?php echo $data['deliver_no']; ?></td>
|
|
<td><?php echo $data['orderer_id']; ?></td>
|
|
<td><?php echo $data['orderer_name']; ?></td>
|
|
<td><?php echo $data['contact_person']; ?></td>
|
|
<td><?php echo $data['tel']; ?></td>
|
|
<td><?php echo $data['address']; ?></td>
|
|
<td><?php echo $data['total_price_equipments']; ?></td>
|
|
<td><?php echo $data['delivery_fee']; ?></td>
|
|
<td><?php echo $data['tax_fee']; ?></td>
|
|
<td><?php echo $data['summation']; ?></td>
|
|
<td><?php echo $data['create_at']; ?></td>
|
|
<?php if ($user_auth&2) { ?>
|
|
<td>
|
|
<p>
|
|
<a href="delivery_info-edit.php?id=<?php echo $data['id']; ?>&function_name=delivery_info&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
</a>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<a href="delivery_info-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
|
|
<span class="glyphicon glyphicon-remove"></span>
|
|
</a>
|
|
</p>
|
|
</td>
|
|
<?php } ?>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<?php
|
|
|
|
else:
|
|
echo "<h2>There is no record!</h2>";
|
|
endif;
|
|
|
|
#代表結束連線
|
|
mysqli_close($link);
|
|
|
|
include "footer.php";
|
|
|
|
?>
|