diff --git a/wms/IncludeCommon.php b/wms/IncludeCommon.php index 1092255d..b11be99b 100644 --- a/wms/IncludeCommon.php +++ b/wms/IncludeCommon.php @@ -1,67 +1,65 @@ $explode[3]) { - $data['user_id'] = ''; - $data['code'] = '401'; - $data['message'] = 'Token已过期,请重新登录'; - return $data; - } - if (($true_signature == $explode[4])) { - $data['user_id'] = $explode[0]; - $data['code'] = '200'; - $data['message'] = 'Token合法'; - return $data; - } else { - $data['user_id'] = ''; - $data['code'] = '400'; - $data['message'] = 'Token不合法'; - return $data; - } - } else { - $data['user_id'] = ''; - $data['code'] = '400'; - $data['message'] = 'Token不合法'; - return $data; - } - } - //生成登录记录 - function save_log_response($account, $response_result, $source_flag = 'web') - { - # 储存纪录并输出 - #echo date("Y-m-d"); - $file_path = "account_log/" . $account . "-" . date("Y-m-d") . ".ini"; - $data = serialize($response_result) . date("H:i:s") . "\n"; - $fp = fopen($file_path, "a"); # 如果档案不存在择尝试建立再写入 - fwrite($fp, $data); - fclose($fp); - if ($source_flag == "web") { - // header("Location: custom-create.php?function_list=" . serialize($response_result) . - // "&token=" . $response_result["token"]); #请输入使用者名称密码 - // exit(); - return true; - } else { - // echo json_encode($response_result, JSON_UNESCAPED_UNICODE); - return false; - } + function CheckToken($token) { + date_default_timezone_set("Asia/Taipei"); + $encryption_code = "MASADA!^***"; + $time = date("Y-m-d H:i:s"); + + if (!isset($token) || empty($token)) { + $data['code'] = '400'; + $data['message'] = '非法请求'; + return $data; + } + //对比token + $explode = explode('.', $token); //以.分割token为数组 + if (!empty($explode[0]) && !empty($explode[1]) && !empty($explode[2]) && !empty($explode[3]) && !empty($explode[4])) { + $info = $explode[0] . '.' . $explode[1] . '.' . $explode[2] . '.' . $explode[3]; //信息部分 + $true_signature = hash_hmac('md5', $info, $encryption_code); //正确的签名 + if ($time > $explode[3]) { + $data['user_id'] = ''; + $data['code'] = '401'; + $data['message'] = 'Token已过期,请重新登录'; + return $data; + } + if (($true_signature == $explode[4])) { + $data['user_id'] = $explode[0]; + $data['code'] = '200'; + $data['message'] = 'Token合法'; + return $data; + } else { + $data['user_id'] = ''; + $data['code'] = '400'; + $data['message'] = 'Token不合法'; + return $data; + } + } else { + $data['user_id'] = ''; + $data['code'] = '400'; + $data['message'] = 'Token不合法'; + return $data; + } + } +//生成登录记录 + function save_log_response($source_flag='web', $account, $response_result){ + # 储存纪录并输出 + #echo date("Y-m-d"); + $file_path = "account_log/" . $account . "-" . date("Y-m-d") . ".ini"; + $data = serialize($response_result). date("H:i:s") . "\n"; + $fp = fopen($file_path,"a"); # 如果档案不存在择尝试建立再写入 + fwrite($fp, $data); + fclose($fp); + if ($source_flag == "web"){ +// header("Location: custom-create.php?function_list=" . serialize($response_result) . +// "&token=" . $response_result["token"]); #请输入使用者名称密码 +// exit(); + return true; + }else{ +// echo json_encode($response_result, JSON_UNESCAPED_UNICODE); + return false; + } - /* + /* if ($source_flag == "app"){ echo json_encode($response_result, JSON_UNESCAPED_UNICODE); }elseif ($source_flag == "web"){ @@ -70,28 +68,26 @@ class IncludeCommon exit(); } */ - } - - //生成token - function CreateToken($user_id, $user_name) - { - date_default_timezone_set("Asia/Taipei"); - $start_time = date("Y-m-d H:i:s"); - $end_time = date('Y-m-d H:i:s', strtotime('+24 hour')); #设定24小时 - $info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 - $encryption_code = "MASADA!^***"; - //根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) - $signature = hash_hmac('md5', $info, $encryption_code); - //最后将这两部分拼接起来,得到最终的Token字符串 - return $token = $info . '.' . $signature; - } - //生成菜单 + } + +//生成token + function CreateToken($user_id, $user_name) { + date_default_timezone_set("Asia/Taipei"); + $start_time = date("Y-m-d H:i:s"); + $end_time = date('Y-m-d H:i:s',strtotime('+24 hour')); #设定24小时 + $info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 + $encryption_code = "MASADA!^***"; + //根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) + $signature = hash_hmac('md5', $info, $encryption_code); + //最后将这两部分拼接起来,得到最终的Token字符串 + return $token = $info . '.' . $signature; + } +//生成菜单 /** * 將模擬帳號寫入token */ - function FakeToken($fake_user_id, $token) - { + function FakeToken($fake_user_id, $token) { date_default_timezone_set("Asia/Taipei"); $encryption_code = "MASADA!^***"; $time = date("Y-m-d H:i:s"); @@ -101,32 +97,31 @@ class IncludeCommon return $token = $info . '.' . $signature; } - function menu($type, $from = 'tw') - { - $function_type = array( - "tw" => array( - # F角色菜单 - "F" => array( - "language" => "tw", - "type" => "manage", - "list" => array( - array("name" => "批量导入", "path" => "http://192.168.0.12/wms/excel-upload"), - ), - "note" => "none", - "token" => "" - ), - ) - ); - - - return $function_type[$from][$type]; - } + function menu ($from='tw',$type){ + $function_type = array( + "tw" => array( + # F角色菜单 + "F" => array( + "language" => "tw", + "type" => "manage", + "list" => array( + array("name" => "批量导入", "path" => "http://192.168.0.12/wms/excel-upload"), + ), + "note" => "none", + "token" => "" + ), + ) + ); + + + return $function_type[$from][$type]; + + } /** * 依帳號類別檢視功能目錄 */ - function menu_v2($atype = "") - { + function menu_v2($atype="") { global $link; if (!$atype) return; @@ -145,8 +140,7 @@ class IncludeCommon * 管理者可看到全部選單 * 其餘人員依account_auth決定可檢視的選單 */ - function menu_v3($accounttype, $aid = "") - { + function menu_v3($aid="", $accounttype) { global $link; if (!$aid) return; @@ -155,7 +149,7 @@ class IncludeCommon $sql_cmd = ($accounttype == "E") ? "" : "where status = 'Y'"; $sql = "select main_menu, sub_menu, sub_menu_eng, mlink from menu $sql_cmd order by main_menu_seq, sub_menu_seq"; - + $res = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($res)) { $menu_arr[$row["mlink"]]["main_menu"] = $row["main_menu"]; @@ -167,8 +161,8 @@ class IncludeCommon $sql = "select permission from account_auth where accountid = '$aid'"; $res = mysqli_query($link, $sql); $row = mysqli_fetch_row($res); - $permission = empty($row) ? json_encode([]) : $row[0]; // $permission = $row[0]; //P0044 修改于2023/6/13 16:30 - + $permission = empty($row)? json_encode([]): $row[0]; // $permission = $row[0]; //P0044 修改于2023/6/13 16:30 + $permission_arr = json_decode($permission, true); foreach ($menu_arr as $key => $val) { if (($accounttype == "E") || !empty($permission_arr[$key])) { @@ -215,4 +209,4 @@ class IncludeCommon return $str; */ } -} +} \ No newline at end of file diff --git a/wms/T8_APItest.php b/wms/T8_APItest.php index d327c6e5..6f89ee68 100644 --- a/wms/T8_APItest.php +++ b/wms/T8_APItest.php @@ -1,91 +1,91 @@ - - \ No newline at end of file diff --git a/wms/T8_APItest_from_bpm.php b/wms/T8_APItest_from_bpm.php new file mode 100644 index 00000000..483b0e22 --- /dev/null +++ b/wms/T8_APItest_from_bpm.php @@ -0,0 +1,99 @@ + "stkAssyMast", + "rows" => [ + [ + "BillNo" => "TEST06", + "OrgId" => "1000", + "TypeId" => "CA", + "MaterialId" => "3MH00302", + "PersonId" => "M0122", + "CompId" => "1001", + "DeptId" => "220", + "SQuantity" => 1, + "SUnitId" => "SET", + "CurrentState" => 2, + "CreatorId" => "M0122" + ] + ] + ], + [ + "name" => "stkAssySubMatInfo", + "rows" => [ + [ + "BillNo" => "TEST06", + "MaterialId" => "3MH00302P", + "ComponentBaseQty" => 1, + "UnitQty" => 1, + "SUnitId" => "SET", + "MarkerNo" => "3MH00302", + "CU_MaterialId" => "3MH00302" + ], + [ + "BillNo" => "TEST06", + "MaterialId" => "MX00000001", + "ComponentBaseQty" => 1, + "UnitQty" => 3, + "SUnitId" => "PCS", + "MarkerNo" => "3MH00302", + "CU_MaterialId" => "3MH00302" + ] + ] + ] + ]; + + $json = json_encode($body); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $apiurl); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headerParam); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_POSTFIELDS, $json); + + $response = curl_exec($ch); + + if ($response === false) { + echo 'Curl error: ' . curl_error($ch); + } else { + $result = json_decode($response, true); + echo $result['Status'] . "\n"; + echo $result['ErrorMsg'] . "\n"; + print_r($result['Data']); + } + + curl_close($ch); +} diff --git a/wms/T8_Authorization.php b/wms/T8_Authorization.php index 0a18e7ed..f383ee47 100644 --- a/wms/T8_Authorization.php +++ b/wms/T8_Authorization.php @@ -1,37 +1,37 @@ - - - - + + + \ No newline at end of file diff --git a/wms/T8_Authorization_from_bpm.php b/wms/T8_Authorization_from_bpm.php new file mode 100644 index 00000000..c6ad6829 --- /dev/null +++ b/wms/T8_Authorization_from_bpm.php @@ -0,0 +1,43 @@ + - \ No newline at end of file diff --git a/wms/T8_purBillOrder_search.php b/wms/T8_purBillOrder_search.php index e3ff95f4..91ebfa26 100644 --- a/wms/T8_purBillOrder_search.php +++ b/wms/T8_purBillOrder_search.php @@ -1,23 +1,23 @@ -query($sql_purBillOrder); -//每筆採購單資料 -foreach($purMaster as $master){ - //print_r($master); - $BillNo = $master['BillNo']; - - //每筆採購單明細資料 - $sql_purDetail = " - SELECT * FROM purBillOrderDetail WHERE BillNo = '$BillNo'"; - $purDetail = $conn->query($sql_purDetail); - foreach($purDetail as $detail){ - print_r($detail); - } - echo "
----------------------
"; - -} - +query($sql_purBillOrder); +//每筆採購單資料 +foreach($purMaster as $master){ + //print_r($master); + $BillNo = $master['BillNo']; + + //每筆採購單明細資料 + $sql_purDetail = " + SELECT * FROM purBillOrderDetail WHERE BillNo = '$BillNo'"; + $purDetail = $conn->query($sql_purDetail); + foreach($purDetail as $detail){ + print_r($detail); + } + echo "
----------------------
"; + +} + diff --git a/wms/T8_purRequestOrder_create.php b/wms/T8_purRequestOrder_create.php index 2b441114..4df7938a 100644 --- a/wms/T8_purRequestOrder_create.php +++ b/wms/T8_purRequestOrder_create.php @@ -1,45 +1,45 @@ -query($sql); +query($sql); $conn ->query($sql_sub); \ No newline at end of file diff --git a/wms/account-create.php b/wms/account-create.php index 89f2715d..73d8f839 100644 --- a/wms/account-create.php +++ b/wms/account-create.php @@ -1,180 +1,180 @@ - - -
- - Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } - } - */ - ?> - - - -
"> - - -
- - - - -
- -
- - - -
- -
- - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - -
- -
- - -
- -
- - -
- -
- - - -
- -
- - - -
-
- - -
-
- - -
-
- - -

-
- -
- - -

-
- -
- -
- - -
-
- - + + +
+ + Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } + } + */ + ?> + + + +
"> + + +
+ + + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + +
+
+ + +
+
+ + +
+
+ + +

+
+ +
+ + +

+
+ +
+ +
+ + +
+
+ + diff --git a/wms/account-delete.php b/wms/account-delete.php index 84654d95..811f23a8 100644 --- a/wms/account-delete.php +++ b/wms/account-delete.php @@ -1,19 +1,19 @@ - \ No newline at end of file diff --git a/wms/account-edit.php b/wms/account-edit.php index 1d10b8f7..3892d111 100644 --- a/wms/account-edit.php +++ b/wms/account-edit.php @@ -1,173 +1,173 @@ -getMessage(), "\n"; - } -*/ - foreach($data as $data) : -?> - -
-
- - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
- - -
-
- - -
-
- - -
- - -
- -
- -
-
- - +getMessage(), "\n"; + } +*/ + foreach($data as $data) : +?> + +
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ +
+ +
+
+ + diff --git a/wms/account-index-submit.php b/wms/account-index-submit.php index a00176f3..26e75cc4 100644 --- a/wms/account-index-submit.php +++ b/wms/account-index-submit.php @@ -1,85 +1,85 @@ -sendx($subject, $em_body, $sendlist, "永佳捷科技", "", $file); - echo json_encode([1, "信件發送成功"]); -} +sendx($subject, $em_body, $sendlist, "永佳捷科技", "", $file); + echo json_encode([1, "信件發送成功"]); +} diff --git a/wms/account-index.php b/wms/account-index.php index ed0e9e1d..acba0023 100644 --- a/wms/account-index.php +++ b/wms/account-index.php @@ -1,173 +1,198 @@ - "客戶", "B" => "保養人員", "C" => "檢查人員", "D" => "契約人員", "M" => "員工", "E" => "管理員(IT)", "X" => "未分類"]; #A=客戶 B=保養人員 C=檢查人員 D=契約人員 E=管理人員 M=永佳捷員工 X=未分類 - -// 工務總處、王凱欣可瀏覽全部資料 -$sql = "select department_id from account where accountid = '$user_id'"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -$user_department_id = $row[0]; -mysqli_free_result($res); - -// 設置一個空陣列來放資料 -$data = array(); -// sql語法存在變數中 -$sql_cmd = sql_myself($user_id); -if ($user_department_id == "501" || $user_id == "M0105") $sql_cmd = ""; -$sql = "SELECT * FROM account $sql_cmd ORDER BY id"; -// 用mysqli_query方法執行(sql語法)將結果存在變數中 -$data = mysqli_query($link,$sql); -?> - - - -

- - - -

-Please fill up the required field!

"; - } else { - header("Location:account-index.php"); - } - } - -?> - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次帳號類型帳號姓名電話地址電子郵件Line ID微信id遠端協助維修ID直屬主管建檔人建檔時間修改
- 連結 -

- - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; - -?> + "客戶", "B" => "保養人員", "C" => "檢查人員", "D" => "契約人員", "M" => "員工", "E" => "管理員(IT)", "X" => "未分類"]; #A=客戶 B=保養人員 C=檢查人員 D=契約人員 E=管理人員 M=永佳捷員工 X=未分類 + +// 工務總處、王凱欣可瀏覽全部資料 +$sql = "select department_id from account where accountid = '$user_id'"; +$res = mysqli_query($link, $sql); +$row = mysqli_fetch_row($res); +$user_department_id = $row[0]; +mysqli_free_result($res); + +// 設置一個空陣列來放資料 +$data = array(); +// sql語法存在變數中 +$sql_cmd = sql_myself($user_id); +if ($user_department_id == "501" || $user_id == "M0105") $sql_cmd = ""; +$sql = "SELECT * FROM account $sql_cmd ORDER BY id"; +// 用mysqli_query方法執行(sql語法)將結果存在變數中 +$data = mysqli_query($link, $sql); +?> + + + +

+ + + +

+Please fill up the required field!

"; + } else { + header("Location:account-index.php"); + } + } + +?> + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次帳號類型帳號姓名電話地址電子郵件Line ID微信id遠端協助維修ID直屬主管建檔人建檔時間修改新人資料
+ 連結 +

+ + + +

+
+ +
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; + +?> \ No newline at end of file diff --git a/wms/account-receivable-check.php b/wms/account-receivable-check.php index 1e373b52..061efc7c 100644 --- a/wms/account-receivable-check.php +++ b/wms/account-receivable-check.php @@ -1,199 +1,255 @@ - - -
- -
- - - -
- -
-
-
-

