Browse Source

新梯價審按鈕新增

main
Cheng 1 year ago
parent
commit
1e182ce39e
  1. 42
      wms/mkt/pricereview-index.php

42
wms/mkt/pricereview-index.php

@ -1,6 +1,6 @@
<?php
include "../header.php";
require_once('../contract/conn.php');
// if($user_id == "M0107" || $user_id == "M0174" || $user_id == "M0225"){
// }else{
@ -64,7 +64,32 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) {
// print_r($inClause);
// echo '</pre>';
}
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%' ";
}
$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]) != 7) {
$id[] = $result['mid'];
}
}
$inClause = implode(',', $id);
}
$data = array();
// sql語法存在變數中
@ -82,7 +107,7 @@ if ($user_id == "M0060") {
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)) {
if (!empty($res_get) || !empty($_GET['check'])) {
$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
@ -228,7 +253,6 @@ function get_pending($token)
AND f.flow_id = m.flow_id
AND f.system_id = y.system_id
AND s.current_assigner = '$user_id'
AND f.flow_code != 'Z'
) t
GROUP BY t.system_id,
t.flow_id,
@ -236,7 +260,10 @@ function get_pending($token)
t.flow_name
LIMIT 0, 6
";
// echo '<pre>';
// print_r($sql);
// echo '</pre>';
// exit;
$res = mysqli_query($link, $sql);
@ -256,9 +283,8 @@ function get_pending($token)
}
$result = get_pending($token);
// echo '<pre>';
// print_r($result);
// echo '</pre>';
$result[1]['sid'] = !empty($result) ? $result[1]['sid'] : 'prm';
$result[1]['fid'] = !empty($result) ? $result[1]['fid'] : 'prm01';
if ($data) :
/*
@ -273,7 +299,9 @@ if ($data) :
?>
<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>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>

Loading…
Cancel
Save