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.
731 lines
34 KiB
731 lines
34 KiB
<?php
|
|
include "../header.php";
|
|
require_once('../contract/conn.php');
|
|
// if($user_id == "M0107" || $user_id == "M0174" || $user_id == "M0225"){
|
|
|
|
// }else{
|
|
// echo "維護中..";
|
|
// exit;
|
|
// }
|
|
// 員工編號對應姓名表
|
|
$accountname_arr = accountid2name();
|
|
|
|
$status_arr = ["Y1" => "暫存", "YS" => "簽核中", "YY" => "結案同意", "YN" => "結案不同意"];
|
|
// $pricereviewID = $_GET['id'];
|
|
// 設置一個空陣列來放資料
|
|
|
|
// 從待我簽核進來
|
|
if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) {
|
|
$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 d.form_id,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
|
|
";
|
|
// echo '<pre>';
|
|
// print_r($sql_get);
|
|
// echo '</pre>';
|
|
// exit;
|
|
$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);
|
|
|
|
|
|
foreach ($res_get as $key => $data) {
|
|
// 結案隱藏
|
|
if ($data['flow_code'] !== 'Z') {
|
|
$test = $data['form_id'];
|
|
// $sql = "SELECT mid FROM pricereview_sign WHERE id = $test";
|
|
// $result = mysqli_fetch_all(mysqli_query($link, $sql), MYSQLI_ASSOC);
|
|
// echo '<pre>';
|
|
// print_r($result);
|
|
// echo '</pre>';
|
|
$id[] = $test;
|
|
}
|
|
}
|
|
$inClause = implode(',', $id);
|
|
}
|
|
// 查看已經簽核的單號。
|
|
if (!empty($_GET['check']) && $_GET['check'] == '1') {
|
|
if ($user_id == 'M0026' || $user_id == 'M0033') {
|
|
$sign = "sign1";
|
|
$clause = "sign1 like '%$user_id%' ";
|
|
}
|
|
if ($user_id == 'M0107' || $user_id == 'M0175') {
|
|
$sign = "sign2";
|
|
$clause = "sign2 like '%$user_id%' ";
|
|
}
|
|
if ($user_id == "M0060") {
|
|
$sign = "sign3";
|
|
$clause = "sign3 like '%$user_id%' ";
|
|
}
|
|
if (empty($sign)) {
|
|
echo "
|
|
<script>
|
|
alert('沒有該單號');
|
|
window.history.back();
|
|
</script>
|
|
";
|
|
}
|
|
$sql = "SELECT mid,$sign FROM pricereview_sign WHERE $clause ORDER BY mid";
|
|
|
|
$stmt = $conn->prepare($sql);
|
|
$stmt->execute();
|
|
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
foreach ($results as $result) {
|
|
if (strlen($result[$sign]) > 30 && $sign == 'sign2') {
|
|
$id[] = $result['mid'];
|
|
} else {
|
|
if (strlen($result[$sign]) > 10) {
|
|
|
|
$id[] = $result['mid'];
|
|
}
|
|
}
|
|
}
|
|
$inClause = implode(',', $id);
|
|
}
|
|
|
|
$data = array();
|
|
// sql語法存在變數中
|
|
$sql_cmd = sql_myself($user_id, "pricereview_main .creater");
|
|
$sql = "SELECT pricereview_main.*, contract_new_apply.status AS applystatus, contract_new_apply.progress AS applyprogress FROM pricereview_main LEFT JOIN contract_new_apply ON pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
// M0024許伃廷,M0107許紓晴,,M0175陳君敏,M0189權限全開
|
|
if ($user_id == "M0024" || $user_id == 'M0026' || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0175" || $user_id == "M0189" || $user_id == "M0061" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") {
|
|
$sql_cmd = "where create_at >= '2023-01-01 00:00:00'";
|
|
$sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
}
|
|
if ($user_id == "M0060") {
|
|
$sql_cmd = "where creater in (select accountid from account where (department_id like '3%' or department_id like '5%'))";
|
|
$sql = "select pricereview_main.*,contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where creater in (select accountid from account where (department_id like '3%' or department_id like '5%')) and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
}
|
|
if (empty($sql_cmd)) $sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
else $sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on contract_new_apply.mid = pricereview_main.id $sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
|
|
if (!empty($res_get) || $_GET['check'] == 1) {
|
|
$sql = "SELECT pricereview_main.*,contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress
|
|
from pricereview_main
|
|
left join contract_new_apply on contract_new_apply.mid = pricereview_main.id
|
|
|
|
$sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.id IN ($inClause) AND pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
// echo $sql;
|
|
}
|
|
|
|
$data = mysqli_query($link, $sql);
|
|
|
|
// 若結案不同意
|
|
if (!empty($_GET['check']) && $_GET['check'] == 2) {
|
|
foreach ($data as $data) {
|
|
if ($data['status'] == 'YY') {
|
|
$agree[] = $data['id'];
|
|
}
|
|
}
|
|
$inClause = implode(',', $agree);
|
|
$sql = "SELECT pricereview_main.*,contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress
|
|
from pricereview_main
|
|
left join contract_new_apply on contract_new_apply.mid = pricereview_main.id
|
|
$sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.id IN ($inClause) AND pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
$data = mysqli_query($link, $sql);
|
|
}
|
|
// 若結案同意
|
|
if (!empty($_GET['check']) && $_GET['check'] == 3) {
|
|
foreach ($data as $data) {
|
|
if ($data['status'] == 'YN') {
|
|
$agree[] = $data['id'];
|
|
}
|
|
}
|
|
$inClause = implode(',', $agree);
|
|
$sql = "SELECT pricereview_main.*,contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress
|
|
from pricereview_main
|
|
left join contract_new_apply on contract_new_apply.mid = pricereview_main.id
|
|
$sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.id IN ($inClause) AND pricereview_main.ekind = '新梯' order by pricereview_main.id";
|
|
$data = mysqli_query($link, $sql);
|
|
}
|
|
|
|
$para = "function_name=pricereview&" . $token_link;
|
|
|
|
?>
|
|
<style>
|
|
#table_index2 {
|
|
table-layout: fixed;
|
|
width: 100%;
|
|
}
|
|
|
|
#table_index2_filter {
|
|
float: right;
|
|
}
|
|
|
|
#table_index2_paginate {
|
|
float: right;
|
|
}
|
|
|
|
div.dataTables_scrollHead table.dataTable {
|
|
margin-bottom: 0 !important;
|
|
border-bottom-width: 0;
|
|
}
|
|
|
|
div.dataTables_scrollBody table.dataTable {
|
|
border-top-width: 0;
|
|
}
|
|
|
|
/*
|
|
.col-sm-12 {
|
|
width: auto;
|
|
}
|
|
*/
|
|
img {
|
|
width: 125px;
|
|
}
|
|
|
|
.width_style_1 {
|
|
width: 125px;
|
|
}
|
|
|
|
label {
|
|
display: inline-flex;
|
|
margin-bottom: .5rem;
|
|
margin-top: .5rem;
|
|
|
|
}
|
|
|
|
div a:hover {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn-sm {
|
|
font-size: 14px;
|
|
margin: 2px 0;
|
|
line-height: 90%;
|
|
}
|
|
|
|
.glyphicon-ok,
|
|
.glyphicon-ban-circle {
|
|
font-size: 130%;
|
|
}
|
|
|
|
.btn-secondary {
|
|
color: #fff;
|
|
background-color: #6c757d;
|
|
border-color: #6c757d;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
color: #fff;
|
|
background-color: #5a6268;
|
|
border-color: #545b62;
|
|
}
|
|
</style>
|
|
<script>
|
|
$(function() {
|
|
$('#table_index2').DataTable({
|
|
"scrollX": true,
|
|
"pageLength": 50
|
|
});
|
|
/*
|
|
var api = $('#table_index').dataTable().api();
|
|
//var order = api.order();
|
|
//console.log(order);
|
|
api
|
|
.order([0, "desc"])
|
|
.draw();
|
|
*/
|
|
});
|
|
</script>
|
|
<!--改由有望客戶入口
|
|
<p>
|
|
<a href="pricereview-create.php?vol_no=D220001&function_name=pricereview&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</a>
|
|
</p>
|
|
-->
|
|
<?php
|
|
function get_pending($token)
|
|
{
|
|
global $link;
|
|
if (!$token) throw new \Exception("token empty", 802);
|
|
list($user_id) = explode(".", $token);
|
|
$i = 1;
|
|
$data = [];
|
|
$sql = "
|
|
SELECT
|
|
t.system_id,
|
|
t.system_name,
|
|
t.flow_id,
|
|
t.flow_name,
|
|
COUNT(*)
|
|
FROM (
|
|
SELECT s.form_key,
|
|
m.system_id,
|
|
y.system_name,
|
|
m.flow_id,
|
|
m.flow_name,
|
|
m.path
|
|
FROM subflow s,
|
|
flow f,
|
|
flow_main m,
|
|
system_main y
|
|
WHERE 1=1
|
|
AND m.flow_id NOT IN ('wws04')
|
|
AND EXISTS (
|
|
SELECT form_key,
|
|
MAX(seq)
|
|
FROM subflow
|
|
GROUP BY form_key
|
|
HAVING SUBSTRING(s.form_key, 1, 10) = form_key
|
|
AND s.seq = max(seq)
|
|
)
|
|
AND SUBSTRING(s.form_key, 1, 10) = f.form_key
|
|
AND f.flow_id = m.flow_id
|
|
AND f.system_id = y.system_id
|
|
AND s.current_assigner = '$user_id'
|
|
) t
|
|
GROUP BY t.system_id,
|
|
t.flow_id,
|
|
t.system_name,
|
|
t.flow_name
|
|
LIMIT 0, 6
|
|
";
|
|
// echo '<pre>';
|
|
// print_r($sql);
|
|
// echo '</pre>';
|
|
// exit;
|
|
|
|
|
|
$res = mysqli_query($link, $sql);
|
|
while ($row = mysqli_fetch_row($res)) {
|
|
// print_r($row);
|
|
$data[$i]["sid"] = $row[0];
|
|
$data[$i]["sname"] = $row[1];
|
|
$data[$i]["fid"] = $row[2];
|
|
$data[$i]["fname"] = $row[3];
|
|
$data[$i]["cnt"] = $row[4];
|
|
|
|
$i++;
|
|
}
|
|
mysqli_free_result($res);
|
|
|
|
return $data;
|
|
}
|
|
|
|
$result = get_pending($token);
|
|
$result[1]['sid'] = !empty($result) ? $result[1]['sid'] : 'prm';
|
|
$result[1]['fid'] = !empty($result) ? $result[1]['fid'] : 'prm01';
|
|
|
|
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:pricereview-index.php");
|
|
}
|
|
}
|
|
*/
|
|
?>
|
|
<link rel="stylesheet" href="common.css">
|
|
<div style="overflow-x:auto; white-space:nowrap;">
|
|
<a href="/wms/mkt/pricereview-index.php?&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 所有價審</a>
|
|
<a href="/wms/mkt/pricereview-index.php?system_id=<?= $result[1]['sid'] ?>&flow_id=<?= $result[1]['fid'] ?>&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 待我簽核</a>
|
|
<a href="/wms/mkt/pricereview-index.php?check=1&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 簽核完畢</a>
|
|
<a href="/wms/mkt/pricereview-index.php?check=2&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 結案同意</a>
|
|
<a href="/wms/mkt/pricereview-index.php?check=3&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 結案不同意</a>
|
|
|
|
<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>-->
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
foreach ($data as $data) :
|
|
|
|
$sign1 = $sign2 = $sign3 = $sign4 = "";
|
|
$oneself = ($data["creater"] == $user_id) ? 1 : 0; // 是否為營業員本人
|
|
// 簽核狀況
|
|
$db_query = "select sign1, sign2, sign3, sign4 from pricereview_sign where mid = '" . $data["id"] . "'";
|
|
|
|
$res_s = mysqli_query($link, $db_query);
|
|
if ($row_s = mysqli_fetch_row($res_s)) {
|
|
list($sign1, $sign2, $sign3, $sign4) = $row_s;
|
|
// 下一位簽核人員:$sign_nt, 目前簽核進度:$sign_st
|
|
|
|
|
|
$ss_arr = sign_status([$sign1, $sign2, $sign3, $sign4]);
|
|
|
|
|
|
|
|
|
|
/*
|
|
$sign1_nos = 0;
|
|
$sign_nt_arr = [];
|
|
$sign1_arr = explode("<##>", $sign1);
|
|
foreach ($sign1_arr as $v) {
|
|
if (strlen($v) == 7) {
|
|
$sign1_nos++;
|
|
$sign_nt_arr[] = str_replace(",,", "", $v);
|
|
}
|
|
}
|
|
if (count($sign1_arr) == $sign1_nos) $sign_st = 1;
|
|
if ($sign_st != 1) {
|
|
$sign2_nos = 0;
|
|
$sign_nt_arr = [];
|
|
$sign2_arr = explode("<##>", $sign1);
|
|
foreach ($sign2_arr as $v) {
|
|
if (strlen($v) == 7) {
|
|
$sign2_nos++;
|
|
$sign_nt_arr[] = str_replace(",,", "", $v);
|
|
}
|
|
}
|
|
if (count($sign2_arr) == $sign2_nos) $sign_st = 1;
|
|
}
|
|
if (strlen($sign1) == 7) {
|
|
$sign_st = 1;
|
|
$sign_nt = str_replace(",,", "", $sign1);
|
|
} elseif (strlen($sign2) == 7) {
|
|
$sign_st = 2;
|
|
$sign_nt = str_replace(",,", "", $sign2);
|
|
} elseif (strlen($sign3) == 7) {
|
|
$sign_st = 3;
|
|
$sign_nt = str_replace(",,", "", $sign3);
|
|
} elseif (strlen($sign4) == 7) {
|
|
$sign_st = 4;
|
|
$sign_nt = str_replace(",,", "", $sign4);
|
|
} else {
|
|
$sign_st = 99; // 已審完
|
|
$sign_nt = "";
|
|
}
|
|
*/
|
|
}
|
|
mysqli_free_result($res_s);
|
|
?>
|
|
<tr>
|
|
<td><?php echo $data['id']; ?></td>
|
|
<td><?php echo $data['contractno']; ?></td>
|
|
<td><?php echo $data['person']; ?></td>
|
|
<td><?php echo $data['company']; ?></td>
|
|
<td><?php echo $data['case_name']; ?></td>
|
|
<td><?php echo number_format($data['price_lowest']); ?></td>
|
|
<td><?php echo number_format($data['price_total']); ?></td>
|
|
<td><?php echo $data['price_rate']; ?>%</td>
|
|
<td><?php echo $data['predeal_date']; ?></td>
|
|
<td><?php echo $data['facilitok_date']; ?></td>
|
|
<td><?php echo $accountname_arr[$data['creater']]; ?></td>
|
|
<td><?php echo $data['create_at']; ?></td>
|
|
<td>
|
|
<?php
|
|
//if ($oneself && !($data["status"] == "YY" || $data["status"] == "YN")) { // 自己可以進行規調
|
|
if ($oneself) {
|
|
// 重填價審只能有最新一筆,填規調只有最新一筆可以填。
|
|
$contractno = $data['contractno'];
|
|
$sql = "SELECT MAX(id),COUNT(*) FROM pricereview_main WHERE contractno = '$contractno' ORDER BY id DESC";
|
|
$result = mysqli_query($link, $sql);
|
|
$row = mysqli_fetch_row($result);
|
|
$maxContractID = $row[0];
|
|
$countContract = $row[1];
|
|
|
|
if ($data["status"] == "Y1") {
|
|
?>
|
|
<a href="pricereview-edit.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-primary btn-sm">修改</a>
|
|
<a href="pricereview-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-secondary btn-sm" onClick="return confirm('Are you sure you want to delete?')">刪除</a>
|
|
<?php
|
|
} elseif ($data["status"] == "YS") {
|
|
?>
|
|
<a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
|
|
<?php
|
|
} elseif ($data['status'] == 'YN' && $data['id'] == $maxContractID) {
|
|
?>
|
|
<a href="pricereview-create.php?vol_no=<?= $data['contractno'] ?>&id=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">重填價審</a>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
<a href="pricereview-check.php?id=<?php echo $data['id'] . "&" . $para; ?>" target="_blank" class="btn btn-warning btn-sm">檢視</a>
|
|
<?php
|
|
if ($user_id == "M0023") {
|
|
?>
|
|
<a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
$str = $uperson = $ustatus = $udtte = "";
|
|
if (!empty($sign1)) list($uperson, $ustatus, $udtte) = explode(",", $sign1);
|
|
// echo $sign1;
|
|
if ($ustatus) {
|
|
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
|
|
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
|
|
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
|
|
} else {
|
|
if ($ss_arr["sign_st"] == 1 && in_array($user_id, $ss_arr["sign_nt"]) && $data["status"] == "YS" || $user_id == 'TEST04') {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "待簽核";
|
|
$str = "<a href=\"pricereview-check.php?st=1&id=" . $data["id"] . "&" . $para . "\" target=\"_blank\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
|
|
} else $str = "--";
|
|
}
|
|
echo $str;
|
|
/*
|
|
if ($sign_st==1 && $sign_nt==$user_id) {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "<a href=\"pricereview-check.php?st=1&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
} else if ($sign_st > 1 || $data['last_check_result']) { // 過了這關或已完成流程
|
|
list($uperson, $ustatus, $udtte) = explode(",", $sign1);
|
|
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
|
|
else $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"拒絕\"></span>";
|
|
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte;
|
|
} else $str = "--";
|
|
*/
|
|
|
|
/*
|
|
if ($data["checker_1_result"] == "Y") {
|
|
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
|
|
} elseif ($data["checker_1_result"] == "N") {
|
|
$str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"拒絕\"></span>";
|
|
} else {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
}
|
|
if (!$oneself) {
|
|
$str = "<a href=\"pricereview-check.php?st=1&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_1"]."<br>".$data["checker_1_dt"];
|
|
} else {
|
|
if ($data["checker_1_result"]) {
|
|
$str = "<a class=\"btn btn-lg\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_1"]."<br>".$data["checker_1_dt"];
|
|
}
|
|
else $str = "--";
|
|
}*/
|
|
//echo $str;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
$str = $uperson = $ustatus = $udtte = "";
|
|
if (!empty($sign2)) {
|
|
$sign2_arr = explode("<##>", $sign2);
|
|
foreach ($sign2_arr as $v) {
|
|
list($uperson, $ustatus, $udtte) = explode(",", $v);
|
|
if ($ustatus == "Y" || $ustatus == "N") {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if ($ustatus) {
|
|
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
|
|
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
|
|
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
|
|
} else {
|
|
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 2) && (in_array($user_id, $ss_arr["sign_nt"])) || $user_id == 'TEST02') {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "待簽核";
|
|
$str = "<a href=\"pricereview-check.php?st=2&id=" . $data["id"] . "&" . $para . "\" target=\"_blank\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
|
|
} else $str = "--";
|
|
}
|
|
echo $str;
|
|
|
|
/*
|
|
if ($sign_st==2 && $sign_nt==$user_id) {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "<a href=\"pricereview-check.php?st=2&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
} else if ($sign_st > 2 || $data['last_check_result']) {
|
|
list($uperson, $ustatus, $udtte) = explode(",", $sign2);
|
|
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
|
|
else $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"拒絕\"></span>";
|
|
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte;
|
|
} else $str = "--";
|
|
*/
|
|
|
|
/*
|
|
if ($data["checker_2_result"] == "Y") {
|
|
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
|
|
} elseif ($data["checker_2_result"] == "N") {
|
|
$str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"拒絕\"></span>";
|
|
} else {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
}
|
|
if (!$oneself) {
|
|
$str = "<a href=\"pricereview-check.php?st=2&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_2"]."<br>".$data["checker_2_dt"];
|
|
} else {
|
|
if ($data["checker_2_result"]) {
|
|
$str = "<a class=\"btn btn-lg\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_2"]."<br>".$data["checker_2_dt"];
|
|
}
|
|
else $str = "--";
|
|
}
|
|
*/
|
|
//echo $str;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
$str = $uperson = $ustatus = $udtte = "";
|
|
|
|
if (!empty($sign3)) list($uperson, $ustatus, $udtte) = explode(",", $sign3);
|
|
if ($ustatus) {
|
|
if ($ustatus == "Y" || $ustatus == "YY") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
|
|
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
|
|
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
|
|
} else {
|
|
// if ($user_id == 'test03') {
|
|
|
|
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 3) && (in_array($user_id, $ss_arr["sign_nt"])) || $user_id == 'TEST03') {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "待簽核";
|
|
$str = "<a href=\"pricereview-check.php?st=3&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
|
|
} else $str = "--";
|
|
}
|
|
echo $str;
|
|
/*
|
|
$str = "";
|
|
if ($sign_st==3 && $sign_nt==$user_id) {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "<a href=\"pricereview-check.php?st=3&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
} else $str = "--";
|
|
*/
|
|
|
|
/*
|
|
if ($data["checker_3_result"] == "Y") {
|
|
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
|
|
} elseif ($data["checker_3_result"] == "N") {
|
|
$str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"拒絕\"></span>";
|
|
} else {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
}
|
|
if (!$oneself) {
|
|
$str = "<a href=\"pricereview-check.php?st=3&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_3"]."<br>".$data["checker_3_dt"];
|
|
} else {
|
|
if ($data["checker_3_result"]) {
|
|
$str = "<a class=\"btn btn-lg\">".$str."</a>";
|
|
$str .= "<br>".$data["checker_3"]."<br>".$data["checker_3_dt"];
|
|
}
|
|
else $str = "--";
|
|
}
|
|
*/
|
|
//echo $str;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
$str = $uperson = $ustatus = $udtte = "";
|
|
if (!empty($sign4)) list($uperson, $ustatus, $udtte) = explode(",", $sign4);
|
|
if ($ustatus) {
|
|
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
|
|
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
|
|
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
|
|
} else {
|
|
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 4) && (in_array($user_id, $ss_arr["sign_nt"])) || $user_id == 'TEST05') {
|
|
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
|
|
$str = "待簽核";
|
|
$str = "<a href=\"pricereview-check.php?st=4&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
|
|
} else $str = "--";
|
|
}
|
|
echo $str;
|
|
?>
|
|
</td>
|
|
<td><?php echo $status_arr[$data["status"]]; ?></td>
|
|
<!--<td>
|
|
<p>
|
|
<a href="pricereview-edit.php?id=<?php echo $data['id'] . "&" . $para; ?>" class="btn btn-info btn-sm">
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
</a>
|
|
</p>
|
|
</td>-->
|
|
<style>
|
|
.applybtn {
|
|
color: #fff;
|
|
background-color: #1484c4;
|
|
display: block;
|
|
border-radius: 4px;
|
|
padding: 4px 2px;
|
|
font-size: 13px;
|
|
|
|
}
|
|
|
|
.applybtn:hover {
|
|
background-color: #1494f9;
|
|
color: #fff;
|
|
}
|
|
</style>
|
|
<td>
|
|
<?php if (($data['status'] == 'YY' && $oneself) || ($data['status'] == 'YY' && ($user_id == "M0174" || $user_id == 'M0225' || $user_id === "M0107" || $user_id === "M0060" || $user_id === "M0175"))) : ?>
|
|
<?php if (($user_id === "M0107" || $user_id === "M0060") && $data['applystatus'] < 3) : ?>
|
|
<span style="font-size:13px;font-weight:600">待申請</span>
|
|
<?php elseif ($data['applystatus'] < 3) : ?>
|
|
<a class="applybtn" target="_blank" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">
|
|
<?php if ($data['applystatus'] < 1) {
|
|
echo "申請";
|
|
} else {
|
|
echo "檢視";
|
|
} ?>
|
|
</a><br>
|
|
<?php endif; ?>
|
|
<?php else : ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if ($data['status'] == 'YY' && ((($user_id == "M0060" || $user_id === "TEST03") && $data['applyprogress'] == 2) || (($user_id == "M0107" || $user_id == "M0175" || $user_id == "TEST02") && $data['applyprogress'] <= 1) || $user_id == "M0174" || $user_id == 'M0225') && $data['applystatus'] == 1) : ?>
|
|
<a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">待簽核</a><br>
|
|
<?php endif; ?>
|
|
<?php if ($data['status'] != 'YY') : ?>
|
|
<span style="font-size:13px;font-weight:600">--</span>
|
|
<?php endif; ?>
|
|
<!-- 工號M0107、M0174有所有權限 -->
|
|
<?php if (false && ($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060" || $user_id == "M0175" || $user_id === "TEST02")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
|
|
<a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載</a>
|
|
<?php endif; ?>
|
|
<?php if ($data['status'] === 'YY') : ?>
|
|
<a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載草稿</a>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php
|
|
|
|
else :
|
|
echo "<h2>There is no record!</h2>";
|
|
endif;
|
|
|
|
#代表結束連線
|
|
mysqli_close($link);
|
|
|
|
include "../footer.php";
|
|
?>
|