-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
- -
-
-
- - -
-
- - -
-
- - -
-
-
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - -
目前應收已開發票金額未開發票金額已收金額未收金額
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
簽約款二次款貨抵工地款安裝款試車款官檢款交車款
-
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
發票日期發票金額收款日期收款金額說明功能
- - - - - -
-
- \ No newline at end of file diff --git a/wms/account-receivable-contract.php b/wms/account-receivable-contract.php index 9eda5895..f37920fb 100644 --- a/wms/account-receivable-contract.php +++ b/wms/account-receivable-contract.php @@ -1,39 +1,39 @@ -"; -$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt,s.BizPartnerId,c.BizPartnerName -FROM salOrderStagePay AS a -LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo -LEFT JOIN comBusinessPartner as c ON s.BizPartnerId=c.BizPartnerId -WHERE s.ModeId = 'M' AND (s.CurrentState=2 OR s.CurrentState=4)"; - -$contract = $conn->query($sql_contract); -foreach ($contract as $cont) { - if ($cont['BillNo'] == 'SO20230801002') { - $BillNo = 'M231067'; - }else{ - $BillNo = $cont['BillNo']; - }; - $PayStage = $cont['PayStage']; - $PayAmount = $cont['PlanPayAmt']; - $partnerName = $cont['BizPartnerName']; - if(isset($arrayData[$BillNo])){ - array_push($arrayData[$BillNo], $PayStage); - array_push($arrayData[$BillNo], $PayAmount); - - }else{ - $arrayData[$BillNo][0] = $BillNo; - $arrayData[$BillNo][1] = $partnerName; - array_push($arrayData[$BillNo], $PayStage); - array_push($arrayData[$BillNo], $PayAmount); - - } -}; -foreach($arrayData as $data){ - foreach($data as $value){ - echo $value.";"; - } - echo "
"; +"; +$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt,s.BizPartnerId,c.BizPartnerName +FROM salOrderStagePay AS a +LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo +LEFT JOIN comBusinessPartner as c ON s.BizPartnerId=c.BizPartnerId +WHERE s.ModeId = 'M' AND (s.CurrentState=2 OR s.CurrentState=4)"; + +$contract = $conn->query($sql_contract); +foreach ($contract as $cont) { + if ($cont['BillNo'] == 'SO20230801002') { + $BillNo = 'M231067'; + }else{ + $BillNo = $cont['BillNo']; + }; + $PayStage = $cont['PayStage']; + $PayAmount = $cont['PlanPayAmt']; + $partnerName = $cont['BizPartnerName']; + if(isset($arrayData[$BillNo])){ + array_push($arrayData[$BillNo], $PayStage); + array_push($arrayData[$BillNo], $PayAmount); + + }else{ + $arrayData[$BillNo][0] = $BillNo; + $arrayData[$BillNo][1] = $partnerName; + array_push($arrayData[$BillNo], $PayStage); + array_push($arrayData[$BillNo], $PayAmount); + + } +}; +foreach($arrayData as $data){ + foreach($data as $value){ + echo $value.";"; + } + echo "
"; } \ No newline at end of file diff --git a/wms/account-receivable-excel.php b/wms/account-receivable-excel.php new file mode 100644 index 00000000..d9358d2e --- /dev/null +++ b/wms/account-receivable-excel.php @@ -0,0 +1,51 @@ +$value){ + // for ($i = 0; $i < 17; $i++) { + // $value[$i] = (isset($value[$i])) ? $value[$i] : 0; + // } + $array_data[$key][0] = $key; + $array_data[$key][1] = $value[1]; + $array_data[$key][2] = $value[2]; + $array_data[$key][3] = $value[4]; + $array_data[$key][4] = $value[5]; + $array_data[$key][5] = $value[7]; + $array_data[$key][6] = $value[8]; + $array_data[$key][7] = $value[6]; + $array_data[$key][8] = $value['sign'][1]; + $array_data[$key][9] = $value['second'][1]; + $array_data[$key][10] = $value['arrive'][1]; + $array_data[$key][11] = $value['install'][1]; + $array_data[$key][12] = $value['tryrun'][1]; + $array_data[$key][13] = $value['check'][1]; + $array_data[$key][14] = $value['delivery'][1]; + $array_data[$key][15] = $value['final'][1]; + $array_data[$key][16] = $value['receivable_budget']; + $array_data[$key][17] = str_replace('
','; ',$value['facilities']); +} +$spreadsheet = new Spreadsheet(); +$sheet = $spreadsheet->getActiveSheet(); +$colomnHeader = ['合約號','部門','經理','營業員','客戶名稱','統一編號','聯絡地址','抬頭','簽約款', +'二次款','貨抵工地款','安裝款','試車款','官檢款','交車款','尾款','目前應收','作番狀態']; +$sheet->fromArray($colomnHeader,NULL,'A1'); +$rowIndex = 2; +foreach($array_data as $key => $value){ + $sheet->fromArray([$value], NULL, 'A' . $rowIndex); + $sheet->getStyle('R' . $rowIndex)->getAlignment()->setWrapText(true); + $rowIndex++; +} +$writer = new Xlsx($spreadsheet); +$excelFileName = 'account-receivable.xlsx'; +$writer->save($excelFileName); + +?> + \ No newline at end of file diff --git a/wms/account-receivable-index.php b/wms/account-receivable-index.php index 0cf5e917..7878d34c 100644 --- a/wms/account-receivable-index.php +++ b/wms/account-receivable-index.php @@ -1,345 +1,403 @@ - 0) { - $column_str = "('$user_id'" . ",'"; - $column_str .= implode("','", $follower); - $column_str .= "')"; - $sql_contract .= " OR s.PersonId IN $column_str)"; - $sql_received .= " OR person_id IN $column_str)"; - } else { - $sql_contract .= ")"; - }; -} - -$contract = $conn->query($sql_contract); -$received_data = mysqli_query($link, $sql_received); -foreach ($received_data as $received) { - if ($received['BillNo'] == 'SO20230801001') { - $BillNo = 'M230947'; - } elseif ($received['BillNo'] == 'SO20230801002') { - $BillNo = 'M231067'; - } else { - $BillNo = $received['BillNo']; - }; - if (isset($received_array[$BillNo])) { - $received_array[$BillNo][0] += $received['invoice_amount']; - $received_array[$BillNo][1] += $received['received_amount']; - } else { - $received_array[$BillNo][0] = $received['invoice_amount']; - $received_array[$BillNo][1] = $received['received_amount']; - } -} -foreach ($contract as $cont) { - // print_r($cont); - // echo "
"; - if ($cont['BillNo'] == 'SO20230801001') { - $BillNo = 'M230947'; - } elseif ($cont['BillNo'] == 'SO20230801002') { - $BillNo = 'M231067'; - } else { - $BillNo = $cont['BillNo']; - }; - $PayStage = $cont['PayStage']; - $PayAmount = $cont['PlanPayAmt']; - $partnerName = $cont['BizPartnerName']; - $EnterpriseName = $cont['EnterpriseName']; - $TaxNo = $cont['TaxNo']; - $ContactAddress = $cont['ContactAddress']; - //4 簽約 5 二次款 6 貨抵工地 7 安裝 8 試車 9官檢 10 交車 - if (isset($arrayData[$BillNo])) { - if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60')) { - $arrayData[$BillNo][5] = $PayAmount; - } elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金')) { - $arrayData[$BillNo][4] = $PayAmount; - } elseif (stristr($PayStage, '貨抵工地') || stristr($PayStage, '貨底工地')) { - $arrayData[$BillNo][6] = $PayAmount; - } elseif (stristr($PayStage, '試車') || stristr($PayStage, '驗收完成')) { - $arrayData[$BillNo][8] = $PayAmount; - } elseif (stristr($PayStage, '安裝')) { - $arrayData[$BillNo][7] = $PayAmount; - } elseif (stristr($PayStage, '得合格函後6個月') || stristr($PayStage, '核可函取得後6個月') || stristr($PayStage, '交車')) { - $arrayData[$BillNo][10] = $PayAmount; - } elseif (stristr($PayStage, '合格') || stristr($PayStage, '驗收') || stristr($PayStage, '許可') || stristr($PayStage, '核可')) { - $arrayData[$BillNo][9] = $PayAmount; - } else { - $arrayData[$BillNo][12] = $PayAmount; - } - } else { - $arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - $arrayData[$BillNo][3] = $partnerName; - $arrayData[$BillNo][13] = $EnterpriseName; - $arrayData[$BillNo][14] = $TaxNo; - $arrayData[$BillNo][15] = $ContactAddress; - if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60')) { - $arrayData[$BillNo][5] = $PayAmount; - } elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金')) { - $arrayData[$BillNo][4] = $PayAmount; - } elseif (stristr($PayStage, '貨抵工地') || stristr($PayStage, '貨底工地')) { - $arrayData[$BillNo][6] = $PayAmount; - } elseif (stristr($PayStage, '試車') || stristr($PayStage, '驗收完成')) { - $arrayData[$BillNo][8] = $PayAmount; - } elseif (stristr($PayStage, '安裝')) { - $arrayData[$BillNo][7] = $PayAmount; - } elseif (stristr($PayStage, '得合格函後6個月') || stristr($PayStage, '核可函取得後6個月') || stristr($PayStage, '交車')) { - $arrayData[$BillNo][10] = $PayAmount; - } elseif (stristr($PayStage, '合格') || stristr($PayStage, '驗收') || stristr($PayStage, '許可') || stristr($PayStage, '核可')) { - $arrayData[$BillNo][9] = $PayAmount; - } else { - $arrayData[$BillNo][12] = $PayAmount; - } - } -} - -foreach ($arrayData as $key => $value) { - $sql = "SELECT -tmp2.*, -d.name AS depart_name -FROM( -SELECT - a.manager, - a2.name as manager_name, - a.name, - a.department_id, - w.salesid, - w.contractno, - w.facilityno, - w.estimated_shipping_date, -w.actual_tofactory_date, - w.real_arrival_date, - w.install_end_date, - w.tryrun_end_date, - w.official_check_date, - w.delivery_date -from wipwholestatus AS w -left join account AS a -ON w.salesid = a.accountid -left join account AS a2 -ON a2.accountid = a.manager -where w.status = '1' AND w.contractno='" . $key . "'" . " - -)AS tmp2 -left join ( -SELECT DISTINCT - department_id, - name -FROM department - -) AS d -ON d.department_id = tmp2.department_id"; - $facitities = ""; - $total_facility_num = 0; - $arrive_num = 0; - $tryrun_num = 0; - $delivery_num = 0; - $official_num = 0; - $wipwhole_array = mysqli_query($link, $sql); - foreach ($wipwhole_array as $wip) { - $value[0] = $wip['depart_name']; - $value[1] = $wip['manager_name']; - $value[2] = $wip['name']; - $value[16] = isset($wip['department_id']) ? $wip['department_id'] : ''; - $value[17] = isset($wip['salesid']) ? $wip['salesid'] : ''; - if ($wip['delivery_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交)
"; - $total_facility_num += 1; - $arrive_num += 1; - $tryrun_num += 1; - $official_num += 1; - $delivery_num += 1; - } elseif ($wip['official_check_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢)
"; - $total_facility_num += 1; - $arrive_num += 1; - $tryrun_num += 1; - $official_num += 1; - } elseif ($wip['tryrun_end_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢)
"; - $total_facility_num += 1; - $arrive_num += 1; - $tryrun_num += 1; - } elseif ($wip['install_end_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢)
"; - $total_facility_num += 1; - $arrive_num += 1; - } elseif ($wip['real_arrival_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地)
"; - $total_facility_num += 1; - $arrive_num += 1; - } elseif ($wip['actual_tofactory_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['actual_tofactory_date'] . "實際到觀音日)
"; - $total_facility_num += 1; - } elseif ($wip['estimated_shipping_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計到港)
"; - $total_facility_num += 1; - } else { - $facitities .= $wip['facilityno'] . " (預計到港日待確認)
"; - $total_facility_num += 1; - } - } - $receivable_budget = 0; - //這是錢 4 簽約 5 二次款 6 貨抵工地 7 安裝 8 試車 9官檢 10 交車 - //這是數量 arrive_num 貨抵工地 tryrun_num 試車安裝完畢 official_num 官檢完畢 delivery_num 移交 - if ($total_facility_num > 0) { - $receivable_budget = $value[4] + ($value[5] + $value[6]) * ($arrive_num / $total_facility_num) + - ($value[7] + $value[8]) * ($tryrun_num / $total_facility_num) + ($value[9]) * ($official_num / $total_facility_num) - + ($value[10]) * ($delivery_num / $total_facility_num); - $uninvoice_budget = $receivable_budget; - $unreceived_budget = $receivable_budget; - $received_invoice = 0; - $received_budget = 0; - if (isset($received_array[$key][0])) { - $uninvoice_budget = $receivable_budget - $received_array[$key][0]; - $received_invoice = $received_array[$key][0]; - }else{ - $uninvoice_budget = $receivable_budget; - } - if (isset($received_array[$key][1])) { - $unreceived_budget = $receivable_budget - $received_array[$key][1]; - $received_budget = $received_array[$key][1]; - }else{ - $unreceived_budget = $receivable_budget; - } - } - if (isset($value[0]) && ($value[0] != 0)) { - $receivable_array[$key] = [$key, $value[0], $value[1], $value[2], $value[3], $value[4], $value[5], $value[6], $value[7], $value[8], $value[9], - $value[10], $receivable_budget, $facitities, $value[13], $value[14], $value[15], $value[16], $value[17], $received_invoice, $received_budget, - $uninvoice_budget, $unreceived_budget]; - } -} -$data = json_encode($receivable_array); - -// echo "合約號;部門;經理;營業員;客戶名稱;簽約款;二次款;貨抵工地款;安裝款;試車款;官檢款;交車款;目前應收;總作番數;貨抵;安裝試車;官檢;移交數;狀態
"; -?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
合約號部門經理營業員客戶名稱目前應收未開發票金額未收金額狀態操作
-
-
- \ No newline at end of file diff --git a/wms/account-receivable-received-create.php b/wms/account-receivable-received-create.php index ad50abd2..87a627a6 100644 --- a/wms/account-receivable-received-create.php +++ b/wms/account-receivable-received-create.php @@ -1,121 +1,124 @@ - -
- -
- -
-
-
-
-

-

新增收款資訊

-
-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
- - - - - -
-
-
-
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/wms/account-receivable-received-edit.php b/wms/account-receivable-received-edit.php index bfbb7ea2..1898a961 100644 --- a/wms/account-receivable-received-edit.php +++ b/wms/account-receivable-received-edit.php @@ -1,121 +1,142 @@ -"; -// print_r($BillData); -$sql_pay = "SELECT * from account_received where pay_id = '$pay_id'"; -$pay = mysqli_query($link, $sql_pay); -$pay = mysqli_fetch_assoc($pay); - -?> -
- -
- -
-
-
-
-

-

編輯收款資訊

