Browse Source

暫時commit

gary
gary_chen\gary_chen 1 year ago
parent
commit
b7f073bfbf
  1. 93
      wms/board-create.php
  2. 3
      wms/board-record-submit.php
  3. 99
      wms/fun_global.php
  4. 74
      wms/sign/list.php
  5. 22
      wms/wipwhole-change-contractdate-function.php
  6. 2
      wms/wipwhole-change-contractdate.php
  7. 19
      wms/wipwhole-index-function.php
  8. 2
      wms/wipwhole-index.php
  9. 32
      wms/wipwhole-rec-invoice-edit-submit.php
  10. 18
      wms/wipwhole-renovate-index-function.php
  11. 2
      wms/wipwhole-renovate-rec-invoice-edit.php

93
wms/board-create.php

@ -1,14 +1,13 @@
<?php
include "header.php";
include "header.php";
?>
<script>
$(function(){
});
$(function() {});
</script>
<div class="container">
<?php
include "board-record-submit.php";
/*
<?php
include "board-record-submit.php";
/*
if($_SERVER["REQUEST_METHOD"] == "POST"){
if(empty($_POST["id"]) && empty($_POST["expert_id"]) && empty($_POST["personal_id"])){
echo "<p class='error'>Please fill up the required field!</p>";
@ -17,35 +16,65 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
}
}
*/
?>
?>
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="multipart/form-data">
<div>
<label for="title">主旨</label>
<input type="text" name="title" id="title" size="30" maxlength="25" required>
</div>
<!--<div>
<label for="pin">置頂</label>
<select name="pin" id="pin">
<option value="Y"></option>
<option value="N" selected></option>
</select>
</div>-->
<div>
<label for="attatch1">附件上傳</label>
<div>
<input type="file" name="attatch1" id="attatch1">
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
<div class='container'>
<div class='row'>
<div class='col-md-6 col-12'>
<label for="title">主旨</label>
<input type="text" name="title" id="title" size="30" maxlength="25" required>
</div>
<div class='col-md-6 col-12'>
<label for="attatch1">附件上傳</label>
<div>
<input type="file" name="attatch1" id="attatch1">
</div>
</div>
</div>
<div class='row'>
<div class='col-md-3 col-3'>
<label>連結名稱</label>
<input type="text" id="linkName">
</div>
<div class='col-md-9 col-6'>
<label>連結網址</label>
<input type="text" id="linkURL">
</div>
<div class='col-md-2 col-2'>
<button type='button' onclick="insertLink()">插入超連結</button>
</div>
</div>
<div class='row'>
<div class='col-md-12 col-12'>
<label for="content">公告內容</label><br>
<textarea class="form-control2" name="content" id="content" rows="8" cols="100" required></textarea>
</div>
</div>
<br />
<div class='row'>
<div class='col-md-12 col-12'>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<button type="submit" name="submit" id="submit">確定</button>
</div>
</div>
</div>
<div>
<label for="content">公告內容</label><br>
<textarea class="form-control2" name="content" id="content" rows="8" cols="100" required></textarea>
</div>
<div>
<button type="submit" name="submit" id="submit">確定</button>
</div>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>
</div>
<script>
function insertLink() {
var linkName = document.getElementById('linkName').value;
var linkURL = document.getElementById('linkURL').value;
if (linkName !== '' && linkURL !== '') {
var textarea = document.getElementById('content');
var link = '<a style="color:blue" href="' + linkURL + '">' + linkName + '</a>';
// 插入超連結到 textarea 中
textarea.value += link;
} else {
alert('請輸入連結名稱和 URL');
}
}
</script>
<?php include "footer.php"; ?>

3
wms/board-record-submit.php

