diff --git a/wms/cont/sign_list.php b/wms/cont/sign_list.php index a1f2ad4d..0d942a5e 100644 --- a/wms/cont/sign_list.php +++ b/wms/cont/sign_list.php @@ -133,7 +133,7 @@ if ($data) : //echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ." list($signer)=mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='". $row['form_key'] ."'" )); - echo "" .(empty($signer)?"結案":$signer) . ""; + echo "" .(empty($signer)?"結案":"N") . ""; ?> diff --git a/wms/fun_global.php b/wms/fun_global.php index 38e16855..b00c9d19 100644 --- a/wms/fun_global.php +++ b/wms/fun_global.php @@ -28,18 +28,6 @@ function sql_myself($user_id, $column="creater") { return $sql_cmd; } -/** - * 連線T8 MSSQL - */ -try { - $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222"); - if ($conn) { - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } -} catch (PDOException $e) { - echo "fail"; - echo $e->getMessage(); -} /** diff --git a/wms/header.php b/wms/header.php index 9a25c3de..348fbd63 100644 --- a/wms/header.php +++ b/wms/header.php @@ -9,6 +9,20 @@ if (isset($_REQUEST["function_name"])) { $function_name = ""; $function_flag = False; } +/** + * 連線T8 MSSQL + */ +try { + $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222"); + if ($conn) { + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } +} catch (PDOException $e) { + echo "fail"; + echo $e->getMessage(); +} + + /***************************** * global: diff --git a/wms/mkt/pricereview-edit.php b/wms/mkt/pricereview-edit.php index 2977b790..eeb071cc 100644 --- a/wms/mkt/pricereview-edit.php +++ b/wms/mkt/pricereview-edit.php @@ -909,7 +909,7 @@ $(function(){ $("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $('#mn_memo_all').val(mnMemoArr); var mnRelateFacilArr = []; - $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) + $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html().trim()); }) $('#mn_relate_facil_all').val(mnRelateFacilArr); var exNoteArr = []; $("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) diff --git a/wms/mkt/pricereview_renovate-check.php b/wms/mkt/pricereview_renovate-check.php index 50f2d1a2..96731be2 100644 --- a/wms/mkt/pricereview_renovate-check.php +++ b/wms/mkt/pricereview_renovate-check.php @@ -66,8 +66,26 @@ foreach ($res as $data) { mysqli_free_result($res_s); if (!empty($row_s["sign1"])) list($person1, $status1, $dtte1) = explode(",", $row_s["sign1"]); else $person1 = $status1 = $dtte1 = ""; - if (!empty($row_s["sign2"])) list($person2, $status2, $dtte2) = explode(",", $row_s["sign2"]); - else $person2 = $status2 = $dtte2 = ""; + if (!empty($row_s["sign2"])) { + if ($st == 2 && (preg_match("/Y/", $row_s["sign2"]) || preg_match("/N/", $row_s["sign2"]))) { + echo ""; + exit; + } + $sign2_arr = explode("<##>", $row_s["sign2"]); // M0024,,<##>M0175,, + $person2_arr = []; + foreach ($sign2_arr as $v) { + list($person2, $status2, $dtte2) = explode(",", $v); + if (strlen($v) == 7) { // 未審 + $person2_arr[] = $person2; + } else { + unset($person2_arr); + break; + } + } + } else $person2 = $status2 = $dtte2 = ""; if (!empty($row_s["sign3"])) list($person3, $status3, $dtte3) = explode(",", $row_s["sign3"]); else $person3 = $status3 = $dtte3 = ""; if (!empty($row_s["sign4"])) list($person4, $status4, $dtte4) = explode(",", $row_s["sign4"]); @@ -99,7 +117,7 @@ foreach ($res as $data) { if ($st == 1 && ($person1 == $user_id) && ($status1 == "")) { $sign_on = 1; } - if ($st == 2 && ($person2 == $user_id) && ($status2 == "")) { + if ($st == 2 && ($person2 == $user_id || (isset($person2_arr) && in_array($user_id, $person2_arr))) && ($status2 == "")) { $sign_on = 1; } if ($st == 3 && ($person3 == $user_id) && ($status3 == "")) { @@ -402,7 +420,6 @@ hr { -
@@ -440,7 +457,6 @@ hr { $item_amt_A_all += $val["item_price_bp"]; if ($viewmi) { for ($i=0; $i<$val["item_qty"]; $i++) { - ?> @@ -456,7 +472,6 @@ hr { "> "> - @@ -506,8 +521,8 @@ hr { $val) { $item_amt_B_all += $val["item_price_bp"]; ?> @@ -976,7 +991,19 @@ hr { 業務承辦人 - + + + diff --git a/wms/mkt/pricereview_renovate-edit.php b/wms/mkt/pricereview_renovate-edit.php index 951081ec..b78b4679 100644 --- a/wms/mkt/pricereview_renovate-edit.php +++ b/wms/mkt/pricereview_renovate-edit.php @@ -984,7 +984,7 @@ $(function(){ $("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $('#mn_memo_all').val(mnMemoArr); var mnRelateFacilArr = []; - $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) + $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html().trim()); }) $('#mn_relate_facil_all').val(mnRelateFacilArr); var exNoteArr = []; $("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) diff --git a/wms/mkt/pricereview_renovate-record-update.php b/wms/mkt/pricereview_renovate-record-update.php index 480f7ff1..d8807140 100644 --- a/wms/mkt/pricereview_renovate-record-update.php +++ b/wms/mkt/pricereview_renovate-record-update.php @@ -129,6 +129,9 @@ if(isset($_POST['pmstatus'])) { $item_price_arr = explode(",", $item_price_all); $gross_profit_arr = explode(",", $gross_profit_all); $item_price_arr = $gross_profit_arr = []; // 先reset, 等審核才產出 + // 非全汰改=REN + $renovate_flag = ""; + if (preg_match("/M1/", $fp_kind_all)) $renovate_flag = "REN"; // 如果售價變動或電梯數量異動,售價則平均分攤到每台 /* @@ -220,6 +223,7 @@ if(isset($_POST['pmstatus'])) { if (empty($iid) && $op_act_arr[$k] == "I") { $to_ins_arr[] = $k; } else { + $option_relate_spec = ""; $tmp_arr = explode("
", $option_relate_facil_arr[$k]); foreach ($tmp_arr as $val) { $option_relate_spec .= substr($val, 0, strpos($val, ".")).","; @@ -433,7 +437,7 @@ if(isset($_POST['pmstatus'])) { // <75%以下呈至總經理審核. ($price_rate) // 上級主管 > 伃廷 > MAX > 總經理 if ($status == "YS") { - $manager_arr = pricereview_class($price_rate, $user_id); + $manager_arr = pricereview_renovate_class($price_rate, $user_id, $renovate_flag); if ($manager_arr) { $sign1 = $sign2 = $sign3 = $sign4 = ""; foreach ($manager_arr as $k => $v) { diff --git a/wms/rib01-business-create.php b/wms/rib01-business-create.php index fe03bdf6..04daf132 100644 --- a/wms/rib01-business-create.php +++ b/wms/rib01-business-create.php @@ -44,9 +44,17 @@ $sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001 $deptype = $conn->query($sql_department); //取得供應商 +$BusinessPartner = array(); $sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'"; $BizPartner = $conn->query($sql_Biz); -$conn = null; +$bizcount = 0; +foreach ($BizPartner as $biz) { + $bizKey = $biz['BizPartnerId']; + $bizValue = $biz['BizPartnerName']; + array_push($BusinessPartner, $bizKey); + $bizcount += 1; +} +$BizJSON = json_encode($BusinessPartner); $MaxBillNo += 1; if ($MaxBillNo < 10) { @@ -129,17 +137,10 @@ if ($MaxBillNo < 10) {
- - + +
-
@@ -150,7 +151,7 @@ if ($MaxBillNo < 10) {
- +
@@ -158,6 +159,7 @@ if ($MaxBillNo < 10) { \ No newline at end of file diff --git a/wms/rib01-business-edit.php b/wms/rib01-business-edit.php index 9c9f2b9f..7036aa3c 100644 --- a/wms/rib01-business-edit.php +++ b/wms/rib01-business-edit.php @@ -1,2 +1,189 @@ query($sql_mydept); +foreach ($deptmem as $mem) { + $userid = $mem['UserId']; + $username = $mem['Username']; + $member["$userid"] = [$username]; +}; +$sql_dept = "SELECT DeptId, PersonId FROM comPerson WHERE DeptId!='0001'"; +$allpeople = $conn->query($sql_dept); +foreach ($allpeople as $man) { + if ($man['PersonId'] == $user_id) { + $mydepart = $man['DeptId']; + } + $personid = $man['PersonId']; + $depart = $man['DeptId']; + if (isset($member["$personid"])) { + array_push($member["$personid"], "$depart"); + }; +} +//取得部門代碼 +$sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'"; +$deptype = $conn->query($sql_department); + +//取得供應商 +$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'"; +$BizPartner = $conn->query($sql_Biz); +$conn = null; + + +?> +
+ +
+ + + +
+
+
+
+

報銷單據 (廠商)

+
+
+
+
+ + +
+
+ + disabled> +
+ +
+
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/wms/rib01-business-submit.php b/wms/rib01-business-submit.php index aa66f9eb..088b9e43 100644 --- a/wms/rib01-business-submit.php +++ b/wms/rib01-business-submit.php @@ -7,13 +7,13 @@ $BillDate = (int)$_POST['BillDate']; $CurrId = $_POST['CurrId']; $DeptId = $_POST['DeptId']; $PersonId = $_POST['PersonId']; -$comSupplierId = $_POST['comSupplierId']; +$BizPartnerId = $_POST['BizPartnerId']; $TaxId = $_POST['TaxId']; if ($submit == "add") { $SQL1 = "INSERT INTO rib_business (`BillNo`,`BillDate`,`BizPartnerId`,`CurrId`,`TaxId`, `PersonId`,`DeptId`,`CreditAgeDate`,`RecBizPartnerId`,`CurrentState`,`CreatorId`) VALUES ( - '$BillNo',$BillDate,'$comSupplierId','$CurrId','$TaxId','$PersonId','$DeptId',$BillDate,'$comSupplierId', + '$BillNo',$BillDate,'$BizPartnerId','$CurrId','$TaxId','$PersonId','$DeptId',$BillDate,'$BizPartnerId', 0,'$user_id')"; mysqli_query($link, $SQL1); if (mysqli_affected_rows($link)) { @@ -21,9 +21,10 @@ if ($submit == "add") { } else { echo ''; } + echo $SQL1; ?> - -->
- -
- - - $BizValue) { ?> - - - -
-
- +
diff --git a/wms/rib02-create.php b/wms/rib02-create.php index 89248d9e..f482aaad 100644 --- a/wms/rib02-create.php +++ b/wms/rib02-create.php @@ -50,7 +50,6 @@ foreach ($allpeople as $man) { //取得部門代碼 $sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'"; $deptype = $conn->query($sql_department); -$conn = null; //取得幣別 @@ -61,23 +60,22 @@ $sql_unit = "SELECT * FROM unit"; $unit_query = mysqli_query($link, $sql_unit); $unit = mysqli_fetch_all($unit_query, MYSQLI_ASSOC); -// 連線T8MASADA 取得供應商、合約跟作番號 -try { - $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222"); - if ($conn) { - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $sql_Biz = "SELECT * FROM comBusinessPartner"; - $BizPartner = $conn->query($sql_Biz); - $sql_Project = "SELECT * FROM comProject"; - $projects = $conn->query($sql_Project); - $sql_Material = "SELECT * FROM comMaterialGroup"; - $materials = $conn->query($sql_Material); - $conn = null; - } -} catch (PDOException $e) { - echo "fail"; - echo $e->getMessage(); +// 取得供應商、合約跟作番號 +$BusinessPartner = array(); +$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'"; +$BizPartner = $conn->query($sql_Biz); +$bizcount = 0; +foreach ($BizPartner as $biz) { + $bizKey = $biz['BizPartnerId']; + $bizValue = $biz['BizPartnerName']; + array_push($BusinessPartner,$bizKey); + $bizcount +=1; } +$BizJSON = json_encode($BusinessPartner); +$sql_Project = "SELECT * FROM comProject"; +$projects = $conn->query($sql_Project); +$sql_Material = "SELECT * FROM comMaterialGroup"; +$materials = $conn->query($sql_Material); ?>
@@ -302,20 +300,9 @@ try {
-
- - -
- - + +
@@ -343,21 +330,29 @@ try { $(document).ready(function() { $("#ProjectId").selectize(); $("#CU_MaterialId").selectize(); - $("#comSupplierName").selectize(); }) - $(function() { - $("#comSupplierName").change(function() { - if ($("#comSupplierName").val() == "雜項請款用") { - $("#Tax").show(); - } else { - $("#Tax").hide(); - } - }) - $("#TaxNo").change(function() { - if ($("#TaxNo").val().length !== 8) { + function checkBiz() { + if ($("#TaxNo").val().length !== 8) { alert("統一編號格式錯誤"); + }else{ + var biz = $("#TaxNo").val(); + var BizArray = ; + var answer = 0; + for (var partner = 0; partner < ; partner++){ + var value = BizArray[partner]; + if (biz == value){ + answer +=1 } - }) + } + if (answer==1){ + alert("供應商認證成功") + }else{ + alert("T8內無此供應商") + } + } + + } + $(function() { $("#VoucherType").change(function() { if ($("#VoucherType").val() !== "0") { $("#NotInvoice1").hide(); diff --git a/wms/rib02-edit.php b/wms/rib02-edit.php index 1c263ce5..2665a7c2 100644 --- a/wms/rib02-edit.php +++ b/wms/rib02-edit.php @@ -38,30 +38,28 @@ foreach ($allpeople as $man) { //取得部門代碼 $sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'"; $deptype = $conn->query($sql_department); -$conn = null; //取得計量單位 $sql_unit = "SELECT * FROM unit"; $unit_query = mysqli_query($link, $sql_unit); $unit = mysqli_fetch_all($unit_query, MYSQLI_ASSOC); -// 連線T8MASADA 取得供應商、合約跟作番號 -try { - $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222"); - if ($conn) { - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $sql_Biz = "SELECT * FROM comBusinessPartner"; - $BizPartner = $conn->query($sql_Biz); - $sql_Project = "SELECT * FROM comProject"; - $projects = $conn->query($sql_Project); - $sql_Material = "SELECT * FROM comMaterialGroup"; - $materials = $conn->query($sql_Material); - $conn = null; - } -} catch (PDOException $e) { - echo "fail"; - echo $e->getMessage(); +// 取得供應商、合約跟作番號 +$BusinessPartner = array(); +$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'"; +$BizPartner = $conn->query($sql_Biz); +$bizcount = 0; +foreach ($BizPartner as $biz) { + $bizKey = $biz['BizPartnerId']; + $bizValue = $biz['BizPartnerName']; + array_push($BusinessPartner,$bizKey); + $bizcount +=1; } +$BizJSON = json_encode($BusinessPartner); +$sql_Project = "SELECT * FROM comProject"; +$projects = $conn->query($sql_Project); +$sql_Material = "SELECT * FROM comMaterialGroup"; +$materials = $conn->query($sql_Material); ?>
@@ -419,26 +417,9 @@ try {
-
- - -
- - + +
@@ -459,24 +440,30 @@ try { $(document).ready(function() { $("#ProjectId").selectize(); $("#CU_MaterialId").selectize(); - $("#comSupplierName").selectize(); }) - var TempArr = []; - $(function() { - $("#comSupplierName").change(function() { - if ($("#comSupplierName").val() == "雜項請款用") { - $("#Tax").show(); - } else { - $("#Tax").hide(); - } - }) - - - $("#TaxNo").change(function() { - if ($("#TaxNo").val().length !== 8) { + function checkBiz() { + if ($("#TaxNo").val().length !== 8) { alert("統一編號格式錯誤"); + }else{ + var biz = $("#TaxNo").val(); + var BizArray = ; + var answer = 0; + for (var partner = 0; partner < ; partner++){ + var value = BizArray[partner]; + if (biz == value){ + answer +=1 } - }) + } + if (answer==1){ + alert("供應商認證成功") + }else{ + alert("T8內無此供應商") + } + } + + } + var TempArr = []; + $(function() { $("#VoucherType").change(function() { if ($("#VoucherType").val() !== "0") { $("#NotInvoice1").hide(); @@ -581,21 +568,6 @@ try { } }) - $("#comSupplierIdNum option").each(function(index, el) { - TempArr[index] = $(this).text(); - }) - $(document).bind('click', function(e) { - var e = e || window.event; - var elem = e.target || e.srcElement; - while (elem) { - if (elem.id && (elem.id == 'comSupplierIdNum' || elem.id == "comSupplierName")) { - return; - } - elem = elem.parentNode; - } - $('#comSupplierIdNum').css('display', 'none'); - }); - $("#Price").change(function() { $("#OAmount").val($("#Quantity").val() * $("#Price").val()); $("#LAmount").val($("#OAmount").val() * $("#CurrLAmount").val()); @@ -649,44 +621,10 @@ try { }) function ShowInvoice() { - // $("#Invoice").show(); window.open('rib02-invoice.php', '新視窗的名稱', config = 'height=600, width=600'); } - function changeF(this_) { - $(this_).prev("input").val($(this_).find("option:selected").text()); - $("#comSupplierIdNum").css({ - "display": "none" - }); - } - - function setfocus(this_) { - $("#comSupplierIdNum").css({ - "display": "" - }); - var select = $("#comSupplierIdNum"); - select.empty(); - if (select) { - $("#comSupplierIdNum").attr("size", 5); - for (i = 0; i < TempArr.length; i++) { - var option = new Option(TempArr[i], TempArr[i]); - select.append(option); - } - } - } - - function setinput(this_) { - var select = $("#comSupplierIdNum"); - select.html(""); - for (i = 0; i < TempArr.length; i++) { - if (TempArr[i].indexOf(this_.value) >= 0) { - var option = new Option(TempArr[i], TempArr[i]); - select.append(option); - } - } - } - function changeWriteOffId(SelectedDept) { var SelectDeptId = 'WriteOff' + SelectedDept + '-'; for (var i = 0; i < WriteOffId.options.length; i++) { diff --git a/wms/rib02-submit.php b/wms/rib02-submit.php index 712e1adf..17b17f11 100644 --- a/wms/rib02-submit.php +++ b/wms/rib02-submit.php @@ -5,6 +5,15 @@ $ribsub_id = isset($_GET['ribsub_id']) ? $_GET['ribsub_id'] : Null; $submit = $_GET['submit']; $state = empty($_GET['state']) ? 0 : $_GET['state']; +// 取得供應商 +$BusinessPartner = array(); +$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'"; +$BizPartner = $conn->query($sql_Biz); +foreach ($BizPartner as $biz) { + $bizKey = $biz['BizPartnerId']; + $bizValue = $biz['BizPartnerName']; + $BusinessPartner[$bizKey]=$bizValue; +} $RowCode = $_POST['RowCode']; $FeeDate = $_POST['FeeDate']; @@ -26,7 +35,7 @@ $VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount']; $VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0; $InvoiceNo = empty($_POST['InvoiceNo']) ? NULL : $_POST['InvoiceNo']; $CurrId = empty($_POST['CurrId']) ? null : $_POST['CurrId']; -$comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; +// $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; $FromSourceTag = 0; $TaxRate = ($TaxId == "ST005") ? 0.05 : 0; $OTax = isset($_POST['OTax']) ? $_POST['OTax'] : NULL; @@ -35,6 +44,15 @@ $OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? $_POST['OAmountUnWithTax $LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? $_POST['LAmountUnWithTax'] : null; $LAmount = isset($_POST['LAmount']) ? $_POST['LAmount'] : null; $TaxNo = empty($_POST['TaxNo']) ? '' : $_POST['TaxNo']; +if (empty($TaxNo)){ + $comSupplierName = "雜項請款用"; +}else{ + if (isset($BusinessPartner[$TaxNo])){ + $comSupplierName= $BusinessPartner[$TaxNo]; + }else{ + $comSupplierName = "雜項請款用"; + } +} if (isset($comSupplierName) && ($comSupplierName != "雜項請款用")) { diff --git a/wms/schedule-index.php b/wms/schedule-index.php index 6125d9c8..f6d07a00 100644 --- a/wms/schedule-index.php +++ b/wms/schedule-index.php @@ -4,12 +4,16 @@ include "header.php"; $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); $row = mysqli_fetch_row($res); $user_department_id = $row[0]; +$user_role_id = $row[1]; mysqli_free_result($res); +// 各區工務助理專員可瀏覽全部 +$dr_arr = ['3114', '3133', '3144', '3152']; + if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1; else $p = $_GET["p"]; $page_each = 50; @@ -22,6 +26,7 @@ $page_close = 0; $sql_cmd2 = ""; $sql_cmd = sql_myself($user_id); 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($_GET["contractno"])) $sql_cmd2 .= "and contractno = '".$_GET["contractno"]."' "; if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '".$_GET["facilityno"]."' "; diff --git a/wms/sign/list.php b/wms/sign/list.php index bbdd9a13..b335de8c 100644 --- a/wms/sign/list.php +++ b/wms/sign/list.php @@ -90,14 +90,14 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR)); -

待签查询

+

待簽查詢

- 系统名称 + 系統名稱 - 流程名称 + 流程名稱