-
-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
- - - -
-
-
-
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/wms/account-receivable-received-submit.php b/wms/account-receivable-received-submit.php index 4685bc05..8f04f0c1 100644 --- a/wms/account-receivable-received-submit.php +++ b/wms/account-receivable-received-submit.php @@ -1,84 +1,96 @@ -alert("新增/更新 成功")'; - echo $sql; -} else { - echo ''; -} + + \ No newline at end of file diff --git a/wms/account-receivable.xlsx b/wms/account-receivable.xlsx new file mode 100644 index 00000000..8edcb4bd Binary files /dev/null and b/wms/account-receivable.xlsx differ diff --git a/wms/account-record-submit.php b/wms/account-record-submit.php index c738be3b..418e55d2 100644 --- a/wms/account-record-submit.php +++ b/wms/account-record-submit.php @@ -1,75 +1,75 @@ - 0) { - // 如果有一筆以上代表有更新 - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + 0) { + // 如果有一筆以上代表有更新 + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/account-record-update.php b/wms/account-record-update.php index 9746db8e..b78299b8 100644 --- a/wms/account-record-update.php +++ b/wms/account-record-update.php @@ -1,66 +1,66 @@ - 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/account-user-input.php b/wms/account-user-input.php index aa3380c5..2af17727 100644 --- a/wms/account-user-input.php +++ b/wms/account-user-input.php @@ -1,65 +1,65 @@ - + diff --git a/wms/account_auth-create.php b/wms/account_auth-create.php index 4186c4e0..7448e57c 100644 --- a/wms/account_auth-create.php +++ b/wms/account_auth-create.php @@ -1,177 +1,177 @@ - - - -
- - Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } - } - */ - ?> - - - -
"> -
- - -
-
- - -
- - - - - - - - - - - $val) { - foreach($val as $k2 => $v2) { - if ($k2 == "main_menu") continue; - $td_str = ($k2 == 1) ? '' : ''; - $sta_str = ($v2["status"] == "Y") ? '' : ' class="table-off"'; -?> - > - - - - - - - -
主功能名稱子功能名稱控管
'.$val["main_menu"].' - - -
-
- - -

-
- -
- - "> -

-
- -
-
- -
- - - -
-
- - + + + +
+ + Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } + } + */ + ?> + + + +
"> +
+ + +
+
+ + +
+ + + + + + + + + + + $val) { + foreach($val as $k2 => $v2) { + if ($k2 == "main_menu") continue; + $td_str = ($k2 == 1) ? '' : ''; + $sta_str = ($v2["status"] == "Y") ? '' : ' class="table-off"'; +?> + > + + + + + + + +
主功能名稱子功能名稱控管
'.$val["main_menu"].' + + +
+
+ + +

+
+ +
+ + "> +

+
+ +
+
+ +
+ + + +
+
+ + diff --git a/wms/account_auth-edit.php b/wms/account_auth-edit.php index 1e641805..a274bf1a 100644 --- a/wms/account_auth-edit.php +++ b/wms/account_auth-edit.php @@ -1,182 +1,182 @@ - 'X'"; - $result = mysqli_query($link, $sql); - while ($row_a = mysqli_fetch_row($result)) { - $person .= $row_a[1]."(".$row_a[0].")、"; - } - mysqli_free_result($result); -?> - - -
-
- - -
- - -
-
- - -
- - - - - - - - - - - - $val) { - foreach($val as $k2 => $v2) { - if ($k2 == "main_menu") continue; - $td_str = ($k2 == 1) ? '' : ''; - $sta_str = ($v2["status"] == "Y") ? '' : ' class="table-off"'; - $chk_r = $chk_w = ""; - if (!empty($permission_arr[$v2["mlink"]])) { - if ($permission_arr[$v2["mlink"]]&1) $chk_r = " checked"; - if ($permission_arr[$v2["mlink"]]&2) $chk_w = " checked"; - } -?> - > - - - - - - - - -
主功能名稱子功能名稱 - - - -
'.$val["main_menu"].' - - - - - -
- -
- - -
-
-
- - -
-
-
- -
- - - "> - "> - - "> -
-
- - - + 'X'"; + $result = mysqli_query($link, $sql); + while ($row_a = mysqli_fetch_row($result)) { + $person .= $row_a[1]."(".$row_a[0].")、"; + } + mysqli_free_result($result); +?> + + +
+
+ + +
+ + +
+
+ + +
+ + + + + + + + + + + + $val) { + foreach($val as $k2 => $v2) { + if ($k2 == "main_menu") continue; + $td_str = ($k2 == 1) ? '' : ''; + $sta_str = ($v2["status"] == "Y") ? '' : ' class="table-off"'; + $chk_r = $chk_w = ""; + if (!empty($permission_arr[$v2["mlink"]])) { + if ($permission_arr[$v2["mlink"]]&1) $chk_r = " checked"; + if ($permission_arr[$v2["mlink"]]&2) $chk_w = " checked"; + } +?> + > + + + + + + + + +
主功能名稱子功能名稱 + + + +
'.$val["main_menu"].' + + + + + +
+ +
+ + +
+
+
+ + +
+
+
+ +
+ + + "> + "> + + "> +
+
+ + + diff --git a/wms/account_auth-index.php b/wms/account_auth-index.php index 0ddbff5d..d1dc283b 100644 --- a/wms/account_auth-index.php +++ b/wms/account_auth-index.php @@ -1,106 +1,105 @@ - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次部門代碼部門名稱職務代碼職務名稱建檔人建檔時間修改
-

- - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); -include "footer.php"; + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次部門代碼部門名稱職務代碼職務名稱建檔人建檔時間修改
+

+ + + +

+
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); +include "footer.php"; ?> \ No newline at end of file diff --git a/wms/account_auth-record-update.php b/wms/account_auth-record-update.php index 0cdab8bc..cf0ea3c3 100644 --- a/wms/account_auth-record-update.php +++ b/wms/account_auth-record-update.php @@ -1,65 +1,65 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - //print_r($_POST);exit; - - // 選單各功能的權限 - $prog_arr = []; - $opt_r_arr = explode(",", $opt_r_all); - $opt_w_arr = explode(",", $opt_w_all); - foreach ($opt_r_arr as $key => $val) { - list($menu_id, $auth_r) = explode(";", $val); - list($menu_id, $auth_w) = explode(";", $opt_w_arr[$key]); - - // 找出相關程式 - $sql = "select link_content from menu where id = '$menu_id'"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_assoc($res)) { - if ($row["link_content"]) { - $tmp_arr = explode("\r\n", $row["link_content"]); - foreach ($tmp_arr as $v) { - $prog_arr[$v] = $auth_r|$auth_w; - } - } - } - mysqli_free_result($res); - - if (($key%10)==0) usleep(200000); - } - - // 開始更新權限 - $permission = json_encode($prog_arr, JSON_UNESCAPED_SLASHES); - $sql = "update department set permission = '$permission', create_at = '$create_at' where id = '$id'"; - mysqli_query($link, $sql); - $affected = mysqli_affected_rows($link); - - // 更新user權限 - $sql = "select accountid from account where department_id = '$department_id' and role_id = '$role_id'"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $db_query = "insert into account_auth (accountid, permission) values ('$row[0]', '$permission') "; - $db_query .= "ON DUPLICATE KEY UPDATE accountid = '$row[0]', permission = '$permission'"; - $res_u = mysqli_query($link, $db_query); - } - mysqli_free_result($res); - - mysqli_close($link); - if ($affected > 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + //print_r($_POST);exit; + + // 選單各功能的權限 + $prog_arr = []; + $opt_r_arr = explode(",", $opt_r_all); + $opt_w_arr = explode(",", $opt_w_all); + foreach ($opt_r_arr as $key => $val) { + list($menu_id, $auth_r) = explode(";", $val); + list($menu_id, $auth_w) = explode(";", $opt_w_arr[$key]); + + // 找出相關程式 + $sql = "select link_content from menu where id = '$menu_id'"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_assoc($res)) { + if ($row["link_content"]) { + $tmp_arr = explode("\r\n", $row["link_content"]); + foreach ($tmp_arr as $v) { + $prog_arr[$v] = $auth_r|$auth_w; + } + } + } + mysqli_free_result($res); + + if (($key%10)==0) usleep(200000); + } + + // 開始更新權限 + $permission = json_encode($prog_arr, JSON_UNESCAPED_SLASHES); + $sql = "update department set permission = '$permission', create_at = '$create_at' where id = '$id'"; + mysqli_query($link, $sql); + $affected = mysqli_affected_rows($link); + + // 更新user權限 + $sql = "select accountid from account where department_id = '$department_id' and role_id = '$role_id'"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $db_query = "insert into account_auth (accountid, permission) values ('$row[0]', '$permission') "; + $db_query .= "ON DUPLICATE KEY UPDATE accountid = '$row[0]', permission = '$permission'"; + $res_u = mysqli_query($link, $db_query); + } + mysqli_free_result($res); + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/bargain-create.php b/wms/bargain-create.php index b39c625e..4188986c 100644 --- a/wms/bargain-create.php +++ b/wms/bargain-create.php @@ -1,313 +1,313 @@ - "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; - -$sql = "select max(bargainno) as maxno from bargain"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -$bargainno = $row[0] ? $row[0]+1 : date("Ym")."001"; - -$sql = "select department_id from account where accountid = '$user_id'"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -list($department_id) = $row; -mysqli_free_result($res); - -$department_arr = []; -$sql = "select department_id, name from department"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $department_arr[$row[0]] = $row[1]; -} -mysqli_free_result($res); -?> - - -
-Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } -} -*/ -?> - -
" enctype="multipart/form-data"> -
- - -
-
- - - -
-
- - -
-
- - -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
- -
-
-
- -
- -
-
-
- - -
-
- - -
-
- - -
-
-
- -
-
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

附件上傳及信息維護

序號作成單位提供◎維護信息配合單位提供◎維護信息
供應商名稱供應商報價單上傳報價備註議價後報價單上傳議價後報價備註
1
-
- - -
- - "> -

-
-
-
- -
- - - - - - - -
-
- + "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; + +$sql = "select max(bargainno) as maxno from bargain"; +$res = mysqli_query($link, $sql); +$row = mysqli_fetch_row($res); +$bargainno = $row[0] ? $row[0]+1 : date("Ym")."001"; + +$sql = "select department_id from account where accountid = '$user_id'"; +$res = mysqli_query($link, $sql); +$row = mysqli_fetch_row($res); +list($department_id) = $row; +mysqli_free_result($res); + +$department_arr = []; +$sql = "select department_id, name from department"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $department_arr[$row[0]] = $row[1]; +} +mysqli_free_result($res); +?> + + +
+Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } +} +*/ +?> + +
" enctype="multipart/form-data"> +
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

附件上傳及信息維護

序號作成單位提供◎維護信息配合單位提供◎維護信息
供應商名稱供應商報價單上傳報價備註議價後報價單上傳議價後報價備註
1
+
+ + +
+ + "> +

+
+
+
+ +
+ + + + + + + +
+
+ \ No newline at end of file diff --git a/wms/bargain-delete.php b/wms/bargain-delete.php index 51d66fd2..786bff07 100644 --- a/wms/bargain-delete.php +++ b/wms/bargain-delete.php @@ -1,29 +1,29 @@ -"; - //echo "alert('審核中,已無法刪除');"; - echo "alert('資料無法刪除');"; - echo "location.href='pricereview-index.php'"; - echo ""; - exit; -} -*/ -$db_query = "delete from bargain_supplier where bid = '$id'"; -if ($rs = mysqli_query($link, $db_query)) { - $db_query = "delete from bargain where id = '$id'"; - mysqli_query($link, $db_query); -} - -header("Refresh:0; url=bargain-index.php?function_name=bargain&".$token_link); -ob_end_flush(); +"; + //echo "alert('審核中,已無法刪除');"; + echo "alert('資料無法刪除');"; + echo "location.href='pricereview-index.php'"; + echo ""; + exit; +} +*/ +$db_query = "delete from bargain_supplier where bid = '$id'"; +if ($rs = mysqli_query($link, $db_query)) { + $db_query = "delete from bargain where id = '$id'"; + mysqli_query($link, $db_query); +} + +header("Refresh:0; url=bargain-index.php?function_name=bargain&".$token_link); +ob_end_flush(); ?> \ No newline at end of file diff --git a/wms/bargain-edit.php b/wms/bargain-edit.php index 33f6e2da..9fd09dca 100644 --- a/wms/bargain-edit.php +++ b/wms/bargain-edit.php @@ -1,375 +1,375 @@ - "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; - -$db_query = "select * from bargain where id = '$id'"; -$data = mysqli_query($link, $db_query); - -$department_arr = []; -$sql = "select department_id, name from department"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $department_arr[$row[0]] = $row[1]; -} -mysqli_free_result($res); - -foreach($data as $data) : - $sql = "select name from account where accountid = '".$data['creater']."'"; - $res = mysqli_query($link, $sql); - $row = mysqli_fetch_row($res); - list($creater_name) = $row; - mysqli_free_result($res); - - $item_arr = []; - $sql = "select * from bargain_supplier where bid = '$id' order by supplier_id"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_assoc($res)) { - $item_arr[$row['supplier_id']]['id'] = $row['id']; - $item_arr[$row['supplier_id']]['supplier'] = $row['supplier']; - $item_arr[$row['supplier_id']]['supplier_attatch_be'] = $row['supplier_attatch_be']; - $item_arr[$row['supplier_id']]['quote_amt_be'] = $row['quote_amt_be']; - $item_arr[$row['supplier_id']]['note_be'] = $row['note_be']; - $item_arr[$row['supplier_id']]['supplier_attatch_ar'] = $row['supplier_attatch_ar']; - $item_arr[$row['supplier_id']]['quote_amt_ar'] = $row['quote_amt_ar']; - $item_arr[$row['supplier_id']]['note_ar'] = $row['note_ar']; - } - mysqli_free_result($res); -?> - - -
-
-
- - -
-
- - - -
-
- - -
-
- - -
-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - ".substr($data["attatch1"], strrpos($data["attatch1"],"/")+1).""; - ?> -
- -
-
-
- - ".substr($data["attatch2"], strrpos($data["attatch2"],"/")+1).""; - ?> -
- -
-
-
- - -
-
- - -
-
- - -
-
-
- -
-
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - $val) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - -

附件上傳及信息維護

序號作成單位提供◎維護信息配合單位提供◎維護信息
供應商名稱供應商報價單上傳報價備註議價後報價單上傳議價後報價備註
- ".substr($val['supplier_attatch_be'], strrpos($val['supplier_attatch_be'],"/")+1).""; - else echo "--"; - ?> - - ".substr($val['supplier_attatch_ar'], strrpos($val['supplier_attatch_ar'],"/")+1).""; - else echo "--"; - ?> -
-
- - -
- - "> -

-
-
-
- -
- - - - - - - - - - - -
-
- "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; + +$db_query = "select * from bargain where id = '$id'"; +$data = mysqli_query($link, $db_query); + +$department_arr = []; +$sql = "select department_id, name from department"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $department_arr[$row[0]] = $row[1]; +} +mysqli_free_result($res); + +foreach($data as $data) : + $sql = "select name from account where accountid = '".$data['creater']."'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + list($creater_name) = $row; + mysqli_free_result($res); + + $item_arr = []; + $sql = "select * from bargain_supplier where bid = '$id' order by supplier_id"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + $item_arr[$row['supplier_id']]['id'] = $row['id']; + $item_arr[$row['supplier_id']]['supplier'] = $row['supplier']; + $item_arr[$row['supplier_id']]['supplier_attatch_be'] = $row['supplier_attatch_be']; + $item_arr[$row['supplier_id']]['quote_amt_be'] = $row['quote_amt_be']; + $item_arr[$row['supplier_id']]['note_be'] = $row['note_be']; + $item_arr[$row['supplier_id']]['supplier_attatch_ar'] = $row['supplier_attatch_ar']; + $item_arr[$row['supplier_id']]['quote_amt_ar'] = $row['quote_amt_ar']; + $item_arr[$row['supplier_id']]['note_ar'] = $row['note_ar']; + } + mysqli_free_result($res); +?> + + +
+
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + ".substr($data["attatch1"], strrpos($data["attatch1"],"/")+1).""; + ?> +
+ +
+
+
+ + ".substr($data["attatch2"], strrpos($data["attatch2"],"/")+1).""; + ?> +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + $val) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + +

附件上傳及信息維護

序號作成單位提供◎維護信息配合單位提供◎維護信息
供應商名稱供應商報價單上傳報價備註議價後報價單上傳議價後報價備註
+ ".substr($val['supplier_attatch_be'], strrpos($val['supplier_attatch_be'],"/")+1).""; + else echo "--"; + ?> + + ".substr($val['supplier_attatch_ar'], strrpos($val['supplier_attatch_ar'],"/")+1).""; + else echo "--"; + ?> +
+
+ + +
+ + "> +

+
+
+
+ +
+ + + + + + + + + + + +
+
+ \ No newline at end of file diff --git a/wms/bargain-index.php b/wms/bargain-index.php index 52d8daad..33afaf71 100644 --- a/wms/bargain-index.php +++ b/wms/bargain-index.php @@ -1,144 +1,144 @@ - "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; - -$sql = "select department_id, name from department"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $department_arr[$row[0]] = $row[1]; -} -mysqli_free_result($res); - -// sql語法存在變數中 -$sql = "select * from bargain order by id"; - -// 用mysqli_query方法執行(sql語法)將結果存在變數中 -$data = mysqli_query($link,$sql); -?> - - -

- - - -

- -Please fill up the required field!

"; - } else { - header("Location:bargain-index.php"); - } - } - -?> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次申請單號作成單位作成者收文單位回答期限項目名稱類別品牌型號預估數量建檔人建檔時間修改刪除
-

- - - -

-
-

- - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; + "生產設備", "B" => "建築工程類", "C" => "工業工程規劃", "D" => "修繕維保服務", "E" => "儀器設備", "F" => "辦公設備", "G" => "辦公家具", "H" => "IT類產品", "I" => "諮詢服務", "J" => "維保電梯配件"]; + +$sql = "select department_id, name from department"; +$res = mysqli_query($link, $sql); +while ($row = mysqli_fetch_row($res)) { + $department_arr[$row[0]] = $row[1]; +} +mysqli_free_result($res); + +// sql語法存在變數中 +$sql = "select * from bargain order by id"; + +// 用mysqli_query方法執行(sql語法)將結果存在變數中 +$data = mysqli_query($link,$sql); +?> + + +

+ + + +

+ +Please fill up the required field!

"; + } else { + header("Location:bargain-index.php"); + } + } + +?> + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次申請單號作成單位作成者收文單位回答期限項目名稱類別品牌型號預估數量建檔人建檔時間修改刪除
+

+ + + +

+
+

+ + + +

