Browse Source

開放工務助理專員查詢保養行程

gary
jrbin 1 year ago
parent
commit
a7258c1784
  1. 7
      wms/schedule-index.php

7
wms/schedule-index.php

@ -4,12 +4,16 @@ include "header.php";
$tourl = $_SERVER["SCRIPT_NAME"]."?function_name=schedule&token=".$token; $tourl = $_SERVER["SCRIPT_NAME"]."?function_name=schedule&token=".$token;
// 工務總處可瀏覽全部資料 // 工務總處可瀏覽全部資料
$sql = "select department_id from account where accountid = '$user_id'"; $sql = "select department_id, role_id from account where accountid = '$user_id'";
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
$row = mysqli_fetch_row($res); $row = mysqli_fetch_row($res);
$user_department_id = $row[0]; $user_department_id = $row[0];
$user_role_id = $row[1];
mysqli_free_result($res); mysqli_free_result($res);
// 各區工務助理專員可瀏覽全部
$dr_arr = ['3114', '3133', '3144', '3152'];
if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1; if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1;
else $p = $_GET["p"]; else $p = $_GET["p"];
$page_each = 50; $page_each = 50;
@ -22,6 +26,7 @@ $page_close = 0;
$sql_cmd2 = ""; $sql_cmd2 = "";
$sql_cmd = sql_myself($user_id); $sql_cmd = sql_myself($user_id);
if ($user_department_id == "501" || $user_department_id == "322" || $user_id == "M0012" || $user_id == "M0105") $sql_cmd = ""; if ($user_department_id == "501" || $user_department_id == "322" || $user_id == "M0012" || $user_id == "M0105") $sql_cmd = "";
if (in_array($user_department_id.$user_role_id, $dr_arr)) $sql_cmd = "";
//if (empty($sql_cmd)) $sql_cmd = "where "; //if (empty($sql_cmd)) $sql_cmd = "where ";
if (!empty($_GET["contractno"])) $sql_cmd2 .= "and contractno = '".$_GET["contractno"]."' "; if (!empty($_GET["contractno"])) $sql_cmd2 .= "and contractno = '".$_GET["contractno"]."' ";
if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '".$_GET["facilityno"]."' "; if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '".$_GET["facilityno"]."' ";

Loading…
Cancel
Save