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.
 
 
 
 
 
 

146 lines
3.6 KiB

<?php
include "../header.php";
// 載入db.php來連結資料庫
require_once "../database.php";
require_once '../PHPExcel/PHPExcel.php';
require_once '../PHPExcel/IOFactory.php';
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$fields_mapping = array(
"form_key" => "表单号",
"cnt" => "笔数",
"yyyymm" => "年月",
"date_seq_start" => "日期-號碼起",
"date_seq_end" => "日期-號碼止"
);
$sql_group_epo = "
SELECT
form_key ,
max(YYYYMM) yyyymm,
count(*) cnt,
min(date_seq) date_seq_start,
max(date_seq) date_seq_end
From ec_purchase_order
GROUP BY form_key";
// 用mysqli_query方法執行(sql語法)將結果存在變數中
?>
<!-- <a href="create.php"><h2>新增</h2></a> -->
<?php
$res_group_epo = mysqli_fetch_all(mysqli_query($link, $sql_group_epo), MYSQLI_ASSOC);
?>
<style>
table {
table-layout: fixed;
width: 95%;
text-align: center;
}
td,
th {
word-wrap: break-word;
text-align: center;
vertical-align: middle !important;
}
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;margin:0 auto">
<p>
<a href="ec_purchase_order_import.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<?php
echo "
<thead><tr> <th style='text-align:center' colspan=" . (count($fields_mapping) + 1) . ">已上传资料明细</th> </tr><tr>";
foreach (array_values($fields_mapping) as $val) {
echo "<th> $val</th>";
}
echo "<th>操作</th>
</tr>
</thead>";
echo " <tbody>";
?>
<?php
// $res_group_epot = mysqli_fetch_all(mysqli_query($link, $sql_group_epo), MYSQLI_ASSOC);
foreach ($res_group_epo as $row) {
echo " <tr>";
foreach (array_keys($fields_mapping) as $val) {
echo "<td> " . $row[$val] . "</td>";
}
echo "<td>
<p style='float:left' >
<a href='ec_purchase_order_detail.php?form_key=" . $row['form_key'] . "' class='btn btn-info btn-sm'>
<span>查看</span>
</a>
</p>
<p style='float:left;margin-left:5px' >
<a href='batch_invoice_export_submit.php?form_key=" . $row['form_key'] . "' class='btn btn-info btn-sm'>
<span>發票匯入檔下載</span>
</a>
</p>
<p style='float:left;margin-left:5px' >
<a href='data_collection_merge_export_submit.php?form_key=" . $row['form_key'] . "' class='btn btn-info btn-sm'>
<span>請款單歸入檔下載</span>
</a>
</p>
</td>";
echo " </tr>";
}
?>
</tbody>
</table>
</div>
<?php
#代錶結束連線
mysqli_close($link);
include "../footer.php";
?>