+
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; ?> \ No newline at end of file diff --git a/wms/bargain-record-submit.php b/wms/bargain-record-submit.php index a4e2ddcf..b61ef444 100644 --- a/wms/bargain-record-submit.php +++ b/wms/bargain-record-submit.php @@ -1,149 +1,149 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - - $sql = "select max(bargainno) as maxno from bargain"; - $res = mysqli_query($link, $sql); - $row = mysqli_fetch_row($res); - $bargainno_check = $row[0] ? $row[0]+1 : date("Ym")."001"; - if ($bargainno_check <> $bargainno) $bargainno = $bargainno_check; - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "bargain-uploads/"; - $target_file1 = strtolower($target_dir.$bargainno."-1-".basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - //if (file_exists($target_file1)) unlink($target_file1); - foreach (glob($target_dir.$bargainno."-1-*") as $todelfile) { - unlink($todelfile); - } - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - } else $target_file1 = ""; - - if ($_FILES["attatch2"]["error"] == 0) { - $file_name = $_FILES["attatch2"]["name"]; - $temp_file_name = $_FILES["attatch2"]["tmp_name"]; - $file_size = $_FILES["attatch2"]["size"]; - $target_dir = "bargain-uploads/"; - $target_file2 = strtolower($target_dir.$bargainno."-2-".basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - //if (file_exists($target_file2)) unlink($target_file2); - foreach (glob($target_dir.$bargainno."-2-*") as $todelfile) { - unlink($todelfile); - } - $upload_res_2 = move_uploaded_file($temp_file_name, $target_file2); - } else $target_file2 = ""; - - if (($target_file1 && !$upload_res_1) || ($target_file2 && !$upload_res_2)) { - echo ""; - } - - $db_query = "insert into bargain (bargainno, department_id, proposer, receiver, response_dt, item, annual, urgent, vendor, prospecting, category, "; - $db_query .= "dealer, reason, brand, model, quantity, brandkeep, lead_time, margin, margin_day, acceptance, purchase_history, "; - $db_query .= "attatch1, attatch2, item_description, repairno, category_repair, content, quotation, creater, create_at) values ("; - $db_query .= "'$bargainno', '$department_id', '$proposer', '$receiver', '$response_dt', '$item', '$annual', '$urgent', '$vendor', '$prospecting', '$category', "; - $db_query .= "'$dealer', '$reason', '$brand', '$model', '$quantity', '$brandkeep', '$lead_time', '$margin', '$margin_day', '$acceptance', '$purchase_history', "; - $db_query .= "'$target_file1', '$target_file2', '$item_description', '$repairno', '$category_repair', '$content', '$quotation', '$user_id', '$create_at')"; - $result = mysqli_query($link, $db_query); - $affected = mysqli_affected_rows($link); - if ($result && $sup_id_all != "") { - $bid = mysqli_insert_id($link); - $sup_id_arr = explode(",", $sup_id_all); - $supplier_arr = explode(",", $supplier_all); - $quote_amt_be_arr = explode(",", $quote_amt_be_all); - $note_be_arr = explode(",", $note_be_all); - $quote_amt_ar_arr = explode(",", $quote_amt_ar_all); - $note_ar_arr = explode(",", $note_ar_all); - $item_no = 1; - - for ($i=0; $i"; - echo "alert('檔案上傳失敗,資料請重建!".$sql."');"; - echo "location.href='bargain-index.php?function_name=bargain&".$token_link."';"; - echo ""; - } - - $quote_amt_be_arr[$i] = str_replace(",", "", $quote_amt_be_arr[$i]); - $quote_amt_ar_all[$i] = str_replace(",", "", $quote_amt_ar_all[$i]); - $db_query = "insert into bargain_supplier (bid, supplier_id, supplier, supplier_attatch_be, quote_amt_be, note_be, "; - $db_query .= "supplier_attatch_ar, quote_amt_ar, note_ar, creater, create_at) values ("; - $db_query .= "'$bid', '$item_no', '$supplier_arr[$i]', '$target_file_be', '$quote_amt_be_arr[$i]', '$note_be_arr[$i]', "; - $db_query .= "'$target_file_ar', '$quote_amt_ar_arr[$i]', '$note_ar_arr[$i]', '$user_id', '$create_at')"; - $result = mysqli_query($link, $db_query); - $item_no++; - } - } - - mysqli_close($link); - if ($affected > 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + $sql = "select max(bargainno) as maxno from bargain"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + $bargainno_check = $row[0] ? $row[0]+1 : date("Ym")."001"; + if ($bargainno_check <> $bargainno) $bargainno = $bargainno_check; + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "bargain-uploads/"; + $target_file1 = strtolower($target_dir.$bargainno."-1-".basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + //if (file_exists($target_file1)) unlink($target_file1); + foreach (glob($target_dir.$bargainno."-1-*") as $todelfile) { + unlink($todelfile); + } + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + } else $target_file1 = ""; + + if ($_FILES["attatch2"]["error"] == 0) { + $file_name = $_FILES["attatch2"]["name"]; + $temp_file_name = $_FILES["attatch2"]["tmp_name"]; + $file_size = $_FILES["attatch2"]["size"]; + $target_dir = "bargain-uploads/"; + $target_file2 = strtolower($target_dir.$bargainno."-2-".basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + //if (file_exists($target_file2)) unlink($target_file2); + foreach (glob($target_dir.$bargainno."-2-*") as $todelfile) { + unlink($todelfile); + } + $upload_res_2 = move_uploaded_file($temp_file_name, $target_file2); + } else $target_file2 = ""; + + if (($target_file1 && !$upload_res_1) || ($target_file2 && !$upload_res_2)) { + echo ""; + } + + $db_query = "insert into bargain (bargainno, department_id, proposer, receiver, response_dt, item, annual, urgent, vendor, prospecting, category, "; + $db_query .= "dealer, reason, brand, model, quantity, brandkeep, lead_time, margin, margin_day, acceptance, purchase_history, "; + $db_query .= "attatch1, attatch2, item_description, repairno, category_repair, content, quotation, creater, create_at) values ("; + $db_query .= "'$bargainno', '$department_id', '$proposer', '$receiver', '$response_dt', '$item', '$annual', '$urgent', '$vendor', '$prospecting', '$category', "; + $db_query .= "'$dealer', '$reason', '$brand', '$model', '$quantity', '$brandkeep', '$lead_time', '$margin', '$margin_day', '$acceptance', '$purchase_history', "; + $db_query .= "'$target_file1', '$target_file2', '$item_description', '$repairno', '$category_repair', '$content', '$quotation', '$user_id', '$create_at')"; + $result = mysqli_query($link, $db_query); + $affected = mysqli_affected_rows($link); + if ($result && $sup_id_all != "") { + $bid = mysqli_insert_id($link); + $sup_id_arr = explode(",", $sup_id_all); + $supplier_arr = explode(",", $supplier_all); + $quote_amt_be_arr = explode(",", $quote_amt_be_all); + $note_be_arr = explode(",", $note_be_all); + $quote_amt_ar_arr = explode(",", $quote_amt_ar_all); + $note_ar_arr = explode(",", $note_ar_all); + $item_no = 1; + + for ($i=0; $i"; + echo "alert('檔案上傳失敗,資料請重建!".$sql."');"; + echo "location.href='bargain-index.php?function_name=bargain&".$token_link."';"; + echo ""; + } + + $quote_amt_be_arr[$i] = str_replace(",", "", $quote_amt_be_arr[$i]); + $quote_amt_ar_all[$i] = str_replace(",", "", $quote_amt_ar_all[$i]); + $db_query = "insert into bargain_supplier (bid, supplier_id, supplier, supplier_attatch_be, quote_amt_be, note_be, "; + $db_query .= "supplier_attatch_ar, quote_amt_ar, note_ar, creater, create_at) values ("; + $db_query .= "'$bid', '$item_no', '$supplier_arr[$i]', '$target_file_be', '$quote_amt_be_arr[$i]', '$note_be_arr[$i]', "; + $db_query .= "'$target_file_ar', '$quote_amt_ar_arr[$i]', '$note_ar_arr[$i]', '$user_id', '$create_at')"; + $result = mysqli_query($link, $db_query); + $item_no++; + } + } + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/bargain-record-update.php b/wms/bargain-record-update.php index d3b27af3..097c5499 100644 --- a/wms/bargain-record-update.php +++ b/wms/bargain-record-update.php @@ -1,144 +1,144 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - //print_r($_POST); - //print_r($_FILES);exit; - - $sql_atta = ""; - - $quantity = str_replace(",", "", $quantity); - $lead_time = str_replace(",", "", $lead_time); - $margin_day = str_replace(",", "", $margin_day); - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "bargain-uploads/"; - $target_file1 = strtolower($target_dir.$bargainno."-1-".basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - //if (file_exists($target_file1)) unlink($target_file1); - foreach (glob($target_dir.$bargainno."-1-*") as $todelfile) { - unlink($todelfile); - } - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - $sql_atta .= "attatch1 = '$target_file1', "; - } else $target_file1 = ""; - - if ($_FILES["attatch2"]["error"] == 0) { - $file_name = $_FILES["attatch2"]["name"]; - $temp_file_name = $_FILES["attatch2"]["tmp_name"]; - $file_size = $_FILES["attatch2"]["size"]; - $target_dir = "bargain-uploads/"; - $target_file2 = strtolower($target_dir.$bargainno."-2-".basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - //if (file_exists($target_file2)) unlink($target_file2); - foreach (glob($target_dir.$bargainno."-2-*") as $todelfile) { - unlink($todelfile); - } - $upload_res_2 = move_uploaded_file($temp_file_name, $target_file2); - $sql_atta .= "attatch2 = '$target_file2', "; - } else $target_file2 = ""; - - if (($target_file1 && !$upload_res_1) || ($target_file2 && !$upload_res_2)) { - echo ""; - } - - $db_query = "update bargain set receiver = '$receiver', response_dt = '$response_dt', item = '$item', annual = '$annual', urgent = '$urgent', "; - $db_query .= "vendor = '$vendor', prospecting = '$prospecting', category = '$category', dealer = '$dealer', reason = '$reason', brand = '$brand', "; - $db_query .= "model = '$model', quantity = '$quantity', brandkeep = '$brandkeep', lead_time = '$lead_time', margin = '$margin', margin_day = '$margin_day', "; - $db_query .= "acceptance = '$acceptance', purchase_history = '$purchase_history', item_description = '$item_description', repairno = '$repairno', "; - $db_query .= $sql_atta; - $db_query .= "category_repair = '$category_repair', content = '$content', quotation = '$quotation', create_dt = '$create_at' "; - $db_query .= "where id = '$id'"; - $result = mysqli_query($link, $db_query); - $affected = mysqli_affected_rows($link); - if ($result && $sup_id_all != "") { - $bsid_arr = explode(",", $bsid_all); - $sup_id_arr = explode(",", $sup_id_all); - $supplier_arr = explode(",", rtrim($supplier_all, ",")); - $quote_amt_be_arr = explode(",", $quote_amt_be_all); - $note_be_arr = explode(",", $note_be_all); - $quote_amt_ar_arr = explode(",", $quote_amt_ar_all); - $note_ar_arr = explode(",", $note_ar_all); - $item_no = 1; - - // 有新增的供應商 - $new_sup_cnt = count($supplier_arr) - count($bsid_arr); - if ($new_sup_cnt > 0) $next_sup_id = max($sup_id_arr)+1; - $idx = 0; - for ($i=0; $i 0 && $bsid_arr[$i] == "") { // 新增 - $target_file_be = $target_file_ar = ""; - if ($_FILES["supplier_attatch_be"]["name"]) { // 有上傳檔案 - if ($_FILES["supplier_attatch_be"]["name"][$idx] && ($_FILES["supplier_attatch_be"]["error"][$idx] == 0)) { - $file_name = $_FILES["supplier_attatch_be"]["name"][$idx]; - $temp_file_name = $_FILES["supplier_attatch_be"]["tmp_name"][$idx]; - $file_size = $_FILES["supplier_attatch_be"]["size"][$idx]; - $target_dir = "bargain-uploads/supplier/"; - $target_file_be = strtolower($target_dir.$bargainno."-".$next_sup_id."-".basename($file_name)); - $upload_ok = 1; - $img_file_type = pathinfo($target_file_be, PATHINFO_EXTENSION); - $upload_res_be = move_uploaded_file($temp_file_name, $target_file_be); - } - } - if ($_FILES["supplier_attatch_ar"]["name"]) { // 有上傳檔案 - if ($_FILES["supplier_attatch_ar"]["name"][$idx] && ($_FILES["supplier_attatch_ar"]["error"][$idx] == 0)) { - $file_name = $_FILES["supplier_attatch_ar"]["name"][$idx]; - $temp_file_name = $_FILES["supplier_attatch_ar"]["tmp_name"][$idx]; - $file_size = $_FILES["supplier_attatch_ar"]["size"][$idx]; - $target_dir = "bargain-uploads/supplier/"; - $target_file_ar = strtolower($target_dir.$bargainno."-".$next_sup_id."-".basename($file_name)); - $upload_ok = 1; - $img_file_type = pathinfo($target_file_ar, PATHINFO_EXTENSION); - $upload_res_ar = move_uploaded_file($temp_file_name, $target_file_ar); - } - } - if ($upload_res_be || $upload_res_ar) $idx++; - if (($target_file_be && !$upload_res_be) || ($target_file_ar && !$upload_res_ar)) { - echo ""; - } - $db_query = "insert into bargain_supplier (bid, supplier_id, supplier, supplier_attatch_be, quote_amt_be, note_be, "; - $db_query .= "supplier_attatch_ar, quote_amt_ar, note_ar, creater, create_at) values ("; - $db_query .= "'$id', '$next_sup_id', '$supplier_arr[$i]', '$target_file_be', '$quote_amt_be_arr[$i]', '$note_be_arr[$i]', "; - $db_query .= "'$target_file_ar', '$quote_amt_ar_arr[$i]', '$note_ar_arr[$i]', '$user_id', '$create_at')"; - $result = mysqli_query($link, $db_query); - $next_sup_id++; - } else { // 修改(不支援重傳檔案) - $db_query = "update bargain_supplier set supplier = '$supplier_arr[$i]', quote_amt_be = '$quote_amt_be_arr[$i]', "; - $db_query .= "note_be = '$note_be_arr[$i]', quote_amt_ar = '$quote_amt_ar_arr[$i]', "; - $db_query .= "note_ar = '$note_ar_arr[$i]', create_at = '$create_at' "; - $db_query .= "where id = '$bsid_arr[$i]'"; - $result = mysqli_query($link, $db_query); - } - } - } - - mysqli_close($link); - if ($affected > 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + //print_r($_POST); + //print_r($_FILES);exit; + + $sql_atta = ""; + + $quantity = str_replace(",", "", $quantity); + $lead_time = str_replace(",", "", $lead_time); + $margin_day = str_replace(",", "", $margin_day); + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "bargain-uploads/"; + $target_file1 = strtolower($target_dir.$bargainno."-1-".basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + //if (file_exists($target_file1)) unlink($target_file1); + foreach (glob($target_dir.$bargainno."-1-*") as $todelfile) { + unlink($todelfile); + } + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + $sql_atta .= "attatch1 = '$target_file1', "; + } else $target_file1 = ""; + + if ($_FILES["attatch2"]["error"] == 0) { + $file_name = $_FILES["attatch2"]["name"]; + $temp_file_name = $_FILES["attatch2"]["tmp_name"]; + $file_size = $_FILES["attatch2"]["size"]; + $target_dir = "bargain-uploads/"; + $target_file2 = strtolower($target_dir.$bargainno."-2-".basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + //if (file_exists($target_file2)) unlink($target_file2); + foreach (glob($target_dir.$bargainno."-2-*") as $todelfile) { + unlink($todelfile); + } + $upload_res_2 = move_uploaded_file($temp_file_name, $target_file2); + $sql_atta .= "attatch2 = '$target_file2', "; + } else $target_file2 = ""; + + if (($target_file1 && !$upload_res_1) || ($target_file2 && !$upload_res_2)) { + echo ""; + } + + $db_query = "update bargain set receiver = '$receiver', response_dt = '$response_dt', item = '$item', annual = '$annual', urgent = '$urgent', "; + $db_query .= "vendor = '$vendor', prospecting = '$prospecting', category = '$category', dealer = '$dealer', reason = '$reason', brand = '$brand', "; + $db_query .= "model = '$model', quantity = '$quantity', brandkeep = '$brandkeep', lead_time = '$lead_time', margin = '$margin', margin_day = '$margin_day', "; + $db_query .= "acceptance = '$acceptance', purchase_history = '$purchase_history', item_description = '$item_description', repairno = '$repairno', "; + $db_query .= $sql_atta; + $db_query .= "category_repair = '$category_repair', content = '$content', quotation = '$quotation', create_dt = '$create_at' "; + $db_query .= "where id = '$id'"; + $result = mysqli_query($link, $db_query); + $affected = mysqli_affected_rows($link); + if ($result && $sup_id_all != "") { + $bsid_arr = explode(",", $bsid_all); + $sup_id_arr = explode(",", $sup_id_all); + $supplier_arr = explode(",", rtrim($supplier_all, ",")); + $quote_amt_be_arr = explode(",", $quote_amt_be_all); + $note_be_arr = explode(",", $note_be_all); + $quote_amt_ar_arr = explode(",", $quote_amt_ar_all); + $note_ar_arr = explode(",", $note_ar_all); + $item_no = 1; + + // 有新增的供應商 + $new_sup_cnt = count($supplier_arr) - count($bsid_arr); + if ($new_sup_cnt > 0) $next_sup_id = max($sup_id_arr)+1; + $idx = 0; + for ($i=0; $i 0 && $bsid_arr[$i] == "") { // 新增 + $target_file_be = $target_file_ar = ""; + if ($_FILES["supplier_attatch_be"]["name"]) { // 有上傳檔案 + if ($_FILES["supplier_attatch_be"]["name"][$idx] && ($_FILES["supplier_attatch_be"]["error"][$idx] == 0)) { + $file_name = $_FILES["supplier_attatch_be"]["name"][$idx]; + $temp_file_name = $_FILES["supplier_attatch_be"]["tmp_name"][$idx]; + $file_size = $_FILES["supplier_attatch_be"]["size"][$idx]; + $target_dir = "bargain-uploads/supplier/"; + $target_file_be = strtolower($target_dir.$bargainno."-".$next_sup_id."-".basename($file_name)); + $upload_ok = 1; + $img_file_type = pathinfo($target_file_be, PATHINFO_EXTENSION); + $upload_res_be = move_uploaded_file($temp_file_name, $target_file_be); + } + } + if ($_FILES["supplier_attatch_ar"]["name"]) { // 有上傳檔案 + if ($_FILES["supplier_attatch_ar"]["name"][$idx] && ($_FILES["supplier_attatch_ar"]["error"][$idx] == 0)) { + $file_name = $_FILES["supplier_attatch_ar"]["name"][$idx]; + $temp_file_name = $_FILES["supplier_attatch_ar"]["tmp_name"][$idx]; + $file_size = $_FILES["supplier_attatch_ar"]["size"][$idx]; + $target_dir = "bargain-uploads/supplier/"; + $target_file_ar = strtolower($target_dir.$bargainno."-".$next_sup_id."-".basename($file_name)); + $upload_ok = 1; + $img_file_type = pathinfo($target_file_ar, PATHINFO_EXTENSION); + $upload_res_ar = move_uploaded_file($temp_file_name, $target_file_ar); + } + } + if ($upload_res_be || $upload_res_ar) $idx++; + if (($target_file_be && !$upload_res_be) || ($target_file_ar && !$upload_res_ar)) { + echo ""; + } + $db_query = "insert into bargain_supplier (bid, supplier_id, supplier, supplier_attatch_be, quote_amt_be, note_be, "; + $db_query .= "supplier_attatch_ar, quote_amt_ar, note_ar, creater, create_at) values ("; + $db_query .= "'$id', '$next_sup_id', '$supplier_arr[$i]', '$target_file_be', '$quote_amt_be_arr[$i]', '$note_be_arr[$i]', "; + $db_query .= "'$target_file_ar', '$quote_amt_ar_arr[$i]', '$note_ar_arr[$i]', '$user_id', '$create_at')"; + $result = mysqli_query($link, $db_query); + $next_sup_id++; + } else { // 修改(不支援重傳檔案) + $db_query = "update bargain_supplier set supplier = '$supplier_arr[$i]', quote_amt_be = '$quote_amt_be_arr[$i]', "; + $db_query .= "note_be = '$note_be_arr[$i]', quote_amt_ar = '$quote_amt_ar_arr[$i]', "; + $db_query .= "note_ar = '$note_ar_arr[$i]', create_at = '$create_at' "; + $db_query .= "where id = '$bsid_arr[$i]'"; + $result = mysqli_query($link, $db_query); + } + } + } + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/board-create.php b/wms/board-create.php index e4bd345a..2db0fa67 100644 --- a/wms/board-create.php +++ b/wms/board-create.php @@ -1,51 +1,80 @@ - - -
-Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } -} -*/ -?> - -
" enctype="multipart/form-data"> -
- - -
- -
- -
- -
-
-
-
- -
-
- -
- -
-
- + + +
+ Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } +} +*/ + ?> + +
" enctype="multipart/form-data"> +
+
+
+ + +
+
+ +
+ +
+
+
+
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + +
+
+ +
+ + \ No newline at end of file diff --git a/wms/board-delete.php b/wms/board-delete.php index 1c9d73d9..808cf094 100644 --- a/wms/board-delete.php +++ b/wms/board-delete.php @@ -1,23 +1,23 @@ - \ No newline at end of file diff --git a/wms/board-edit.php b/wms/board-edit.php index e9f2f168..2e8c49b5 100644 --- a/wms/board-edit.php +++ b/wms/board-edit.php @@ -1,60 +1,60 @@ - - -
-
-
- - -
- -
- - -
-
- - -
- -
-
-
-
- -
-
-
- -
- -
-
- + +
+
+
+ + +
+ +
+ + +
+
+ + +
+ +
+
+
+
+ +
+
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/wms/board-file.php b/wms/board-file.php index 58d57ce8..4628950a 100644 --- a/wms/board-file.php +++ b/wms/board-file.php @@ -1,19 +1,19 @@ -"; - echo "alert('檔案下載失敗!');"; - echo ""; - header("Refresh:0; url=board-index.php?function_name=board&".$token_link); -} -ob_end_flush(); +"; + echo "alert('檔案下載失敗!');"; + echo ""; + header("Refresh:0; url=board-index.php?function_name=board&".$token_link); +} +ob_end_flush(); ?> \ No newline at end of file diff --git a/wms/board-index.php b/wms/board-index.php index c3dd41a6..80932de7 100644 --- a/wms/board-index.php +++ b/wms/board-index.php @@ -1,108 +1,201 @@ - - - - -

