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.
 
 
 
 
 
 

168 lines
5.4 KiB

<?php
require_once "../header.php";
// 載入db.php來連結資料庫
require_once "../database.php";
require_once '../PHPExcel/PHPExcel.php';
require_once '../PHPExcel/IOFactory.php';
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$where_form_key = "";
if (!empty($_GET['form_key'])) $where_form_key = " where form_key='" . $_GET['form_key'] . "'";
$sql = "SELECT * FROM ec_purchase_order $where_form_key ORDER BY customerid";
// 用mysqli_query方法執行(sql語法)將結果存在變數中
$data = mysqli_query($link, $sql);
?>
<!-- <a href="create.php"><h2>新增</h2></a> -->
<p>
<a href="ec_purchase_order_import.php" 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:repair-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>
<th>各品項交付日(訂貨單)</th>
<th>摘要</th>
<th>契約開始日期</th>
<th>契約結束日期</th>
<th>銷售人員</th>
<th>最初輸入人</th>
<th>錄入日期</th>
<th>創建人員</th>
<th>創建日期</th>
<th>编辑</th>
<th>刪除</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $data) : ?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['customerid']; ?></td>
<td><?php echo $data['inv_customer_id']; ?></td>
<td><?php echo $data['inv_customer_name']; ?></td>
<td><?php echo $data['customer_name']; ?></td>
<td><?php echo $data['item_no']; ?></td>
<td><?php echo $data['item_name']; ?></td>
<td><?php echo $data['num']; ?></td>
<td><?php echo $data['unit_price']; ?></td>
<td><?php echo $data['pre_tax_price']; ?></td>
<td><?php echo $data['business_tax']; ?></td>
<td><?php echo $data['summary_price']; ?></td>
<td><?php echo $data['delivery_date']; ?></td>
<td><?php echo $data['summary']; ?></td>
<td><?php echo $data['contract_begin_date']; ?></td>
<td><?php echo $data['contract_end_date']; ?></td>
<td><?php echo $data['salesman']; ?></td>
<td><?php echo $data['operator_name']; ?></td>
<td><?php echo $data['enter_dtae']; ?></td>
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td>
<td>
<p>
<a href="ec_purchase_order_edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td>
<p>
<a href="purchase_order_delete.php?id=<?php echo $data['id']; ?>" 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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else :
echo "<h2>There is no record!</h2>";
endif;
#代錶結束連線
mysqli_close($link);
include "../footer.php";
?>