diff --git a/wms/wipwhole-index-function.php b/wms/wipwhole-index-function.php index 81804787..2c895426 100644 --- a/wms/wipwhole-index-function.php +++ b/wms/wipwhole-index-function.php @@ -5,6 +5,7 @@ function getWipwholestatusData($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); @@ -125,11 +126,16 @@ function getDataSql($department_id, $role_id, $user_id) '511', '512', '513', '514' ]; + // 補丁 黃孟澤 & 葉博澄 權限 = 李烘銘 + if(in_array($user_id,['M0166','M0091'])){ + $user_id = 'M0086'; + } + $sql_cmd = sql_myself($user_id, "salesid"); $sql = " SELECT * FROM wipwholestatus $sql_cmd "; - $sql .= empty($sql_cmd) ? " WHERE 1=1 AND contract_type = '$contract_type' " : " AND contract_type = '$contract_type'"; + $sql .= empty($sql_cmd) ? " WHERE 1=1 AND status = '1' AND contract_type = '$contract_type' " : " AND status = '1' AND contract_type = '$contract_type'"; $sql .= getWipwholeSearchSql(); $sql .= "ORDER BY real_contract_arrival_date DESC "; @@ -145,6 +151,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -155,6 +162,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -165,6 +173,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -175,6 +184,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -185,6 +195,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -206,6 +217,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -217,6 +229,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " AND SUBSTR(address,1,2) in ('宜蘭') @@ -229,6 +242,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " AND SUBSTR(address,1,2) in ('臺北','台北','基隆','新北','桃園','新竹') @@ -241,6 +255,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " AND SUBSTR(address,1,2) in ('南投','臺中','台中','彰化','雲林','苗栗') @@ -253,6 +268,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " AND SUBSTR(address,1,2) in ('台南','臺南','嘉義','屏東','高雄') @@ -265,6 +281,7 @@ function getDataSql($department_id, $role_id, $user_id) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date DESC @@ -276,6 +293,13 @@ function getDataSql($department_id, $role_id, $user_id) function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) { + + // 補丁 黃孟澤 & 葉博澄 權限 = 李烘銘 + if(in_array($user_id,['M0166','M0091'])){ + $user_id = 'M0086'; + } + + $flow_code_tmp = explode(',', $flow_code); $flow_code = implode("','", $flow_code_tmp); // 合約類型 @@ -293,6 +317,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -303,6 +328,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -313,6 +339,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -323,6 +350,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -333,6 +361,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' " . getWipwholeSearchSql() . " ORDER BY real_contract_arrival_date ASC @@ -345,6 +374,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) "; $sql .= empty($sql_cmd) ? " WHERE 1=1 AND contract_type = '$contract_type' " : " AND contract_type = '$contract_type'"; $sql .= " + AND status = '1' AND id IN ( SELECT form_id AS id @@ -372,6 +402,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND contract_type = '$contract_type' AND id IN ( SELECT @@ -392,6 +423,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id IN ( SELECT form_id AS id @@ -412,6 +444,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id IN ( SELECT form_id AS id @@ -432,6 +465,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id IN ( SELECT form_id AS id @@ -452,6 +486,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id IN ( SELECT form_id AS id @@ -472,6 +507,7 @@ function getDataSqlByFlowCode($department_id, $role_id, $user_id, $flow_code) $sql = " SELECT * FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id IN ( SELECT form_id AS id @@ -568,6 +604,7 @@ function checkYingYeok($link, $id) ) AS sum_num FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id = '$id' "; $result = mysqli_query($link, $sql); @@ -588,6 +625,7 @@ function checkSheJiok($link, $id) ) AS sum_num FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id = '$id' "; $result = mysqli_query($link, $sql); @@ -605,6 +643,7 @@ function checkSheJiokLeader($link, $id) ) AS sum_num FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id = '$id' "; $result = mysqli_query($link, $sql); @@ -622,6 +661,7 @@ function checkGongWuok($link, $id) ) AS sum_num FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id = '$id' "; $result = mysqli_query($link, $sql); @@ -645,6 +685,7 @@ function checkShengGuanok($link, $id) ) AS sum_num FROM wipwholestatus WHERE 1=1 + AND status = '1' AND id = '$id' "; $result = mysqli_query($link, $sql); @@ -676,6 +717,7 @@ function getGongWuokNo($link) SUBSTR(address,1,2) FROM `wipwholestatus` WHERE id = '$id' + AND status = '1' "; $result = mysqli_query($link, $sql); $row = mysqli_fetch_array($result); diff --git a/wms/wipwhole-index-table-html.php b/wms/wipwhole-index-table-html.php index 9e4155d3..b6a69908 100644 --- a/wms/wipwhole-index-table-html.php +++ b/wms/wipwhole-index-table-html.php @@ -7,10 +7,20 @@ $tableArr = array( "CH" => "table_index6", "Z" => "table_index7" ); + +// 暫時可編輯及刪除權限 +$update_delete_status = false; +if (in_array($user_id, ['M0175', 'M0079'])) { + $update_delete_status = true; +} + ?> + 刪除" : ""; + ?> @@ -101,6 +111,7 @@ $tableArr = array( ?> + " : ""; ?>
合約號 電梯編號 客戶姓名
+