- - - -

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
項次主旨附件建檔人建檔時間關閉公告
-

- - - - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; + + + + +

+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
項次主旨附件建檔人建檔時間關閉公告
+ +

+ + + + + +

+
+
+ + + + + + + +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; ?> \ No newline at end of file diff --git a/wms/board-record-submit.php b/wms/board-record-submit.php index d3adb28b..355be238 100644 --- a/wms/board-record-submit.php +++ b/wms/board-record-submit.php @@ -1,52 +1,53 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - - function get_basename($filename) { - return preg_replace('/^.+[\\\\\\/]/', '', $filename); - } - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "board-attach/"; - $target_file1 = strtolower($target_dir.get_basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - if (file_exists($target_file1)) unlink($target_file1); - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - } else $target_file1 = ""; - - - if ($target_file1 && !$upload_res_1) { - echo ""; - } - - $db_query = "insert into board (title, content, attach, pin, creater, create_at) values ("; - $db_query .= "'$title', '$content', '$target_file1', '1', '".$user_id."', NOW())"; - $result = mysqli_query($link, $db_query); - if (mysqli_affected_rows($link) > 0) { - echo ""; - } elseif (mysqli_affected_rows($link)==0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } - - mysqli_close($link); -} + $v) { + // $$k = htmlspecialchars(stripslashes(trim($v))); + $$k = trim($v); + } + + function get_basename($filename) { + return preg_replace('/^.+[\\\\\\/]/', '', $filename); + } + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "board-attach/"; + $target_file1 = strtolower($target_dir.get_basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + if (file_exists($target_file1)) unlink($target_file1); + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + } else $target_file1 = ""; + + + if ($target_file1 && !$upload_res_1) { + echo ""; + } + + $db_query = "insert into board (title, content, attach, pin, creater, create_at) values ("; + $db_query .= "'$title', '$content', '$target_file1', '1', '".$user_id."', NOW())"; + $result = mysqli_query($link, $db_query); + if (mysqli_affected_rows($link) > 0) { + echo ""; + } elseif (mysqli_affected_rows($link)==0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } + + mysqli_close($link); +} ?> \ No newline at end of file diff --git a/wms/board-record-update.php b/wms/board-record-update.php index e11ff195..89341386 100644 --- a/wms/board-record-update.php +++ b/wms/board-record-update.php @@ -1,52 +1,52 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - //print_r($_POST); - //print_r($_FILES);exit; - - function get_basename($filename) { - return preg_replace('/^.+[\\\\\\/]/', '', $filename); - } - - $pin = ($pin == "Y") ? "99" : "1"; - $sql_atta = ""; - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "board-attach/"; - $target_file1 = strtolower($target_dir.get_basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - if (file_exists($target_file1)) unlink($target_file1); - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - $sql_atta .= "path = '$target_file1', "; - } else $target_file1 = ""; - - if ($target_file1 && !$upload_res_1) { - echo ""; - } - - $db_query = "update board set title = '$title', pin = '$pin', "; - $db_query .= $sql_atta; - $db_query .= "content = '$content'"; - $db_query .= "where id = '$id'"; - $result = mysqli_query($link, $db_query); - - mysqli_close($link); - - echo ""; -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + //print_r($_POST); + //print_r($_FILES);exit; + + function get_basename($filename) { + return preg_replace('/^.+[\\\\\\/]/', '', $filename); + } + + $pin = ($pin == "Y") ? "99" : "1"; + $sql_atta = ""; + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "board-attach/"; + $target_file1 = strtolower($target_dir.get_basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + if (file_exists($target_file1)) unlink($target_file1); + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + $sql_atta .= "path = '$target_file1', "; + } else $target_file1 = ""; + + if ($target_file1 && !$upload_res_1) { + echo ""; + } + + $db_query = "update board set title = '$title', pin = '$pin', "; + $db_query .= $sql_atta; + $db_query .= "content = '$content'"; + $db_query .= "where id = '$id'"; + $result = mysqli_query($link, $db_query); + + mysqli_close($link); + + echo ""; +} ?> \ No newline at end of file diff --git a/wms/change-password-update.php b/wms/change-password-update.php index ffdaa8ed..489350b0 100644 --- a/wms/change-password-update.php +++ b/wms/change-password-update.php @@ -1,48 +1,48 @@ - 0) { - $sql_query = "UPDATE account set pwd = '$new_pwd' where ((accountid = '$user_id') and (pwd = '$old_pwd'))"; - mysqli_query($link, $sql_query); - $result_message = " - - "; - } else { - $result_message = " - - "; - } - echo $result_message; -} - -mysqli_close($link); -?> - + "; + } else { + $result_message = " + + "; + } + echo $result_message; +} + +mysqli_close($link); +?> + \ No newline at end of file diff --git a/wms/change-password.php b/wms/change-password.php index 363eb337..8a221d76 100644 --- a/wms/change-password.php +++ b/wms/change-password.php @@ -1,77 +1,77 @@ - - - - - - -
-
-
-
-
-
- - - -
-
變更密碼
-
-
-
-
請輸入變更前後密碼!
-
-
" method="post" enctype="multipart/form-data"> - - - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
-
-
-
- -
- + + + + + +
+
+
+
+
+
+ + + +
+
變更密碼
+
+
+
+
請輸入變更前後密碼!
+
+
" method="post" enctype="multipart/form-data"> + + + +
+
+ + + + +
+
+
+
+ + + + +
+
+
+ +
+
+
+
+
+ +
+ \ No newline at end of file diff --git a/wms/combo-create.php b/wms/combo-create.php index 97b39d4d..f99a86df 100644 --- a/wms/combo-create.php +++ b/wms/combo-create.php @@ -1,86 +1,86 @@ - - -
- - Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } - } - */ - ?> - - - -
" enctype="multipart/form-data"> - - -
- - - -
- -
- - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - - -
- -
- - -

-
- -
- - -

-
- -
-
- -
- -
-
- - + + +
+ + Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } + } + */ + ?> + + + +
" enctype="multipart/form-data"> + + +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + + +
+ +
+ + +

+
+ +
+ + +

+
+ +
+
+ +
+ +
+
+ + diff --git a/wms/combo-delete.php b/wms/combo-delete.php index 2a8e8814..396488b7 100644 --- a/wms/combo-delete.php +++ b/wms/combo-delete.php @@ -1,12 +1,12 @@ - \ No newline at end of file diff --git a/wms/combo-edit.php b/wms/combo-edit.php index c28c0368..7c529ace 100644 --- a/wms/combo-edit.php +++ b/wms/combo-edit.php @@ -1,93 +1,93 @@ -getMessage(), "\n"; - } -*/ - foreach($data as $data) : -?> - -
-
- - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - - -
- -
- - -
- -
-
- -
- -
-
- - - +getMessage(), "\n"; + } +*/ + foreach($data as $data) : +?> + +
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+
+ +
+ +
+
+ + + diff --git a/wms/combo-index.php b/wms/combo-index.php index 64b75531..4831f536 100644 --- a/wms/combo-index.php +++ b/wms/combo-index.php @@ -1,140 +1,140 @@ - - - - -

- - - -

- -Please fill up the required field!

"; - } else { - header("Location:combo-index.php"); - } - } - -?> - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次保養套餐號部位部位類別部位類別序號保養內容是否啟用建檔人建檔時間修改刪除
-

- - - -

-
-

- - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; - + + + + +

+ + + +

+ +Please fill up the required field!

"; + } else { + header("Location:combo-index.php"); + } + } + +?> + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次保養套餐號部位部位類別部位類別序號保養內容是否啟用建檔人建檔時間修改刪除
+

+ + + +

+
+

+ + + +

+
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; + ?> \ No newline at end of file diff --git a/wms/combo-record-submit.php b/wms/combo-record-submit.php index f7994b9e..aca5529d 100644 --- a/wms/combo-record-submit.php +++ b/wms/combo-record-submit.php @@ -1,42 +1,42 @@ - 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} -?> + 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} +?> diff --git a/wms/combo-record-update.php b/wms/combo-record-update.php index a59b305b..9aef6af5 100644 --- a/wms/combo-record-update.php +++ b/wms/combo-record-update.php @@ -1,41 +1,41 @@ - 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/combo-user-input.php b/wms/combo-user-input.php index af1ef76d..6c5e5e9b 100644 --- a/wms/combo-user-input.php +++ b/wms/combo-user-input.php @@ -1,54 +1,54 @@ - - + + diff --git a/wms/contract-create.php b/wms/contract-create.php index b1241568..3e28f217 100644 --- a/wms/contract-create.php +++ b/wms/contract-create.php @@ -1,126 +1,126 @@ - - -
- - Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } - } - */ - ?> - - - -
" enctype="multipart/form-data"> - - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
-
- -
- -
- - -

-
- -
- - -

-
- -
-
- -
- -
-
- - + + +
+ + Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } + } + */ + ?> + + + +
" enctype="multipart/form-data"> + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+ + +

+
+ +
+ + +

+
+ +
+
+ +
+ +
+
+ + diff --git a/wms/contract-delete.php b/wms/contract-delete.php index 10371003..a8884d8b 100644 --- a/wms/contract-delete.php +++ b/wms/contract-delete.php @@ -1,12 +1,12 @@ - \ No newline at end of file diff --git a/wms/contract-edit.php b/wms/contract-edit.php index 9df494e6..c643d2a6 100644 --- a/wms/contract-edit.php +++ b/wms/contract-edit.php @@ -1,142 +1,142 @@ -getMessage(), "\n"; - } -*/ - foreach($data as $data) : -?> - -
-
- - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- -
- -
-
- - +getMessage(), "\n"; + } +*/ + foreach($data as $data) : +?> + +
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+
+ + diff --git a/wms/contract-index.php b/wms/contract-index.php index 8f510483..bde2374d 100644 --- a/wms/contract-index.php +++ b/wms/contract-index.php @@ -1,162 +1,162 @@ - - - - -

- - - -

-Please fill up the required field!

"; - } else { - header("Location:contract-index.php"); - } - } - -?> - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人業務聯繫人地址業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間修改
-

- - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; - -?> + + + + +

+ + + +

+Please fill up the required field!

"; + } else { + header("Location:contract-index.php"); + } + } + +?> + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人業務聯繫人地址業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間修改
+

+ + + +

