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.
186 lines
5.9 KiB
186 lines
5.9 KiB
<?php
|
|
// phpinfo();
|
|
// exit();
|
|
error_reporting(E_ALL);
|
|
ini_set("display_errors", "on");
|
|
/**
|
|
* 显示所有的待签 员工所有待签
|
|
*/
|
|
|
|
|
|
// 載入db.php來連結資料庫
|
|
require_once "../database.php";
|
|
require_once "../header.php";
|
|
|
|
|
|
|
|
$system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id'];
|
|
$where_system_id = " and a.system_id like '" . $system_id . "%'";
|
|
|
|
$flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id'];
|
|
$where_flow_id = " and b.flow_id like '" . $flow_id . "%'";
|
|
|
|
$sql_get = "SELECT c.form_key, a.system_id,b.flow_id ,a.system_name,c.current_assigner,
|
|
concat(c.current_assigner ,'-',f_return_name(c.current_assigner)) current_assigner_name ,
|
|
flow_name,c.update_date ,c.create_date,b.path,d.flow_code FROM system_main a,flow_main b ,subflow
|
|
c,flow d
|
|
WHERE a.system_id=b.system_id
|
|
AND b.flow_id=d.flow_id
|
|
AND c.current_assigner='$user_id'
|
|
AND d.flow_id=b.flow_id
|
|
AND c.form_key=d.form_key
|
|
$where_system_id
|
|
$where_flow_id
|
|
";
|
|
|
|
$result = mysqli_query($link, $sql_get);
|
|
if ($result == false) {
|
|
die(mysqli_error($link));
|
|
}
|
|
$res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC);
|
|
echo '<pre>';
|
|
print_r($sql_get);
|
|
echo '</pre>';
|
|
exit;
|
|
|
|
$system_name_opt = array_map(function ($item) {
|
|
return array('system_id' => $item['system_id'], 'system_name' => $item['system_name']);
|
|
}, $res_get);
|
|
$system_name_opt = (array_unique($system_name_opt, SORT_REGULAR));
|
|
|
|
|
|
$flow_name_opt = array_map(function ($item) {
|
|
return array('flow_id' => $item['flow_id'], 'flow_name' => $item['flow_name']);
|
|
}, $res_get);
|
|
$flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
|
|
|
|
?>
|
|
<style>
|
|
table {
|
|
table-layout: fixed;
|
|
width: 90%;
|
|
}
|
|
|
|
td {
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
img {
|
|
width: 125px;
|
|
}
|
|
|
|
.width_style_1 {
|
|
width: 125px;
|
|
}
|
|
|
|
.table>tbody>tr>td,
|
|
.table>tbody>tr>th,
|
|
.table>tfoot>tr>td,
|
|
.table>tfoot>tr>th,
|
|
.table>thead>tr>td,
|
|
.table>thead>tr>th {
|
|
vertical-align: middle !important;
|
|
}
|
|
|
|
#table_index_filter {
|
|
float: right;
|
|
}
|
|
|
|
#table_index_paginate {
|
|
float: right;
|
|
}
|
|
|
|
|
|
table.query-table th {
|
|
text-align: right;
|
|
}
|
|
</style>
|
|
<form method='post' action='#'>
|
|
<table class='table query-table table-striped table-bordered display compact' style='width:90%;text-align:center;margin:0 auto'>
|
|
<thead>
|
|
<tr>
|
|
<td colspan="8">
|
|
<h3 style='text-align:center'>待簽查詢</h3>
|
|
</td>
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th style='width:50px'>系統名稱</th>
|
|
<td colspan='1'>
|
|
<select class='form-control' name='system_id'>
|
|
<?php
|
|
echo " <option class='form-control' value='%' >全部</option>";
|
|
foreach ($system_name_opt as $opt) {
|
|
echo " <option class='form-control' value=" . $opt['system_id'] . " >" . $opt['system_name'] . "</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
<th>流程名稱</th>
|
|
<td colspan='1'> <select class='form-control' name='flow_id'>
|
|
<?php
|
|
echo " <option class='form-control' value='%' >全部</option>";
|
|
foreach ($flow_name_opt as $opt) {
|
|
echo " <option class='form-control' value=" . $opt['flow_id'] . " >" . $opt['flow_name'] . "</option>";
|
|
}
|
|
?>
|
|
</select> </td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="8" style='text-align:center'>
|
|
<button type="submit" style='text-align:center; margin:0 auto;width:50px' class="btn btn-primary">查詢</button>
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
<div style="overflow-x:auto;width:92%;margin:0 auto">
|
|
<table id="table_index" style='width:100%;margin:0 auto' class="table table-striped table-bordered display compact">
|
|
<thead>
|
|
<tr>
|
|
<th>序號</th>
|
|
<th>系統名稱</th>
|
|
<th>流程名稱</th>
|
|
<th>接收日期</th>
|
|
<th>當前簽核者</th>
|
|
<th>狀態</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
$rowspan = 1;
|
|
$path = "localhost:3000/wms/sign/list.php";
|
|
foreach ($res_get as $key => $data) :
|
|
//嘗試將已結案隱藏起來 : 測試使用者體驗
|
|
if ($data['flow_code'] !== 'Z') {
|
|
?>
|
|
<tr>
|
|
<td><a target="_blank" href="<?= $path . "?form_key=" . $data['form_key'] . "&token=$token" ?>"><?= $data['form_key']; ?></a></td>
|
|
<td><?php echo $data['system_name']; ?></td>
|
|
<td><?php echo $data['flow_name']; ?></td>
|
|
<td><?php echo $data['update_date']; ?></td>
|
|
<td><?php echo $data['current_assigner_name']; ?></td>
|
|
<td><?php echo $data['flow_code'] == 'Z' ? "結案" : "未結案"; ?></td>
|
|
</tr>
|
|
|
|
|
|
<?php
|
|
}
|
|
endforeach;
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</form>
|
|
<?php
|
|
#代錶結束連線
|
|
mysqli_close($link);
|
|
require_once "../footer.php";
|
|
|
|
|
|
?>
|