Browse Source

暫時commit

gary
gary_chen\gary_chen 1 year ago
parent
commit
b7f073bfbf
  1. 57
      wms/board-create.php
  2. 3
      wms/board-record-submit.php
  3. 59
      wms/fun_global.php
  4. 64
      wms/sign/list.php
  5. 4
      wms/wipwhole-change-contractdate-function.php
  6. 2
      wms/wipwhole-change-contractdate.php
  7. 17
      wms/wipwhole-index-function.php
  8. 2
      wms/wipwhole-index.php
  9. 32
      wms/wipwhole-rec-invoice-edit-submit.php
  10. 16
      wms/wipwhole-renovate-index-function.php
  11. 2
      wms/wipwhole-renovate-rec-invoice-edit.php

57
wms/board-create.php

@ -2,8 +2,7 @@
include "header.php"; include "header.php";
?> ?>
<script> <script>
$(function(){ $(function() {});
});
</script> </script>
<div class="container"> <div class="container">
<?php <?php
@ -20,32 +19,62 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
?> ?>
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"> <form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
<div> <div class='container'>
<div class='row'>
<div class='col-md-6 col-12'>
<label for="title">主旨</label> <label for="title">主旨</label>
<input type="text" name="title" id="title" size="30" maxlength="25" required> <input type="text" name="title" id="title" size="30" maxlength="25" required>
</div> </div>
<!--<div> <div class='col-md-6 col-12'>
<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> <label for="attatch1">附件上傳</label>
<div> <div>
<input type="file" name="attatch1" id="attatch1"> <input type="file" name="attatch1" id="attatch1">
</div> </div>
</div> </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> <label for="content">公告內容</label><br>
<textarea class="form-control2" name="content" id="content" rows="8" cols="100" required></textarea> <textarea class="form-control2" name="content" id="content" rows="8" cols="100" required></textarea>
</div> </div>
<div>
<button type="submit" name="submit" id="submit">確定</button>
</div> </div>
<br />
<div class='row'>
<div class='col-md-12 col-12'>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
<button type="submit" name="submit" id="submit">確定</button>
</div>
</div>
</form> </form>
</div> </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"; ?> <?php include "footer.php"; ?>

3
wms/board-record-submit.php

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

59
wms/fun_global.php