+
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; + +?> diff --git a/wms/contract-record-submit.php b/wms/contract-record-submit.php index 7b6ea47e..724e430a 100644 --- a/wms/contract-record-submit.php +++ b/wms/contract-record-submit.php @@ -1,61 +1,61 @@ - 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} -?> + 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} +?> diff --git a/wms/contract-record-update.php b/wms/contract-record-update.php index fabd375f..443f06ee 100644 --- a/wms/contract-record-update.php +++ b/wms/contract-record-update.php @@ -1,50 +1,50 @@ - 0) { - echo ""; - } elseif ($affected == 0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } -} + 0) { + echo ""; + } elseif ($affected == 0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } +} ?> \ No newline at end of file diff --git a/wms/contract-user-input.php b/wms/contract-user-input.php index a9afa2f8..99d39bae 100644 --- a/wms/contract-user-input.php +++ b/wms/contract-user-input.php @@ -1,63 +1,63 @@ - + diff --git a/wms/custom-create-contract.php b/wms/custom-create-contract.php index 53351972..abc9a495 100644 --- a/wms/custom-create-contract.php +++ b/wms/custom-create-contract.php @@ -1,226 +1,226 @@ - -0) { - echo "合約添加成功"; - header('location:custom-create-facility.php?accountid='.$customerid.'&contractno='.$contractno); - exit(); - } - else{ - echo "

合約添加失敗

"; - - } - } else{ - - } - - -} - - - -?> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
- -

合約資料添加

-
" enctype="multipart/form-data"> -
-
- - - -
-
- -
-
- -
-
- - -
- -
- - -
- -
- - -
- -
- - -
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - -
- - - -
- -
-
- -
- -
-
- -
- -
- - - -
-
- - -
- - -
- - -
-
- - - + +0) { + echo "合約添加成功"; + header('location:custom-create-facility.php?accountid='.$customerid.'&contractno='.$contractno); + exit(); + } + else{ + echo "

合約添加失敗

"; + + } + } else{ + + } + + +} + + + +?> + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
+ +

合約資料添加

+
" enctype="multipart/form-data"> +
+
+ + + +
+
+ +
+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+ +
+
+ +
+ +
+
+ +
+ +
+ + + +
+
+ + +
+ + +
+ + +
+
+ + + diff --git a/wms/custom-create-facility.php b/wms/custom-create-facility.php index ea412955..7ab034b5 100644 --- a/wms/custom-create-facility.php +++ b/wms/custom-create-facility.php @@ -1,272 +1,272 @@ - -0) { - $success++; - } - - } - - echo $success; - exit(); - if($success>0){ - $jsonres['code']='200'; - return json_encode($jsonres); -// header('location:custom-create-schedule.php?accountid='.$customerid.'&contractno='.$contractno); -// exit(); - } ; - -} - -?> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間
-

作番資料添加

- -
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
-
-
- - -
- -
- - - -
- -
- - - -
- -
- - - -
-
-
-
- - -
- -
- - - -
- -
- - -
- -
- - -
- -
-
-
- - - -
- -
- - - -
- - -
- - -
- -
- - -
- -
-
-
-
-

+

-
-
-
- -
- + +0) { + $success++; + } + + } + + echo $success; + exit(); + if($success>0){ + $jsonres['code']='200'; + return json_encode($jsonres); +// header('location:custom-create-schedule.php?accountid='.$customerid.'&contractno='.$contractno); +// exit(); + } ; + +} + +?> + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間
+

作番資料添加

+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+
+
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + + +
+ +
+ + + +
+ + +
+ + +
+ +
+ + +
+ +
+
+
+
+

+

+
+
+
+ +
+ diff --git a/wms/custom-create-schedule.php b/wms/custom-create-schedule.php index 2e1400bf..c9a2dfa4 100644 --- a/wms/custom-create-schedule.php +++ b/wms/custom-create-schedule.php @@ -1,230 +1,230 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
合約號作番號客戶編號重量停數樓層數開門方式速度維修型態經度緯度地址維修人員工號維修人員姓名建檔人建檔時間
-

保養行程資料添加

-
- -
-
- - -
-
- - -
-
- - -
-
- -
-
-
-
-
- - -
- -
- - -
-
- - - -
-
- - -
- -
- - -
- -
-
- - - -
-
-

+

-
-
- -
-
- - - - - + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
帳號類型帳號密碼姓名電話地址電子郵件Line ID微信id維修ID直屬主管建檔人建檔時間
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
合約類型合約號公司名稱統一編號地址電話立約人客戶維護帳號業務聯繫人電話業務聯繫人郵件地址契約人員工號合約起始日合約終止日建檔人建檔時間
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
合約號作番號客戶編號重量停數樓層數開門方式速度維修型態經度緯度地址維修人員工號維修人員姓名建檔人建檔時間
+

保養行程資料添加

+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ + +
+ +
+ + +
+
+ + + +
+
+ + +
+ +
+ + +
+ +
+
+ + + +
+
+

+

+
+
+ +
+
+ + + + + diff --git a/wms/custom-create.php b/wms/custom-create.php index aa0aeadc..d7ae5960 100644 --- a/wms/custom-create.php +++ b/wms/custom-create.php @@ -1,383 +1,383 @@ - -0) { - header('location:custom-create-contract.php?accountid='.$accountid); - exit(); - } - elseif(mysqli_affected_rows($link)==0) { - - } - } - else{ - echo "

賬戶已經存在

"; - } - - - - - -} - -?> - - - -
-

賬號資料添加

-
" enctype="multipart/form-data"> -
-
- - -
-
- -
-
- -
-
- - - -
- -
- - -
- -
- - -
- -
- - -
-
- -
-
- - -
- -
- - - -
- -
- - -
- -
- - -
- -
- -
-
- - -
- -
- - -
- -
- - -
- -
- - -
-
- -
-
- - -
- -
- - -
- -
- - -
- -
- - -
-
- - + + + diff --git a/wms/forms-create.php b/wms/forms-create.php index 4e094632..79a10abe 100644 --- a/wms/forms-create.php +++ b/wms/forms-create.php @@ -1,46 +1,46 @@ - - -
-Please fill up the required field!

"; - } else { - echo "

Record has added successfully

"; - } -} -*/ -?> - -
" enctype="multipart/form-data"> -
- - -
- -
- -
- -
-
-
-
- -
- -
-
- + + +
+Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } +} +*/ +?> + +
" enctype="multipart/form-data"> +
+ + +
+ +
+ +
+ +
+
+
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/wms/forms-delete.php b/wms/forms-delete.php index 9ba6b8d6..ddec0a4a 100644 --- a/wms/forms-delete.php +++ b/wms/forms-delete.php @@ -1,23 +1,23 @@ - \ No newline at end of file diff --git a/wms/forms-edit.php b/wms/forms-edit.php index a488c341..f64c1034 100644 --- a/wms/forms-edit.php +++ b/wms/forms-edit.php @@ -1,45 +1,45 @@ - - -
-
-
- - -
- -
- - -
- -
-
-
-
- -
- -
-
- + +
+
+
+ + +
+ +
+ + +
+ +
+
+
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/wms/forms-file.php b/wms/forms-file.php index 6d9c9ec3..b263089d 100644 --- a/wms/forms-file.php +++ b/wms/forms-file.php @@ -1,19 +1,19 @@ -"; - echo "alert('檔案下載失敗!');"; - echo ""; - header("Refresh:0; url=forms-index.php?function_name=forms&".$token_link); -} -ob_end_flush(); +"; + echo "alert('檔案下載失敗!');"; + echo ""; + header("Refresh:0; url=forms-index.php?function_name=forms&".$token_link); +} +ob_end_flush(); ?> \ No newline at end of file diff --git a/wms/forms-index.php b/wms/forms-index.php index be0e2fa0..68bbc205 100644 --- a/wms/forms-index.php +++ b/wms/forms-index.php @@ -1,105 +1,105 @@ - - - - -

- - - -

- - - -
- - - - - - - - - - - - - - - - - - - - - - - -
項次表單名稱建檔人建檔時間關閉表單
-

- - - - - -

-
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; + + + + +

+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
項次表單名稱建檔人建檔時間關閉表單
+

+ + + + + +