@ -3,7 +3,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
//print_r($_POST);
//print_r($_FILES);exit;
foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v)));
// $$k = htmlspecialchars(stripslashes(trim($v)));
$$k = trim($v);
}
function get_basename($filename) {

99
wms/fun_global.php

@ -1,4 +1,5 @@
<?php
/**
* 組sql語法:限制可查詢範圍
* 系統管理員、總經理權限全開
@ -8,7 +9,8 @@
*
* @return string
*/
function sql_myself($user_id, $column="creater") {
function sql_myself($user_id, $column = "creater")
{
global $link;
$follower_arr = []; // 下屬列表
@ -36,7 +38,8 @@ function sql_myself($user_id, $column="creater") {
* @param array $ret:下屬ID
* @return array
*/
function find_follow($user_id, &$ret=[]) {
function find_follow($user_id, &$ret = [])
{
global $link;
$sql = "select accountid from account where manager = '$user_id'";
@ -56,7 +59,8 @@ function find_follow($user_id, &$ret=[]) {
* @param array $ret:上級主管ID
* @return array
*/
function manage_class($user_id, &$ret=[]) {
function manage_class($user_id, &$ret = [])
{
global $link;
$sql = "select manager from account where accountid = '$user_id'";
@ -79,7 +83,8 @@ function manage_class($user_id, &$ret=[]) {
* @return array
*
*/
function pricereview_class($rate, $user_id, &$ret=[]) {
function pricereview_class($rate, $user_id, &$ret = [])
{
global $link;
$sql = "select manager from account where accountid = '$user_id'";
@ -87,7 +92,7 @@ function pricereview_class($rate, $user_id, &$ret=[]) {
while ($row = mysqli_fetch_assoc($res)) {
if ($row["manager"] == "M0001") return; // 董事長略過
if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
$ret[1] = $row["manager"].",,";
$ret[1] = $row["manager"] . ",,";
pricereview_class($rate, $row["manager"], $ret);
} else {
$ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人)
@ -108,7 +113,8 @@ function pricereview_class($rate, $user_id, &$ret=[]) {
* @return array
*
*/
function pricereview_renovate_class($rate, $user_id, $renovate_flag) {
function pricereview_renovate_class($rate, $user_id, $renovate_flag)
{
global $link;
$sql = "select manager from account where accountid = '$user_id'";
@ -142,11 +148,20 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag) {
* @param string $token
* @return string
*/
function check_user_permission($user_id, $token) {
function check_user_permission($user_id, $token)
{
global $link;
// 不檢查清單
$ignore_url_arr = ['/wms/index.php', '/wms/notice-index.php', '/wms/notice-edit.php', '/wms/change-password.php', '/wms/wipwhole-change-contractdate.php', '/wms/wipwhole-change-planning-customer-name.php','/wms/test.php', '/wms/mkt/pricereview_mi-api.php'];
$ignore_url_arr = [
'/wms/index.php',
'/wms/notice-index.php',
'/wms/notice-edit.php',
'/wms/change-password.php',
'/wms/wipwhole-change-contractdate.php',
'/wms/wipwhole-change-planning-customer-name.php',
'/wms/test.php',
];
if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return;
$do = "";
@ -169,9 +184,12 @@ function check_user_permission($user_id, $token) {
mysqli_free_result($res);
if (!$do) {
echo "無權限操作,請洽管理員。";
exit;
echo "<script>alert('無權限操作,請洽管理員。');if (history.length==1) location.href='/wms/index.php?token=".$token."'; else history.go(-1);</script>";
// 判斷是否從藍凌過來
if (!empty($_GET['employee_no'])) {
echo "無權限操作,請洽管理員。";
exit;
}
echo "<script>alert('無權限操作,請洽管理員。');if (history.length==1) location.href='/wms/index.php?token=" . $token . "'; else history.go(-1);</script>";
} else return $do;
}
@ -179,7 +197,8 @@ function check_user_permission($user_id, $token) {
* 員工編號對應姓名表
* @return array
*/
function accountid2name() {
function accountid2name()
{
global $link;
$arr = [];
@ -198,7 +217,8 @@ function accountid2name() {
* @param array $uid 員工編號
* @return array
*/
function accountid2email($uid) {
function accountid2email($uid)
{
global $link;
if (is_array($uid)) $accountid = implode("','", $uid);
@ -224,7 +244,8 @@ function accountid2email($uid) {
* @param string|array $user_id:下位簽核者
* @param string $seq:順序
*/
function do_assign($flow_id, $id, $content, $user_id, $seq=0) {
function do_assign($flow_id, $id, $content, $user_id, $seq = 0)
{
global $link;
$tds = date("Y-m-d H:i:s");
@ -279,7 +300,8 @@ function do_assign($flow_id, $id, $content, $user_id, $seq=0) {
* @param string $id:價審單序號
* @param string $content:卷號
*/
function end_flow($system_id, $flow_id, $id, $content) {
function end_flow($system_id, $flow_id, $id, $content)
{
global $link;
$tds = date("Y-m-d H:i:s");
@ -297,7 +319,7 @@ function end_flow($system_id, $flow_id, $id, $content) {
$sql = "select ekind, person from pricereview_main where id = '$id'";
$res = mysqli_query($link, $sql);
if ($row = mysqli_fetch_row($res)) {
$content = $row[0]."價格審查結案通知 > ".$content;
$content = $row[0] . "價格審查結案通知 > " . $content;
$kind = ($row[0] == "新梯") ? 3 : 4;
$sql2 = "insert into notice (kind, related_id, title, permission, creater, create_at) values (";
$sql2 .= "'$kind', '$id', '$content', '$row[1]', 'system', '$tds')";
@ -388,7 +410,7 @@ function postCheck($post_val, $default_val = null)
*/
function do_wws2_assign($user_id, $form_id, $flow_code)
{
global $link;
$tds = date("Y-m-d H:i:s");
$sql = "select appwms.nextval('form_key') form_key";
@ -493,47 +515,50 @@ function accountidToRoleName($accountid)
* @param array $arr:[電梯種類,人乘/載重,停數,開門方式,速度]
* @return string 規格名,載重
*/
function facility_spec($arr) {
function facility_spec($arr)
{
if (empty($arr)) return;
list($kind, $seat, $stop, $op, $speed) = $arr;
if (strlen($speed) == 1) $speed = str_pad($speed, 2, "0", STR_PAD_LEFT);
$seat2weight_arr = ["A3" => 320, "A8" => 320, "G10" => 320, "G20" => 320, "G5" => 320, "G6" => 320,
"280-1-A" => 280, "280-1-L" => 280, "280-2-A" => 280, "280-2-L" => 280,
"320-1-A" => 320, "320-1-L" => 320, "320-2-A" => 320, "320-2-L" => 320,
"6" => 450, "8" => 550, "9" => 600, "10" => 700, "11" => 750, "12" => 800,
"13" => 900, "15" => 1000, "17" => 1150, "20" => 1350, "24" => 1600];
$seat2weight_arr = [
"A3" => 320, "A8" => 320, "G10" => 320, "G20" => 320, "G5" => 320, "G6" => 320,
"280-1-A" => 280, "280-1-L" => 280, "280-2-A" => 280, "280-2-L" => 280,
"320-1-A" => 320, "320-1-L" => 320, "320-2-A" => 320, "320-2-L" => 320,
"6" => 450, "8" => 550, "9" => 600, "10" => 700, "11" => 750, "12" => 800,
"13" => 900, "15" => 1000, "17" => 1150, "20" => 1350, "24" => 1600
];
switch ($kind) {
case "MAQ100":
$weight = $seat2weight_arr[$seat];
$ret = $kind."-".$weight."-".$stop."-".$op.$speed;
$ret = $kind . "-" . $weight . "-" . $stop . "-" . $op . $speed;
break;
case "MAP100":
$weight = $seat2weight_arr[$seat];
$ret = $kind."-".$weight."*".$stop."-".$op.$speed;
$ret = $kind . "-" . $weight . "*" . $stop . "-" . $op . $speed;
break;
case "MAM200":
case "MAH100":
$weight = $seat2weight_arr[$seat];
$ret = $kind."-".$seat."*".$stop."-".$op.$speed;
$ret = $kind . "-" . $seat . "*" . $stop . "-" . $op . $speed;
break;
case "MAF100":
$weight = $seat;
$ret = $kind."-".$seat."*".$stop."-".$op.$speed;
$ret = $kind . "-" . $seat . "*" . $stop . "-" . $op . $speed;
break;
case "MAE100":
$weight = $seat2weight_arr[$seat];
$ret = $kind."-".$seat."*".$stop."-".$op.$speed;
$ret = $kind . "-" . $seat . "*" . $stop . "-" . $op . $speed;
break;
case "M1+M4(2:1)":
case "M1+M4(1:1)":
case "M1":
$weight = $seat2weight_arr[$seat];
$ret = "P".$seat."-".$seat2weight_arr[$seat]."-".$op."-".$speed."-".$stop;
$ret = "P" . $seat . "-" . $seat2weight_arr[$seat] . "-" . $op . "-" . $speed . "-" . $stop;
break;
default:
$weight = $ret = "";
}
return $ret.",".$weight;
return $ret . "," . $weight;
}
/**
@ -541,7 +566,8 @@ function facility_spec($arr) {
* @param array $arr:[簽核人1,簽核人2,簽核人3,簽核人4]
* @return array 進度,下位審批人
*/
function sign_status($arr) {
function sign_status($arr)
{
$ret = [];
foreach ($arr as $k => $sign) {
$sign_nos = 0;
@ -554,7 +580,7 @@ function sign_status($arr) {
}
}
if (count($sign_arr) == $sign_nos) {
$ret["sign_st"] = $k+1;
$ret["sign_st"] = $k + 1;
$ret["sign_nt"] = $sign_nt_arr;
return $ret;
}
@ -566,9 +592,10 @@ function sign_status($arr) {
return $ret;
}
function getAccounttype($link,$user_id){
$sql = "SELECT * FROM account where accountid = '$user_id'";
$data = mysqli_query($link, $sql);
function getAccounttype($link, $user_id)
{
$sql = "SELECT * FROM account where accountid = '$user_id'";
$data = mysqli_query($link, $sql);
$row = mysqli_fetch_array($data, MYSQLI_ASSOC);
return $row['accounttype'];
}
}

74
wms/sign/list.php

@ -27,12 +27,44 @@ function getWipwholestatusDataByFormkey($link, $form_key, $flow_id)
*
FROM wipwholestatus
WHERE id = '" . $row['form_id'] . "'
ANd status = '1'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
return $row;
}
function getwipwholeChangeContractdateDetailsDataByFormkey($link, $form_key, $flow_id)
{
$sql = "
SELECT
form_id
FROM flow
WHERE form_key = '$form_key'
AND system_id = 'wws'
AND flow_id = '$flow_id'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$sql = "
SELECT
wipwholestatus_id
FROM wipwhole_change_contractdate_details
WHERE id = '" . $row['form_id'] . "'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$sql = "
SELECT
*
FROM wipwholestatus
WHERE id = '" . $row['wipwholestatus_id'] . "'
ANd status = '1'
";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
return $row;
}
$system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id'];
$where_system_id = " and a.system_id like '" . $system_id . "%'";
@ -40,15 +72,28 @@ $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
$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
";
@ -173,7 +218,7 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
<tr>
<td>
<?php
if ($data['system_name'] == '作番大日程系統') {
if (in_array($data['flow_name'], ['作番大日程(新梯)流程', '作番大日程(汰改)流程'])) {
$w_data = getWipwholestatusDataByFormkey($link, $data['form_key'], $data['flow_id']);
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
@ -182,6 +227,15 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
} else if (in_array($data['flow_name'], ['預計出貨日調整申請流程'])) {
$w_data = getwipwholeChangeContractdateDetailsDataByFormkey($link, $data['form_key'], $data['flow_id']);
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
} else {
?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">

22
wms/wipwhole-change-contractdate-function.php

@ -436,6 +436,7 @@ function getShengguanokOptions($link)
FROM `account`
WHERE `department_id` IN ('250')
AND `role_id` IN ('1','4')
ORDER BY accountid DESC
";
return mysqli_query($link, $sql);
}
@ -598,16 +599,17 @@ function getAssignStatusSelect($link, $user_id, $nowFormStatus)
} else {
$options_str .= "<option value='B'>提出申請</option>";
}
}
if (in_array(checkNowFormStatus($link), ['A', 'D'])) {
if (accountidToDepartId($user_id) == "250" && in_array(accountidToRoleId($user_id), ["1", "4"]))
$options_str .= "<option value='Z'>通過</option>";
$options_str .= "<option value='C'>取消</option>";
}
if (checkNowFormStatus($link) == 'B') {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545']))
$options_str .= "<option value='D'>通過</option>";
$options_str .= "<option value='C'>取消</option>";
}else{
if (in_array(checkNowFormStatus($link), ['A', 'D'])) {
if (accountidToDepartId($user_id) == "250" && in_array(accountidToRoleId($user_id), ["1", "4"]))
$options_str .= "<option value='Z'>通過</option>";
$options_str .= "<option value='C'>取消</option>";
}
if (checkNowFormStatus($link) == 'B') {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545']))
$options_str .= "<option value='D'>通過</option>";
$options_str .= "<option value='C'>取消</option>";
}
}
$options_str .= "</select>";
return $options_str;

2
wms/wipwhole-change-contractdate.php

@ -340,7 +340,7 @@ if (!empty(checkNowFormStatus($link)))
</select>
";
} else if (checkNowFormStatus($link) == 'B') {
if (getDepartmentId($link, $user_id) == '521' || getDepartmentId($link, $user_id) == '531') {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545'])){
echo "<select name='next_users' id='next_users'>";
foreach ($shengguanok_options as $shengguanok_option) :
echo "

19
wms/wipwhole-index-function.php

@ -11,6 +11,7 @@ function getWipwholestatusDetail($link, $id)
$db_query = "
SELECT * FROM
wipwholestatus WHERE id = '$id'
AND status = '1'
";
$receivabledata = mysqli_query($link, $db_query);
return mysqli_fetch_array($receivabledata, MYSQLI_ASSOC);
@ -146,6 +147,10 @@ function getDataSql($department_id, $role_id, $user_id)
if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$sql_cmd = sql_myself($user_id, "salesid");
$sql = "
@ -196,7 +201,7 @@ function getDataSql($department_id, $role_id, $user_id)
";
return $sql;
}
if ($department_id == '314' && (in_array($role_id, ['2']))) {
if ($department_id == '314' && (in_array($role_id, ['1', '2']))) {
$sql = "
SELECT * FROM wipwholestatus
WHERE 1=1
@ -314,7 +319,10 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$flow_code_tmp = explode(',', $flow_code);
$flow_code = implode("','", $flow_code_tmp);
@ -836,7 +844,8 @@ function getYewuStatus($link, $user_department_id, $role_id)
// 取得工務的欄位權限
function getWarehouseStatus($link, $user_department_id, $role_id, $status)
{
if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
// if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
if(getSaveEstimateInstallData($user_department_id, $role_id)){
if ($status == 1) {
return checkNowFormGStatus($link) == 'G' ? "" : "disabled";
} else {
@ -1161,7 +1170,7 @@ function saveInstallData($user_department_id, $role_id)
return true;
if ($user_department_id == '543' && $role_id == '2')
return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '6']))
if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6']))
return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true;
@ -1210,4 +1219,4 @@ function getAllCustomerPlanningVerify($link, $id)
AND customer_planning_verify_file IS NOT NULL
";
return mysqli_query($link, $sql);
}
}

2
wms/wipwhole-index.php

@ -247,7 +247,7 @@ $dataZ = mysqli_query($link, $sql);
<div class="modal-content">
<button type="button" class="close" id="myCloseBtn">X</button>
<div class='col-12' style='text-align:center'>
qwe
</div>
</div>
</div>

32
wms/wipwhole-rec-invoice-edit-submit.php

@ -652,22 +652,22 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'assign_form') {
foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v)));
}
$id = empty($_POST['id']) ? null : $_POST['id'];
// 檢查簽核狀態
if (checkWwsAssianStatus($link, $user_id, $id)) {
echo "<script type ='text/JavaScript'>";
echo "alert('此表單已進入下個階段');";
echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>";
} else {
echo "<script type ='text/JavaScript'>";
echo "alert('此表單某些確認項未確認');";
echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>";
}
// foreach ($_POST as $k => $v) {
// $$k = htmlspecialchars(stripslashes(trim($v)));
// }
// $id = empty($_POST['id']) ? null : $_POST['id'];
// // 檢查簽核狀態
// if (checkWwsAssianStatus($link, $user_id, $id)) {
// echo "<script type ='text/JavaScript'>";
// echo "alert('此表單已進入下個階段');";
// echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
// echo "</script>";
// } else {
// echo "<script type ='text/JavaScript'>";
// echo "alert('此表單某些確認項未確認');";
// echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
// echo "</script>";
// }
}
}

18
wms/wipwhole-renovate-index-function.php

@ -386,6 +386,10 @@ function getDataSql($department_id, $role_id, $user_id)
if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$contract_type = 'B';
// 營業員主管或營業員
@ -443,7 +447,7 @@ function getDataSql($department_id, $role_id, $user_id)
";
return $sql;
}
if ($department_id == '314' && (in_array($role_id, ['2']))) {
if ($department_id == '314' && (in_array($role_id, ['1', '2']))) {
$sql = "
SELECT * FROM wipwholestatus
WHERE 1=1
@ -561,6 +565,10 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$contract_type = 'B';
// 營業員主管或營業員
@ -825,7 +833,8 @@ function getWarehouseStatus($link, $user_department_id, $role_id, $status)
{
if ($user_department_id == 220)
return "";
if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
// if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
if(getSaveEstimateInstallData($user_department_id, $role_id)){
if ($status == 1) {
return checkNowFormStatus($link) == 'A' ? "" : "disabled";
} else {
@ -834,6 +843,7 @@ function getWarehouseStatus($link, $user_department_id, $role_id, $status)
}
return "disabled";
}
function getMarketingStatus($link, $user_department_id, $role_id, $status)
{
if ($user_department_id == 220)
@ -1092,7 +1102,7 @@ function getSaveInstallDataButtonStatus($user_department_id, $role_id)
return true;
if ($user_department_id == '543' && $role_id == '2')
return true;
if ($user_department_id == '544' && in_array($role_id, ['3', '6']))
if ($user_department_id == '544' && in_array($role_id, ['3', '4', '6']))
return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true;
@ -1139,4 +1149,4 @@ function getAllCustomerPlanningVerify($link, $id)
AND customer_planning_verify_file IS NOT NULL
";
return mysqli_query($link, $sql);
}
}

2
wms/wipwhole-renovate-rec-invoice-edit.php

@ -690,7 +690,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control" type="date" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<input class="form-control disabled_select" type="date" id="delivery_date" name="delivery_date" value="<?= $row['delivery_date']; ?>" <?= $marketing2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span>

Loading…
Cancel
Save