@ -1,4 +1,5 @@
<?php <?php
/** /**
* 組sql語法:限制可查詢範圍 * 組sql語法:限制可查詢範圍
* 系統管理員、總經理權限全開 * 系統管理員、總經理權限全開
@ -8,7 +9,8 @@
* *
* @return string * @return string
*/ */
function sql_myself($user_id, $column="creater") { function sql_myself($user_id, $column = "creater")
{
global $link; global $link;
$follower_arr = []; // 下屬列表 $follower_arr = []; // 下屬列表
@ -36,7 +38,8 @@ function sql_myself($user_id, $column="creater") {
* @param array $ret:下屬ID * @param array $ret:下屬ID
* @return array * @return array
*/ */
function find_follow($user_id, &$ret=[]) { function find_follow($user_id, &$ret = [])
{
global $link; global $link;
$sql = "select accountid from account where manager = '$user_id'"; $sql = "select accountid from account where manager = '$user_id'";
@ -56,7 +59,8 @@ function find_follow($user_id, &$ret=[]) {
* @param array $ret:上級主管ID * @param array $ret:上級主管ID
* @return array * @return array
*/ */
function manage_class($user_id, &$ret=[]) { function manage_class($user_id, &$ret = [])
{
global $link; global $link;
$sql = "select manager from account where accountid = '$user_id'"; $sql = "select manager from account where accountid = '$user_id'";
@ -79,7 +83,8 @@ function manage_class($user_id, &$ret=[]) {
* @return array * @return array
* *
*/ */
function pricereview_class($rate, $user_id, &$ret=[]) { function pricereview_class($rate, $user_id, &$ret = [])
{
global $link; global $link;
$sql = "select manager from account where accountid = '$user_id'"; $sql = "select manager from account where accountid = '$user_id'";
@ -108,7 +113,8 @@ function pricereview_class($rate, $user_id, &$ret=[]) {
* @return array * @return array
* *
*/ */
function pricereview_renovate_class($rate, $user_id, $renovate_flag) { function pricereview_renovate_class($rate, $user_id, $renovate_flag)
{
global $link; global $link;
$sql = "select manager from account where accountid = '$user_id'"; $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 * @param string $token
* @return string * @return string
*/ */
function check_user_permission($user_id, $token) { function check_user_permission($user_id, $token)
{
global $link; 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; if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return;
$do = ""; $do = "";
@ -169,8 +184,11 @@ function check_user_permission($user_id, $token) {
mysqli_free_result($res); mysqli_free_result($res);
if (!$do) { if (!$do) {
// 判斷是否從藍凌過來
if (!empty($_GET['employee_no'])) {
echo "無權限操作,請洽管理員。"; echo "無權限操作,請洽管理員。";
exit; exit;
}
echo "<script>alert('無權限操作,請洽管理員。');if (history.length==1) location.href='/wms/index.php?token=" . $token . "'; else history.go(-1);</script>"; echo "<script>alert('無權限操作,請洽管理員。');if (history.length==1) location.href='/wms/index.php?token=" . $token . "'; else history.go(-1);</script>";
} else return $do; } else return $do;
} }
@ -179,7 +197,8 @@ function check_user_permission($user_id, $token) {
* 員工編號對應姓名表 * 員工編號對應姓名表
* @return array * @return array
*/ */
function accountid2name() { function accountid2name()
{
global $link; global $link;
$arr = []; $arr = [];
@ -198,7 +217,8 @@ function accountid2name() {
* @param array $uid 員工編號 * @param array $uid 員工編號
* @return array * @return array
*/ */
function accountid2email($uid) { function accountid2email($uid)
{
global $link; global $link;
if (is_array($uid)) $accountid = implode("','", $uid); if (is_array($uid)) $accountid = implode("','", $uid);
@ -224,7 +244,8 @@ function accountid2email($uid) {
* @param string|array $user_id:下位簽核者 * @param string|array $user_id:下位簽核者
* @param string $seq:順序 * @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; global $link;
$tds = date("Y-m-d H:i:s"); $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 $id:價審單序號
* @param string $content:卷號 * @param string $content:卷號
*/ */
function end_flow($system_id, $flow_id, $id, $content) { function end_flow($system_id, $flow_id, $id, $content)
{
global $link; global $link;
$tds = date("Y-m-d H:i:s"); $tds = date("Y-m-d H:i:s");
@ -493,15 +515,18 @@ function accountidToRoleName($accountid)
* @param array $arr:[電梯種類,人乘/載重,停數,開門方式,速度] * @param array $arr:[電梯種類,人乘/載重,停數,開門方式,速度]
* @return string 規格名,載重 * @return string 規格名,載重
*/ */
function facility_spec($arr) { function facility_spec($arr)
{
if (empty($arr)) return; if (empty($arr)) return;
list($kind, $seat, $stop, $op, $speed) = $arr; list($kind, $seat, $stop, $op, $speed) = $arr;
if (strlen($speed) == 1) $speed = str_pad($speed, 2, "0", STR_PAD_LEFT); 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, $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, "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, "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, "6" => 450, "8" => 550, "9" => 600, "10" => 700, "11" => 750, "12" => 800,
"13" => 900, "15" => 1000, "17" => 1150, "20" => 1350, "24" => 1600]; "13" => 900, "15" => 1000, "17" => 1150, "20" => 1350, "24" => 1600
];
switch ($kind) { switch ($kind) {
case "MAQ100": case "MAQ100":
$weight = $seat2weight_arr[$seat]; $weight = $seat2weight_arr[$seat];
@ -541,7 +566,8 @@ function facility_spec($arr) {
* @param array $arr:[簽核人1,簽核人2,簽核人3,簽核人4] * @param array $arr:[簽核人1,簽核人2,簽核人3,簽核人4]
* @return array 進度,下位審批人 * @return array 進度,下位審批人
*/ */
function sign_status($arr) { function sign_status($arr)
{
$ret = []; $ret = [];
foreach ($arr as $k => $sign) { foreach ($arr as $k => $sign) {
$sign_nos = 0; $sign_nos = 0;
@ -566,7 +592,8 @@ function sign_status($arr) {
return $ret; return $ret;
} }
function getAccounttype($link,$user_id){ function getAccounttype($link, $user_id)
{
$sql = "SELECT * FROM account where accountid = '$user_id'"; $sql = "SELECT * FROM account where accountid = '$user_id'";
$data = mysqli_query($link, $sql); $data = mysqli_query($link, $sql);
$row = mysqli_fetch_array($data, MYSQLI_ASSOC); $row = mysqli_fetch_array($data, MYSQLI_ASSOC);

64
wms/sign/list.php

@ -27,12 +27,44 @@ function getWipwholestatusDataByFormkey($link, $form_key, $flow_id)
* *
FROM wipwholestatus FROM wipwholestatus
WHERE id = '" . $row['form_id'] . "' WHERE id = '" . $row['form_id'] . "'
ANd status = '1'
"; ";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result); $row = mysqli_fetch_assoc($result);
return $row; 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']; $system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id'];
$where_system_id = " and a.system_id like '" . $system_id . "%'"; $where_system_id = " and a.system_id like '" . $system_id . "%'";
@ -40,10 +72,23 @@ $where_system_id = " and a.system_id like '" . $system_id . "%'";
$flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id']; $flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id'];
$where_flow_id = " and b.flow_id like '" . $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, $sql_get = "
concat(c.current_assigner ,'-',f_return_name(c.current_assigner)) current_assigner_name , select
flow_name,c.update_date ,c.create_date,b.path,d.flow_code from system_main a,flow_main b ,subflow c.form_key,
c,flow d 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 where a.system_id=b.system_id
and b.flow_id=d.flow_id and b.flow_id=d.flow_id
and c.current_assigner='$user_id' and c.current_assigner='$user_id'
@ -173,7 +218,7 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
<tr> <tr>
<td> <td>
<?php <?php
if ($data['system_name'] == '作番大日程系統') { if (in_array($data['flow_name'], ['作番大日程(新梯)流程', '作番大日程(汰改)流程'])) {
$w_data = getWipwholestatusDataByFormkey($link, $data['form_key'], $data['flow_id']); $w_data = getWipwholestatusDataByFormkey($link, $data['form_key'], $data['flow_id']);
$facilityno = $w_data['facilityno']; $facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno']; $contractno = $w_data['contractno'];
@ -182,6 +227,15 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?> 作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a> </a>
<?php <?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 { } else {
?> ?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>"> <a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">

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

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

2
wms/wipwhole-change-contractdate.php

@ -340,7 +340,7 @@ if (!empty(checkNowFormStatus($link)))
</select> </select>
"; ";
} else if (checkNowFormStatus($link) == 'B') { } 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'>"; echo "<select name='next_users' id='next_users'>";
foreach ($shengguanok_options as $shengguanok_option) : foreach ($shengguanok_options as $shengguanok_option) :
echo " echo "

17
wms/wipwhole-index-function.php

@ -11,6 +11,7 @@ function getWipwholestatusDetail($link, $id)
$db_query = " $db_query = "
SELECT * FROM SELECT * FROM
wipwholestatus WHERE id = '$id' wipwholestatus WHERE id = '$id'
AND status = '1'
"; ";
$receivabledata = mysqli_query($link, $db_query); $receivabledata = mysqli_query($link, $db_query);
return mysqli_fetch_array($receivabledata, MYSQLI_ASSOC); 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'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$sql_cmd = sql_myself($user_id, "salesid"); $sql_cmd = sql_myself($user_id, "salesid");
$sql = " $sql = "
@ -196,7 +201,7 @@ function getDataSql($department_id, $role_id, $user_id)
"; ";
return $sql; return $sql;
} }
if ($department_id == '314' && (in_array($role_id, ['2']))) { if ($department_id == '314' && (in_array($role_id, ['1', '2']))) {
$sql = " $sql = "
SELECT * FROM wipwholestatus SELECT * FROM wipwholestatus
WHERE 1=1 WHERE 1=1
@ -314,7 +319,10 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code)
if (in_array($user_id, ['M0166', 'M0091'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$flow_code_tmp = explode(',', $flow_code); $flow_code_tmp = explode(',', $flow_code);
$flow_code = implode("','", $flow_code_tmp); $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) 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) { if ($status == 1) {
return checkNowFormGStatus($link) == 'G' ? "" : "disabled"; return checkNowFormGStatus($link) == 'G' ? "" : "disabled";
} else { } else {
@ -1161,7 +1170,7 @@ function saveInstallData($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; 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; return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6'])) if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true; return true;

2
wms/wipwhole-index.php

@ -247,7 +247,7 @@ $dataZ = mysqli_query($link, $sql);
<div class="modal-content"> <div class="modal-content">
<button type="button" class="close" id="myCloseBtn">X</button> <button type="button" class="close" id="myCloseBtn">X</button>
<div class='col-12' style='text-align:center'> <div class='col-12' style='text-align:center'>
qwe
</div> </div>
</div> </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 ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST['form_name'] == 'assign_form') { if ($_POST['form_name'] == 'assign_form') {
foreach ($_POST as $k => $v) { // foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v))); // $$k = htmlspecialchars(stripslashes(trim($v)));
} // }
$id = empty($_POST['id']) ? null : $_POST['id']; // $id = empty($_POST['id']) ? null : $_POST['id'];
// 檢查簽核狀態 // // 檢查簽核狀態
if (checkWwsAssianStatus($link, $user_id, $id)) { // if (checkWwsAssianStatus($link, $user_id, $id)) {
echo "<script type ='text/JavaScript'>"; // echo "<script type ='text/JavaScript'>";
echo "alert('此表單已進入下個階段');"; // echo "alert('此表單已進入下個階段');";
echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';"; // echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>"; // echo "</script>";
} else { // } else {
echo "<script type ='text/JavaScript'>"; // echo "<script type ='text/JavaScript'>";
echo "alert('此表單某些確認項未確認');"; // echo "alert('此表單某些確認項未確認');";
echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';"; // echo "location.href='wipwhole-rec-invoice-edit.php?function_name=pricereview&id=$id&" . $token_link . "';";
echo "</script>"; // echo "</script>";
} // }
} }
} }

16
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'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$contract_type = 'B'; $contract_type = 'B';
// 營業員主管或營業員 // 營業員主管或營業員
@ -443,7 +447,7 @@ function getDataSql($department_id, $role_id, $user_id)
"; ";
return $sql; return $sql;
} }
if ($department_id == '314' && (in_array($role_id, ['2']))) { if ($department_id == '314' && (in_array($role_id, ['1', '2']))) {
$sql = " $sql = "
SELECT * FROM wipwholestatus SELECT * FROM wipwholestatus
WHERE 1=1 WHERE 1=1
@ -561,6 +565,10 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code)
if (in_array($user_id, ['M0166', 'M0091'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113';
}
$contract_type = 'B'; $contract_type = 'B';
// 營業員主管或營業員 // 營業員主管或營業員
@ -825,7 +833,8 @@ function getWarehouseStatus($link, $user_department_id, $role_id, $status)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; 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) { if ($status == 1) {
return checkNowFormStatus($link) == 'A' ? "" : "disabled"; return checkNowFormStatus($link) == 'A' ? "" : "disabled";
} else { } else {
@ -834,6 +843,7 @@ function getWarehouseStatus($link, $user_department_id, $role_id, $status)
} }
return "disabled"; return "disabled";
} }
function getMarketingStatus($link, $user_department_id, $role_id, $status) function getMarketingStatus($link, $user_department_id, $role_id, $status)
{ {
if ($user_department_id == 220) if ($user_department_id == 220)
@ -1092,7 +1102,7 @@ function getSaveInstallDataButtonStatus($user_department_id, $role_id)
return true; return true;
if ($user_department_id == '543' && $role_id == '2') if ($user_department_id == '543' && $role_id == '2')
return true; 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; return true;
if ($user_department_id == '545' && in_array($role_id, ['3', '6'])) if ($user_department_id == '545' && in_array($role_id, ['3', '6']))
return true; return true;

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">移交日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <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"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#delivery_date").val("");' <?= $marketing2; ?>>清除</button>
</span> </span>

Loading…
Cancel
Save