+
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; ?> \ No newline at end of file diff --git a/wms/forms-record-submit.php b/wms/forms-record-submit.php index 81f49059..14ae12a4 100644 --- a/wms/forms-record-submit.php +++ b/wms/forms-record-submit.php @@ -1,48 +1,48 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "public-forms/"; - $target_file1 = strtolower($target_dir.basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - if (file_exists($target_file1)) unlink($target_file1); - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - } else $target_file1 = ""; - - - if ($target_file1 && !$upload_res_1) { - echo ""; - } - - $db_query = "insert into form_list (title, path, seq, creater, create_at) values ("; - $db_query .= "'$title', '$target_file1', '1', '$user_id', NOW())"; - $result = mysqli_query($link, $db_query); - if (mysqli_affected_rows($link) > 0) { - echo ""; - } elseif (mysqli_affected_rows($link)==0) { - echo ""; - } else { - echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); - } - - mysqli_close($link); -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "public-forms/"; + $target_file1 = strtolower($target_dir.basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + if (file_exists($target_file1)) unlink($target_file1); + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + } else $target_file1 = ""; + + + if ($target_file1 && !$upload_res_1) { + echo ""; + } + + $db_query = "insert into form_list (title, path, seq, creater, create_at) values ("; + $db_query .= "'$title', '$target_file1', '1', '$user_id', NOW())"; + $result = mysqli_query($link, $db_query); + if (mysqli_affected_rows($link) > 0) { + echo ""; + } elseif (mysqli_affected_rows($link)==0) { + echo ""; + } else { + echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link); + } + + mysqli_close($link); +} ?> \ No newline at end of file diff --git a/wms/forms-record-update.php b/wms/forms-record-update.php index 2ae482d4..63e69283 100644 --- a/wms/forms-record-update.php +++ b/wms/forms-record-update.php @@ -1,47 +1,47 @@ - $v) { - $$k = htmlspecialchars(stripslashes(trim($v))); - } - //print_r($_POST); - //print_r($_FILES);exit; - - $sql_atta = ""; - - if ($_FILES["attatch1"]["error"] == 0) { - $file_name = $_FILES["attatch1"]["name"]; - $temp_file_name = $_FILES["attatch1"]["tmp_name"]; - $file_size = $_FILES["attatch1"]["size"]; - $target_dir = "public-forms/"; - $target_file1 = strtolower($target_dir.basename($file_name)); - $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $upload_ok = 1; - if (file_exists($target_file1)) unlink($target_file1); - $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); - $sql_atta .= "path = '$target_file1', "; - } else $target_file1 = ""; - - if ($target_file1 && !$upload_res_1) { - echo ""; - } - - $db_query = "update form_list set title = '$title', "; - $db_query .= $sql_atta; - $db_query .= "seq = '$seq'"; - $db_query .= "where id = '$id'"; - $result = mysqli_query($link, $db_query); - - mysqli_close($link); - - echo ""; -} + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + //print_r($_POST); + //print_r($_FILES);exit; + + $sql_atta = ""; + + if ($_FILES["attatch1"]["error"] == 0) { + $file_name = $_FILES["attatch1"]["name"]; + $temp_file_name = $_FILES["attatch1"]["tmp_name"]; + $file_size = $_FILES["attatch1"]["size"]; + $target_dir = "public-forms/"; + $target_file1 = strtolower($target_dir.basename($file_name)); + $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); + $upload_ok = 1; + if (file_exists($target_file1)) unlink($target_file1); + $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); + $sql_atta .= "path = '$target_file1', "; + } else $target_file1 = ""; + + if ($target_file1 && !$upload_res_1) { + echo ""; + } + + $db_query = "update form_list set title = '$title', "; + $db_query .= $sql_atta; + $db_query .= "seq = '$seq'"; + $db_query .= "where id = '$id'"; + $result = mysqli_query($link, $db_query); + + mysqli_close($link); + + echo ""; +} ?> \ No newline at end of file diff --git a/wms/fun_global.php b/wms/fun_global.php index aa1f8e69..11c44c8d 100644 --- a/wms/fun_global.php +++ b/wms/fun_global.php @@ -1,574 +1,601 @@ - 0) { - $column_str = implode("','", $follower_arr); - $sql_cmd .= " or ($column in ('$column_str'))"; - } - $sql_cmd .= ")"; - - $sql = "select department_id from account where accountid = '$user_id'"; - $res = mysqli_query($link, $sql); - $row = mysqli_fetch_assoc($res); - $department_id = $row["department_id"]; - if ($department_id == "20" || $department_id == "220") $sql_cmd = ""; - - return $sql_cmd; -} - - -/** - * 下屬列表 - * @param string $user_id:使用者ID - * @param array $ret:下屬ID - * @return array - */ -function find_follow($user_id, &$ret=[]) { - global $link; - - $sql = "select accountid from account where manager = '$user_id'"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_assoc($res)) { - $ret[] = $row["accountid"]; - find_follow($row["accountid"], $ret); - } - mysqli_free_result($res); - - return $ret; -} - -/** - * 上級主管排列 - * @param string $user_id:使用者ID - * @param array $ret:上級主管ID - * @return array - */ -function manage_class($user_id, &$ret=[]) { - global $link; - - $sql = "select manager from account where accountid = '$user_id'"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_assoc($res)) { - if ($row["manager"] == "M0001") return; // 董事長略過 - $ret[] = $row["manager"]; - manage_class($row["manager"], $ret); - } - mysqli_free_result($res); - - return $ret; -} - -/** - * 新梯(營銷)價審簽核順位 - * @param string $rate:破價比 - * @param string $user_id:使用者ID - * @param array $ret:簽核人ID - * @return array - * - */ -function pricereview_class($rate, $user_id, &$ret=[]) { - global $link; - - $sql = "select manager from account where accountid = '$user_id'"; - $res = mysqli_query($link, $sql); - 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"].",,"; - pricereview_class($rate, $row["manager"], $ret); - } else { - $ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人) - $ret[3] = "M0060,,"; // 業務協理 - if ($rate < 75) $ret[4] = "M0006,,"; // 總經理 - } - } - mysqli_free_result($res); - - return $ret; -} - -/** - * 汰改(契約)價審簽核順位 - * @param string $rate:破價比 - * @param string $user_id:使用者ID - * @param string $renovate_flag:REN=M1改 - * @return array - * - */ -function pricereview_renovate_class($rate, $user_id, $renovate_flag) { - global $link; - - $sql = "select manager from account where accountid = '$user_id'"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_assoc($res)) { - if ($row["manager"] == "M0001") return; // 董事長略過 - if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") { - $ret[1] = $row["manager"]; - } else { - $ret[1] = $user_id; - } - } - mysqli_free_result($res); - - if ($renovate_flag == "REN") { - if ($rate < 80) $ret[3] = "M0008"; // 詹總 - if ($rate < 60) $ret[4] = "M0006"; // 總經理 - } else { - // 全汰改 - if ($rate < 80) $ret[3] = "M0008"; // 詹總 - if ($rate < 75) $ret[4] = "M0006"; // 總經理 - } - - return $ret; -} - -/** - * 檢查使用者選單權限 - * - * @param string $user_id - * @param string $token - * @return string - */ -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']; - if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return; - - $do = ""; - $sql = "select accounttype from account where accountid = '$user_id'"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_assoc($res)) { - if ($row["accounttype"] == "E") $do = 3; // 管理員 - else { - $sql2 = "select permission from account_auth where accountid = '$user_id'"; - $res2 = mysqli_query($link, $sql2); - if ($row2 = mysqli_fetch_assoc($res2)) { - $arr = json_decode(urldecode($row2["permission"]), true); - //print_r($arr); - //echo "#".str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"]);exit; - $do = $arr[str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"])]; - } - mysqli_free_result($res2); - } - } - mysqli_free_result($res); - - if (!$do) { - echo "無權限操作,請洽管理員。"; - exit; - echo ""; - } else return $do; -} - -/** - * 員工編號對應姓名表 - * @return array - */ -function accountid2name() { - global $link; - - $arr = []; - $sql = "select accountid, name from account where accounttype in ('B','E','M')"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $arr[$row[0]] = $row[1]; - } - mysqli_free_result($res); - - return $arr; -} - -/** - * 員工信箱 - * @param array $uid 員工編號 - * @return array - */ -function accountid2email($uid) { - global $link; - - if (is_array($uid)) $accountid = implode("','", $uid); - else $accountid = $uid; - if (empty($accountid)) return; - - $arr = []; - $sql = "select accountid, email from account where accountid in ('$accountid') and accounttype in ('B','E','M')"; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $arr[$row[0]] = $row[1]; - } - mysqli_free_result($res); - - return $arr; -} - -/** - * 寫入簽核表 - * @param string $flow_id - * @param string $id:價審單序號 - * @param string $content:卷號 - * @param string|array $user_id:下位簽核者 - * @param string $seq:順序 - */ -function do_assign($flow_id, $id, $content, $user_id, $seq=0) { - global $link; - - $tds = date("Y-m-d H:i:s"); - if ($seq == 0) { - $sql = "select appwms.nextval('form_key') form_key"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_row($res)) { - $form_key = $row[0]; - $sql2 = "insert into flow (system_id, flow_id, form_id, form_key, flow_code) values ('prm', '$flow_id', '$id', '$form_key', 'A')"; - mysqli_query($link, $sql2); - } - } else { - $sql = "select max(form_key) from flow where form_id = '$id' and flow_id = '$flow_id'"; - $res = mysqli_query($link, $sql); - $row = mysqli_fetch_row($res); - $form_key = $row[0]; - } - if (!is_array($user_id)) $user_id_arr[] = $user_id; - else $user_id_arr = $user_id; - foreach ($user_id_arr as $uk => $uval) { - if ($seq == 0) { - $sql2 = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '$seq', '$uval', '$tds')"; - mysqli_query($link, $sql2); - $sql2 = "insert into assign (form_key, seq, assigner, assign_opinion) values ('$form_key', '$seq', '$uval', '$content')"; - mysqli_query($link, $sql2); - } else { - if ($uk == 0) { - $sql2 = "update subflow set current_assigner = '$uval', update_date = '$tds' where form_key = '$form_key' and seq = '$seq'"; - mysqli_query($link, $sql2); - $affected = mysqli_affected_rows($link); - if ($affected == 0) { - $sql2 = "update subflow set seq = '$seq', current_assigner = '$uval', update_date = '$tds' where form_key = '$form_key'"; - mysqli_query($link, $sql2); - } else { - $sql2 = "delete from subflow where form_key = '$form_key' and seq < $seq"; - mysqli_query($link, $sql2); - } - } else { - $sql2 = "insert into subflow (form_key, seq, current_assigner, update_date) values ('$form_key', ($seq+1), '$uval', '$tds')"; - mysqli_query($link, $sql2); - } - $sql2 = "update assign set seq = '$seq', assigner = '$uval' where form_key = '$form_key'"; - mysqli_query($link, $sql2); - } - } -} - -/** - * 簽核結案 - * @param string $system_id - * @param string $flow_id - * @param string $id:價審單序號 - * @param string $content:卷號 - */ -function end_flow($system_id, $flow_id, $id, $content) { - global $link; - - $tds = date("Y-m-d H:i:s"); - $sql = "select max(form_key) from flow where form_id = '$id' and system_id = '$system_id' and flow_id = '$flow_id'"; - $res = mysqli_query($link, $sql); - $row = mysqli_fetch_row($res); - $form_key = $row[0]; - mysqli_free_result($res); - if ($form_key) { - $sql = "update subflow set current_assigner = '00000', update_date = '$tds' where form_key = '$form_key'"; - mysqli_query($link, $sql); - $sql = "update flow set flow_code = 'Z' where system_id = '$system_id' and flow_id = '$flow_id' and form_id = '$id' and form_key = '$form_key'"; - mysqli_query($link, $sql); - } - $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; - $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')"; - $res2 = mysqli_query($link, $sql2); - } -} - - -/** - * 員工編號轉姓名 - * @return array - */ -function accountidToName($accountid) -{ - global $link; - - $name = ""; - $sql = "select name from account where accountid = '$accountid' "; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $name = $row[0]; - } - mysqli_free_result($res); - return $name; -} - -/** - * 寫入簽核表 -- 作番大日程 wws - * @param string $form_id:作番大日程 id - * @param string $flow_code:簽核狀態 - * @param string $user_id:下位簽核者 - */ -function do_wws_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"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_row($res)) { - $form_key = $row[0]; - $sql = "insert into flow (system_id, flow_id, form_key, form_id,flow_code) values ('wws', 'wws01', '$form_key', '$form_id','$flow_code');"; - mysqli_query($link, $sql); - $sql = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '1', '$user_id', '$tds');"; - mysqli_query($link, $sql); - } -} - -/** - * 簽核表下一階段 -- 作番大日程 wws - * @param string $form_key:簽核表主鍵 - * @param string $flow_code:簽核狀態 - * @param string $user_id:下位簽核者 - */ -function do_wws_next_assign($user_id, $form_key, $flow_code) -{ - global $link; - $tds = date("Y-m-d H:i:s"); - $sql = " - UPDATE flow SET - flow_code = '$flow_code' - WHERE form_key = '$form_key' - "; - mysqli_query($link, $sql); - $sql = " - UPDATE subflow SET - current_assigner = '$user_id', - create_date = '$tds' - WHERE form_key = '$form_key' - "; - mysqli_query($link, $sql); -} - -/** - * 檢查 post 過來的值,若是空值就回傳預設的值(預設null) - * @param string $post_val:post 過來的值 - * @param string $default_val: 若post值是空值想回傳的值 - */ -function postCheck($post_val, $default_val = null) -{ - return empty($_POST[$post_val]) ? $default_val : htmlspecialchars(stripslashes(trim($_POST[$post_val]))); -} - -/** - * 寫入簽核表 -- 作番大日程 wws (汰改) - * @param string $form_id:作番大日程 id - * @param string $flow_code:簽核狀態 - * @param string $user_id:下位簽核者 - */ -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"; - $res = mysqli_query($link, $sql); - if ($row = mysqli_fetch_row($res)) { - $form_key = $row[0]; - $sql = "insert into flow (system_id, flow_id, form_key, form_id,flow_code) values ('wws', 'wws02', '$form_key', '$form_id','$flow_code');"; - mysqli_query($link, $sql); - $sql = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '1', '$user_id', '$tds');"; - mysqli_query($link, $sql); - } -} - -/** - * 員工編號轉部門代碼 - * @return array - */ -function accountidToDepartId($accountid) -{ - global $link; - - $name = ""; - $sql = "select department_id from account where accountid = '$accountid' "; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $name = $row[0]; - } - mysqli_free_result($res); - return $name; -} - -/** - * 部門代碼轉部門名稱 - * @return array - */ -function departIdToDepartName($department_id) -{ - global $link; - - $name = ""; - $sql = "select name from department where department_id = '$department_id' "; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $name = $row[0]; - } - mysqli_free_result($res); - return $name; -} - -/** - * 員工編號轉職稱id - * @return array - */ -function accountidToRoleId($accountid) -{ - global $link; - $name = ""; - $sql = " - select - d.role_id - from account AS a - LEFT JOIN department AS d - ON a.department_id = d.department_id - AND a.role_id = d.role_id - where a.accountid = '$accountid' - "; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $name = $row[0]; - } - mysqli_free_result($res); - return $name; -} - -/** - * 員工編號轉職稱名稱 - * @return array - */ -function accountidToRoleName($accountid) -{ - global $link; - $name = ""; - $sql = " - select - d.role - from account AS a - LEFT JOIN department AS d - ON a.department_id = d.department_id - AND a.role_id = d.role_id - where a.accountid = '$accountid' - "; - $res = mysqli_query($link, $sql); - while ($row = mysqli_fetch_row($res)) { - $name = $row[0]; - } - mysqli_free_result($res); - return $name; -} - -/** - * 組電梯規格名稱 - * @param array $arr:[電梯種類,人乘/載重,停數,開門方式,速度] - * @return string 規格名,載重 - */ -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]; - switch ($kind) { - case "MAQ100": - $weight = $seat2weight_arr[$seat]; - $ret = $kind."-".$weight."-".$stop."-".$op.$speed; - break; - case "MAP100": - $weight = $seat2weight_arr[$seat]; - $ret = $kind."-".$weight."*".$stop."-".$op.$speed; - break; - case "MAM200": - case "MAH100": - $weight = $seat2weight_arr[$seat]; - $ret = $kind."-".$seat."*".$stop."-".$op.$speed; - break; - case "MAF100": - $weight = $seat; - $ret = $kind."-".$seat."*".$stop."-".$op.$speed; - break; - case "MAE100": - $weight = $seat2weight_arr[$seat]; - $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; - break; - default: - $weight = $ret = ""; - } - return $ret.",".$weight; -} - -/** - * 最新簽核進度 - * @param array $arr:[簽核人1,簽核人2,簽核人3,簽核人4] - * @return array 進度,下位審批人 - */ -function sign_status($arr) { - $ret = []; - foreach ($arr as $k => $sign) { - $sign_nos = 0; - $sign_nt_arr = []; - $sign_arr = explode("<##>", $sign); - foreach ($sign_arr as $v) { - if (strlen($v) == 7) { - $sign_nos++; - $sign_nt_arr[] = str_replace(",,", "", $v); - } - } - if (count($sign_arr) == $sign_nos) { - $ret["sign_st"] = $k+1; - $ret["sign_nt"] = $sign_nt_arr; - return $ret; - } - } - if (empty($ret)) { - $ret["sign_st"] = 99; // 已審完 - $ret["sign_nt"] = ""; - } - return $ret; -} - -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']; -} \ No newline at end of file + 0) { + $column_str = implode("','", $follower_arr); + $sql_cmd .= " or ($column in ('$column_str'))"; + } + $sql_cmd .= ")"; + + $sql = "select department_id from account where accountid = '$user_id'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_assoc($res); + $department_id = $row["department_id"]; + if ($department_id == "20" || $department_id == "220") $sql_cmd = ""; + + return $sql_cmd; +} + + +/** + * 下屬列表 + * @param string $user_id:使用者ID + * @param array $ret:下屬ID + * @return array + */ +function find_follow($user_id, &$ret = []) +{ + global $link; + + $sql = "select accountid from account where manager = '$user_id'"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + $ret[] = $row["accountid"]; + find_follow($row["accountid"], $ret); + } + mysqli_free_result($res); + + return $ret; +} + +/** + * 上級主管排列 + * @param string $user_id:使用者ID + * @param array $ret:上級主管ID + * @return array + */ +function manage_class($user_id, &$ret = []) +{ + global $link; + + $sql = "select manager from account where accountid = '$user_id'"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + if ($row["manager"] == "M0001") return; // 董事長略過 + $ret[] = $row["manager"]; + manage_class($row["manager"], $ret); + } + mysqli_free_result($res); + + return $ret; +} + +/** + * 新梯(營銷)價審簽核順位 + * @param string $rate:破價比 + * @param string $user_id:使用者ID + * @param array $ret:簽核人ID + * @return array + * + */ +function pricereview_class($rate, $user_id, &$ret = []) +{ + global $link; + + $sql = "select manager from account where accountid = '$user_id'"; + $res = mysqli_query($link, $sql); + 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"] . ",,"; + pricereview_class($rate, $row["manager"], $ret); + } else { + $ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人) + $ret[3] = "M0060,,"; // 業務協理 + if ($rate < 75) $ret[4] = "M0006,,"; // 總經理 + } + } + mysqli_free_result($res); + + return $ret; +} + +/** + * 汰改(契約)價審簽核順位 + * @param string $rate:破價比 + * @param string $user_id:使用者ID + * @param string $renovate_flag:REN=M1改 + * @return array + * + */ +function pricereview_renovate_class($rate, $user_id, $renovate_flag) +{ + global $link; + + $sql = "select manager from account where accountid = '$user_id'"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_assoc($res)) { + if ($row["manager"] == "M0001") return; // 董事長略過 + if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") { + $ret[1] = $row["manager"]; + } else { + $ret[1] = $user_id; + } + } + mysqli_free_result($res); + + if ($renovate_flag == "REN") { + if ($rate < 80) $ret[3] = "M0008"; // 詹總 + if ($rate < 60) $ret[4] = "M0006"; // 總經理 + } else { + // 全汰改 + if ($rate < 80) $ret[3] = "M0008"; // 詹總 + if ($rate < 75) $ret[4] = "M0006"; // 總經理 + } + + return $ret; +} + +/** + * 檢查使用者選單權限 + * + * @param string $user_id + * @param string $token + * @return string + */ +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', + ]; + if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return; + + $do = ""; + $sql = "select accounttype from account where accountid = '$user_id'"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_assoc($res)) { + if ($row["accounttype"] == "E") $do = 3; // 管理員 + else { + $sql2 = "select permission from account_auth where accountid = '$user_id'"; + $res2 = mysqli_query($link, $sql2); + if ($row2 = mysqli_fetch_assoc($res2)) { + $arr = json_decode(urldecode($row2["permission"]), true); + //print_r($arr); + //echo "#".str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"]);exit; + $do = $arr[str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"])]; + } + mysqli_free_result($res2); + } + } + mysqli_free_result($res); + + if (!$do) { + // 判斷是否從藍凌過來 + if (!empty($_GET['employee_no'])) { + echo "無權限操作,請洽管理員。"; + exit; + } + echo ""; + } else return $do; +} + +/** + * 員工編號對應姓名表 + * @return array + */ +function accountid2name() +{ + global $link; + + $arr = []; + $sql = "select accountid, name from account where accounttype in ('B','E','M')"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $arr[$row[0]] = $row[1]; + } + mysqli_free_result($res); + + return $arr; +} + +/** + * 員工信箱 + * @param array $uid 員工編號 + * @return array + */ +function accountid2email($uid) +{ + global $link; + + if (is_array($uid)) $accountid = implode("','", $uid); + else $accountid = $uid; + if (empty($accountid)) return; + + $arr = []; + $sql = "select accountid, email from account where accountid in ('$accountid') and accounttype in ('B','E','M')"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $arr[$row[0]] = $row[1]; + } + mysqli_free_result($res); + + return $arr; +} + +/** + * 寫入簽核表 + * @param string $flow_id + * @param string $id:價審單序號 + * @param string $content:卷號 + * @param string|array $user_id:下位簽核者 + * @param string $seq:順序 + */ +function do_assign($flow_id, $id, $content, $user_id, $seq = 0) +{ + global $link; + + $tds = date("Y-m-d H:i:s"); + if ($seq == 0) { + $sql = "select appwms.nextval('form_key') form_key"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_row($res)) { + $form_key = $row[0]; + $sql2 = "insert into flow (system_id, flow_id, form_id, form_key, flow_code) values ('prm', '$flow_id', '$id', '$form_key', 'A')"; + mysqli_query($link, $sql2); + } + } else { + $sql = "select max(form_key) from flow where form_id = '$id' and flow_id = '$flow_id'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + $form_key = $row[0]; + } + if (!is_array($user_id)) $user_id_arr[] = $user_id; + else $user_id_arr = $user_id; + foreach ($user_id_arr as $uk => $uval) { + if ($seq == 0) { + $sql2 = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '$seq', '$uval', '$tds')"; + mysqli_query($link, $sql2); + $sql2 = "insert into assign (form_key, seq, assigner, assign_opinion) values ('$form_key', '$seq', '$uval', '$content')"; + mysqli_query($link, $sql2); + } else { + if ($uk == 0) { + $sql2 = "update subflow set current_assigner = '$uval', update_date = '$tds' where form_key = '$form_key' and seq = '$seq'"; + mysqli_query($link, $sql2); + $affected = mysqli_affected_rows($link); + if ($affected == 0) { + $sql2 = "update subflow set seq = '$seq', current_assigner = '$uval', update_date = '$tds' where form_key = '$form_key'"; + mysqli_query($link, $sql2); + } else { + $sql2 = "delete from subflow where form_key = '$form_key' and seq < $seq"; + mysqli_query($link, $sql2); + } + } else { + $sql2 = "insert into subflow (form_key, seq, current_assigner, update_date) values ('$form_key', ($seq+1), '$uval', '$tds')"; + mysqli_query($link, $sql2); + } + $sql2 = "update assign set seq = '$seq', assigner = '$uval' where form_key = '$form_key'"; + mysqli_query($link, $sql2); + } + } +} + +/** + * 簽核結案 + * @param string $system_id + * @param string $flow_id + * @param string $id:價審單序號 + * @param string $content:卷號 + */ +function end_flow($system_id, $flow_id, $id, $content) +{ + global $link; + + $tds = date("Y-m-d H:i:s"); + $sql = "select max(form_key) from flow where form_id = '$id' and system_id = '$system_id' and flow_id = '$flow_id'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + $form_key = $row[0]; + mysqli_free_result($res); + if ($form_key) { + $sql = "update subflow set current_assigner = '00000', update_date = '$tds' where form_key = '$form_key'"; + mysqli_query($link, $sql); + $sql = "update flow set flow_code = 'Z' where system_id = '$system_id' and flow_id = '$flow_id' and form_id = '$id' and form_key = '$form_key'"; + mysqli_query($link, $sql); + } + $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; + $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')"; + $res2 = mysqli_query($link, $sql2); + } +} + + +/** + * 員工編號轉姓名 + * @return array + */ +function accountidToName($accountid) +{ + global $link; + + $name = ""; + $sql = "select name from account where accountid = '$accountid' "; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $name = $row[0]; + } + mysqli_free_result($res); + return $name; +} + +/** + * 寫入簽核表 -- 作番大日程 wws + * @param string $form_id:作番大日程 id + * @param string $flow_code:簽核狀態 + * @param string $user_id:下位簽核者 + */ +function do_wws_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"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_row($res)) { + $form_key = $row[0]; + $sql = "insert into flow (system_id, flow_id, form_key, form_id,flow_code) values ('wws', 'wws01', '$form_key', '$form_id','$flow_code');"; + mysqli_query($link, $sql); + $sql = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '1', '$user_id', '$tds');"; + mysqli_query($link, $sql); + } +} + +/** + * 簽核表下一階段 -- 作番大日程 wws + * @param string $form_key:簽核表主鍵 + * @param string $flow_code:簽核狀態 + * @param string $user_id:下位簽核者 + */ +function do_wws_next_assign($user_id, $form_key, $flow_code) +{ + global $link; + $tds = date("Y-m-d H:i:s"); + $sql = " + UPDATE flow SET + flow_code = '$flow_code' + WHERE form_key = '$form_key' + "; + mysqli_query($link, $sql); + $sql = " + UPDATE subflow SET + current_assigner = '$user_id', + create_date = '$tds' + WHERE form_key = '$form_key' + "; + mysqli_query($link, $sql); +} + +/** + * 檢查 post 過來的值,若是空值就回傳預設的值(預設null) + * @param string $post_val:post 過來的值 + * @param string $default_val: 若post值是空值想回傳的值 + */ +function postCheck($post_val, $default_val = null) +{ + return empty($_POST[$post_val]) ? $default_val : htmlspecialchars(stripslashes(trim($_POST[$post_val]))); +} + +/** + * 寫入簽核表 -- 作番大日程 wws (汰改) + * @param string $form_id:作番大日程 id + * @param string $flow_code:簽核狀態 + * @param string $user_id:下位簽核者 + */ +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"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_row($res)) { + $form_key = $row[0]; + $sql = "insert into flow (system_id, flow_id, form_key, form_id,flow_code) values ('wws', 'wws02', '$form_key', '$form_id','$flow_code');"; + mysqli_query($link, $sql); + $sql = "insert into subflow (form_key, seq, current_assigner, create_date) values ('$form_key', '1', '$user_id', '$tds');"; + mysqli_query($link, $sql); + } +} + +/** + * 員工編號轉部門代碼 + * @return array + */ +function accountidToDepartId($accountid) +{ + global $link; + + $name = ""; + $sql = "select department_id from account where accountid = '$accountid' "; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $name = $row[0]; + } + mysqli_free_result($res); + return $name; +} + +/** + * 部門代碼轉部門名稱 + * @return array + */ +function departIdToDepartName($department_id) +{ + global $link; + + $name = ""; + $sql = "select name from department where department_id = '$department_id' "; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $name = $row[0]; + } + mysqli_free_result($res); + return $name; +} + +/** + * 員工編號轉職稱id + * @return array + */ +function accountidToRoleId($accountid) +{ + global $link; + $name = ""; + $sql = " + select + d.role_id + from account AS a + LEFT JOIN department AS d + ON a.department_id = d.department_id + AND a.role_id = d.role_id + where a.accountid = '$accountid' + "; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $name = $row[0]; + } + mysqli_free_result($res); + return $name; +} + +/** + * 員工編號轉職稱名稱 + * @return array + */ +function accountidToRoleName($accountid) +{ + global $link; + $name = ""; + $sql = " + select + d.role + from account AS a + LEFT JOIN department AS d + ON a.department_id = d.department_id + AND a.role_id = d.role_id + where a.accountid = '$accountid' + "; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_row($res)) { + $name = $row[0]; + } + mysqli_free_result($res); + return $name; +} + +/** + * 組電梯規格名稱 + * @param array $arr:[電梯種類,人乘/載重,停數,開門方式,速度] + * @return string 規格名,載重 + */ +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 + ]; + switch ($kind) { + case "MAQ100": + $weight = $seat2weight_arr[$seat]; + $ret = $kind . "-" . $weight . "-" . $stop . "-" . $op . $speed; + break; + case "MAP100": + $weight = $seat2weight_arr[$seat]; + $ret = $kind . "-" . $weight . "*" . $stop . "-" . $op . $speed; + break; + case "MAM200": + case "MAH100": + $weight = $seat2weight_arr[$seat]; + $ret = $kind . "-" . $seat . "*" . $stop . "-" . $op . $speed; + break; + case "MAF100": + $weight = $seat; + $ret = $kind . "-" . $seat . "*" . $stop . "-" . $op . $speed; + break; + case "MAE100": + $weight = $seat2weight_arr[$seat]; + $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; + break; + default: + $weight = $ret = ""; + } + return $ret . "," . $weight; +} + +/** + * 最新簽核進度 + * @param array $arr:[簽核人1,簽核人2,簽核人3,簽核人4] + * @return array 進度,下位審批人 + */ +function sign_status($arr) +{ + $ret = []; + foreach ($arr as $k => $sign) { + $sign_nos = 0; + $sign_nt_arr = []; + $sign_arr = explode("<##>", $sign); + foreach ($sign_arr as $v) { + if (strlen($v) == 7) { + $sign_nos++; + $sign_nt_arr[] = str_replace(",,", "", $v); + } + } + if (count($sign_arr) == $sign_nos) { + $ret["sign_st"] = $k + 1; + $ret["sign_nt"] = $sign_nt_arr; + return $ret; + } + } + if (empty($ret)) { + $ret["sign_st"] = 99; // 已審完 + $ret["sign_nt"] = ""; + } + return $ret; +} + +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']; +} diff --git a/wms/gary.php b/wms/gary.php index 90696e89..760eeae4 100644 --- a/wms/gary.php +++ b/wms/gary.php @@ -1,61 +1,123 @@ - $row) : - echo $row['accountid']."
"; - echo $J++; - if (empty($row['accountid'])) { - - $accountid = $row['contractno']; - $name = $row['custom']; - echo $sql2 = " - INSERT INTO account ( - accounttype, - accountid, - pwd, - name, - creater, - create_at - ) VALUES ( - '$accounttype', - '$accountid', - '$pwd', - '$name', - '$creater', - '$create_at' - ) - "; - echo "
"; - mysqli_query($link, $sql2); - } -endforeach; - +"; + date_default_timezone_set('Asia/Taipei'); + $currentTimestamp = time(); + $hashReferer = ""; + for ($i = -3; $i <= 3; $i++) { + $modifiedTimestamp = strtotime("$i seconds", $currentTimestamp); + $formattedTime = date("Y-m-d H:i:s", $modifiedTimestamp); + $hashReferer .= md5("https://bpm.masada.com.twMasada@2023".$formattedTime); + } + echo $hashReferer; + if (strpos($hashReferer, $referer)) { + echo "login"; + } +} else { + echo "沒有 HTTP_REFERER 資訊可用"; +} +echo "
"; +if(isset($_SERVER['HTTP_REFERER'])) { + $referrer = $_SERVER['HTTP_REFERER']; + echo "來自於: $referrer"; +} else { + echo "沒有 referrer 資訊可用"; +} +echo "
"; +if (isset($_SERVER['REMOTE_ADDR'])) { + $visitor_ip = $_SERVER['REMOTE_ADDR']; + echo "訪問者的 IP 地址是: $visitor_ip"; +} else { + echo "REMOTE_ADDR : 無法獲取訪問者的 IP 地址"; +} +echo "
"; +if (isset($_SERVER['HTTP_CLIENT_IP'])) { + $visitor_ip = $_SERVER['HTTP_CLIENT_IP']; + echo "訪問者的 IP 地址是: $visitor_ip"; +} else { + echo "HTTP_CLIENT_IP : 無法獲取訪問者的 IP 地址"; +} +echo "
"; + +if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $visitor_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + echo "訪問者的 IP 地址是: $visitor_ip"; +} else { + echo "HTTP_X_FORWARDED_FOR : 法獲取訪問者的 IP 地址"; +} +echo "
"; + + +?> + + $row) : +// echo $row['accountid']."
"; +// echo $J++; +// if (empty($row['accountid'])) { + +// $accountid = $row['contractno']; +// $name = $row['custom']; +// echo $sql2 = " +// INSERT INTO account ( +// accounttype, +// accountid, +// pwd, +// name, +// creater, +// create_at +// ) VALUES ( +// '$accounttype', +// '$accountid', +// '$pwd', +// '$name', +// '$creater', +// '$create_at' +// ) +// "; +// echo "
"; +// mysqli_query($link, $sql2); +// } +// endforeach; diff --git a/wms/gary_info.php b/wms/gary_info.php index acc92863..5218758c 100644 --- a/wms/gary_info.php +++ b/wms/gary_info.php @@ -1,3 +1,3 @@ -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } + $conn = new PDO("sqlsrv:Server=erp.masada.com.tw;Database=T8MASADA", "masada", "ztPmPP!HRoV6SL3E"); + if ($conn) { + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } } catch (PDOException $e) { - //echo "fail"; - //echo $e->getMessage(); + //echo "fail"; + //echo $e->getMessage(); } @@ -57,32 +57,32 @@ try { $token = isset($_REQUEST["token"]) ? $_REQUEST["token"] : ""; if (count(explode(".", $token)) > 1) { - $token_link = "token=" . $_REQUEST["token"]; - list($user_id, $enc_user_name, $login_dt) = explode(".", $token); - $user_name = urldecode(base64_decode($enc_user_name)); + $token_link = "token=" . $_REQUEST["token"]; + list($user_id, $enc_user_name, $login_dt) = explode(".", $token); + $user_name = urldecode(base64_decode($enc_user_name)); } else { - $referrer = isset($_GET['referer']) ? $_GET['referer'] : ""; - date_default_timezone_set('Asia/Taipei'); - $currentTimestamp = time(); - $hashReferer = ""; - for ($i = -3; $i <= 3; $i++) { - $modifiedTimestamp = strtotime("$i seconds", $currentTimestamp); - $formattedTime = date("Y-m-d H:i:s", $modifiedTimestamp); - $hashReferer .= md5("https://bpm.masada.com.twMasada@2023" . $formattedTime); - } - if (strpos($hashReferer, $referrer)) { - $user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; - $login_dt = !empty($_GET["timestamp"]) ? substr($_GET["timestamp"], 0, 10) : $login_dt; - $login_dt = date('Y-m-d H:i:s', $login_dt); - // 藍凌超連結過來 token 設置永久 - $login_dt = (date("Y") + 100) . "-12-31 23:59:59"; - $user_name = accountid2name()[$user_id]; - $token = CreateToken($user_id, $user_name); - $token_link = "token=" . $token; - } else { - echo "非法訪問!"; - echo ""; - } + $referrer = isset($_GET['referer']) ? $_GET['referer'] : ""; + date_default_timezone_set('Asia/Taipei'); + $currentTimestamp = time(); + $hashReferer = ""; + for ($i = -3; $i <= 3; $i++) { + $modifiedTimestamp = strtotime("$i seconds", $currentTimestamp); + $formattedTime = date("Y-m-d H:i:s", $modifiedTimestamp); + $hashReferer .= md5("https://bpm.masada.com.twMasada@2023" . $formattedTime); + } + if (strpos($hashReferer, $referrer)) { + $user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; + $login_dt = !empty($_GET["timestamp"]) ? substr($_GET["timestamp"], 0, 10) : $login_dt; + $login_dt = date('Y-m-d H:i:s', $login_dt); + // 藍凌超連結過來 token 設置永久 + $login_dt = (date("Y") + 100) . "-12-31 23:59:59"; + $user_name = accountid2name()[$user_id]; + $token = CreateToken($user_id, $user_name); + $token_link = "token=" . $token; + } else { + echo "非法訪問!"; + echo ""; + } } include 'IncludeCommon.php'; @@ -90,13 +90,13 @@ $includecommon = new IncludeCommon(); $accounttype = getAccounttype($link, $user_id); $login_json = null; if (strlen($accounttype) != 0) { - $jsonres['menu'] = $includecommon->menu_v3($user_id, $accounttype); - $login_json = json_encode($jsonres, JSON_UNESCAPED_UNICODE); + $jsonres['menu'] = $includecommon->menu_v3($user_id, $accounttype); + $login_json = json_encode($jsonres, JSON_UNESCAPED_UNICODE); } ?> - - - - Masada後臺系統 - - - - - - - - - + + + + + + - \ No newline at end of file + + \ No newline at end of file diff --git a/wms/header_nomenu.php b/wms/header_nomenu.php index 028b5485..43f8176a 100644 --- a/wms/header_nomenu.php +++ b/wms/header_nomenu.php @@ -1,24 +1,24 @@ -CheckToken($token); - $user_id = $result['user_id']; - $token_code = $result['code']; - $token_message = $result['message']; - - if ($token_code <> "200") { - $jsonres['code']='1'; - echo json_encode($jsonres); - } else { - $jsonres['code']='200'; - $jsonres['user_id']=$user_id; - echo json_encode($jsonres); - } -} else { - $jsonres['code']='1'; - echo json_encode($jsonres); -} +CheckToken($token); + $user_id = $result['user_id']; + $token_code = $result['code']; + $token_message = $result['message']; + + if ($token_code <> "200") { + $jsonres['code']='1'; + echo json_encode($jsonres); + } else { + $jsonres['code']='200'; + $jsonres['user_id']=$user_id; + echo json_encode($jsonres); + } +} else { + $jsonres['code']='1'; + echo json_encode($jsonres); +} ?> \ No newline at end of file diff --git a/wms/index.php b/wms/index.php index c9b3d9af..36904536 100644 --- a/wms/index.php +++ b/wms/index.php @@ -1,216 +1,216 @@ - - - - - - - - - - - - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- + + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ \ No newline at end of file diff --git a/wms/login.php b/wms/login.php index 60adcba2..0a9088bd 100644 --- a/wms/login.php +++ b/wms/login.php @@ -1,150 +1,150 @@ -displayPage(); -?> - - - - - - - - - - - Masada內部管理系統 - - - - - - - - - - - - - -
- -
登入管理系統
- -
- - - -
- -
- - -
-
- - - - - - -
-
- - - - -
-
-
-
- - - - -
-
- -
- -
- -
- - -
- - -
- -
- - - -
- - icon
- - -
Masada電梯,聰明的就懂!
- - - -
- - - - - - - +displayPage(); +?> + + + + + + + + + + + Masada內部管理系統 + + + + + + + + + + + + + +
+ +
登入管理系統
+ +
+ + + +
+ +
+ + +
+
+ + + + + + +
+
+ + + + +
+
+
+
+ + + + +
+
+ +
+ +
+ +
+ + +
+ + +
+ +
+ + + +
+ + icon
+ + +
Masada電梯,聰明的就懂!
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/wms/loginapi.php b/wms/loginapi.php index 63a1cbb2..e7386d4f 100644 --- a/wms/loginapi.php +++ b/wms/loginapi.php @@ -1,74 +1,74 @@ -CreateToken($accountid, $user_name); - $response_result =['list'=>''] ; // $includecommon->menu('tw',$accounttype); // 获取当前角色下的菜单 //P0044修改于 2023/06/13 17:40 - $response_menu = $includecommon->menu_v3($accountid, $accounttype); // 依帳號檢視功能目錄(暫時全開:menu.status=Y) - if (is_array($response_result["list"])) { - for ($i = 0; $i < count($response_result["list"]); $i++) { - $response_result["list"][$i]["path"] = $response_result["list"][$i]["path"] . "?token=" . $token; - } - } - $response_result["note"] = "success"; - $response_result["token"] = $token; - //setcookie('token',$token); - //$domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; - //setcookie('ecur', base64_encode($account), time()+86400, '/', $domain); // 加密過的登入帳號,用來做資料庫查詢 - - // 下屬員工 - $farr = []; - $sqlm = "select accountid from account where manager = '$account'"; - $res_m = mysqli_query($link, $sqlm); - while ($row_m = mysqli_fetch_row($res_m)) { - $farr[] = $row_m[0]; - } - mysqli_free_result($res_m); - - /* - $_mem["id"] = $account; // 登入帳號 - $_mem["type"] = $row["accounttype"]; // 帳號別 - $_mem["name"] = $row["name"]; // 姓名 - $_mem["follow"] = implode(",", $farr); // 下屬員工 - $_mem["login"] = date("Y-m-d H:i:s"); // 登入時間 - setcookie("_mem", serialize($_mem)); - */ - $includecommon->save_log_response('web',$account, $response_result);//创建登录日志 - $jsonres['code']='200'; - $jsonres['token']=$token; - $jsonres['name']=$user_name; - $jsonres['login']=date("Y-m-d H:i:s"); // 登入時間 - $jsonres['uid']=$account; - $jsonres['menu']=$response_menu; - echo json_encode($jsonres); - }else{ - $jsonres['code']='1'; - echo json_encode($jsonres); - } - } else { - $jsonres['code']='1'; - echo json_encode($jsonres); - } - mysqli_close($link); #代表结束连线 -} -?> +CreateToken($accountid, $user_name); + $response_result =['list'=>''] ; // $includecommon->menu('tw',$accounttype); // 获取当前角色下的菜单 //P0044修改于 2023/06/13 17:40 + $response_menu = $includecommon->menu_v3($accountid, $accounttype); // 依帳號檢視功能目錄(暫時全開:menu.status=Y) + if (is_array($response_result["list"])) { + for ($i = 0; $i < count($response_result["list"]); $i++) { + $response_result["list"][$i]["path"] = $response_result["list"][$i]["path"] . "?token=" . $token; + } + } + $response_result["note"] = "success"; + $response_result["token"] = $token; + //setcookie('token',$token); + //$domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; + //setcookie('ecur', base64_encode($account), time()+86400, '/', $domain); // 加密過的登入帳號,用來做資料庫查詢 + + // 下屬員工 + $farr = []; + $sqlm = "select accountid from account where manager = '$account'"; + $res_m = mysqli_query($link, $sqlm); + while ($row_m = mysqli_fetch_row($res_m)) { + $farr[] = $row_m[0]; + } + mysqli_free_result($res_m); + + /* + $_mem["id"] = $account; // 登入帳號 + $_mem["type"] = $row["accounttype"]; // 帳號別 + $_mem["name"] = $row["name"]; // 姓名 + $_mem["follow"] = implode(",", $farr); // 下屬員工 + $_mem["login"] = date("Y-m-d H:i:s"); // 登入時間 + setcookie("_mem", serialize($_mem)); + */ + $includecommon->save_log_response('web',$account, $response_result);//创建登录日志 + $jsonres['code']='200'; + $jsonres['token']=$token; + $jsonres['name']=$user_name; + $jsonres['login']=date("Y-m-d H:i:s"); // 登入時間 + $jsonres['uid']=$account; + $jsonres['menu']=$response_menu; + echo json_encode($jsonres); + }else{ + $jsonres['code']='1'; + echo json_encode($jsonres); + } + } else { + $jsonres['code']='1'; + echo json_encode($jsonres); + } + mysqli_close($link); #代表结束连线 +} +?> diff --git a/wms/logout.php b/wms/logout.php index 1f1adee1..26bd9cec 100644 --- a/wms/logout.php +++ b/wms/logout.php @@ -1,15 +1,15 @@ - - - + + \ No newline at end of file diff --git a/wms/maintenance.php b/wms/maintenance.php index 4498d257..aaf5757b 100644 --- a/wms/maintenance.php +++ b/wms/maintenance.php @@ -1,77 +1,77 @@ - - - - - - 維護中 - - - - - maintenancePeriod = $maintenancePeriod; - } - - public function displayPage() - { - echo '
'; - echo '

MASADA

'; - echo '

系統維護中

'; - echo '

維護時段:' . $this->maintenancePeriod . '

'; - echo '
'; - exit; - } - } - - ?> - - + + + + + + 維護中 + + + + + maintenancePeriod = $maintenancePeriod; + } + + public function displayPage() + { + echo '
'; + echo '

MASADA

'; + echo '

系統維護中

'; + echo '

維護時段:' . $this->maintenancePeriod . '

'; + echo '
'; + exit; + } + } + + ?> + + \ No newline at end of file diff --git a/wms/meeting-create.php b/wms/meeting-create.php index aa2ae4b8..ec59dddb 100644 --- a/wms/meeting-create.php +++ b/wms/meeting-create.php @@ -1,142 +1,142 @@ -'.$row2[1].''; - } - mysqli_free_result($res2); -} -mysqli_free_result($res); - -// 會議時間 -$stime_str = $etime_str = ""; -$now_min = date("i"); -if ($now_min < 30) $next_start = date("H").":30:00"; -else $next_start = date("H", strtotime("+1 hour")).":00:00"; -$next_end = date("H:i:s", strtotime("+1 hour -1 second", strtotime($next_start))); -//echo $next_start."~".$next_end; -for ($i=8; $i<24; $i++) { - $hour = str_pad($i, 2, "0", STR_PAD_LEFT); - for ($j=0; $j<2; $j++) { - $min = str_pad($j*30, 2, "0", STR_PAD_LEFT); - $stime_sel = $hour.":".$min.":00"; - $stime_str .= ''; + } + mysqli_free_result($res2); +} +mysqli_free_result($res); + +// 會議時間 +$stime_str = $etime_str = ""; +$now_min = date("i"); +if ($now_min < 30) $next_start = date("H").":30:00"; +else $next_start = date("H", strtotime("+1 hour")).":00:00"; +$next_end = date("H:i:s", strtotime("+1 hour -1 second", strtotime($next_start))); +//echo $next_start."~".$next_end; +for ($i=8; $i<24; $i++) { + $hour = str_pad($i, 2, "0", STR_PAD_LEFT); + for ($j=0; $j<2; $j++) { + $min = str_pad($j*30, 2, "0", STR_PAD_LEFT); + $stime_sel = $hour.":".$min.":00"; + $stime_str .= ''; - - $min = str_pad($j*30+29, 2, "0", STR_PAD_LEFT); - $etime_sel = $hour.":".$min.":59"; - $etime_sel_text = date("H:i", strtotime("+1 second", strtotime($etime_sel))); - $etime_str .= ''; + + $min = str_pad($j*30+29, 2, "0", STR_PAD_LEFT); + $etime_sel = $hour.":".$min.":59"; + $etime_sel_text = date("H:i", strtotime("+1 second", strtotime($etime_sel))); + $etime_str .= '