Browse Source

1.header 重新上板(正確版本)

2.app env路徑修正
3.gitignore 新增忽略 app 登入產生的 .log
4.app 針對合約號 M220104 作假資料
gary
gary_chen\gary_chen 1 year ago
parent
commit
c18e1e26de
  1. 1
      .gitignore
  2. 101
      app/app-wipproduction-log.php
  3. 2
      app/db/database.php
  4. 9
      wms/header.php

1
.gitignore

@ -24,3 +24,4 @@ wms/excel/estimated_shipping_date_report.xlsx
wms/mkt/WriteOffRepair.xlsx wms/mkt/WriteOffRepair.xlsx
wms/contract/images/contracts wms/contract/images/contracts
wms/test.php wms/test.php
app/account_log/

101
app/app-wipproduction-log.php

@ -23,6 +23,106 @@ $data = array(); # 設置一個空陣列來放資料is
if ($user_id == 'A000000001') { if ($user_id == 'A000000001') {
$sql = "SELECT * FROM wipproduction where (facilityno = '$facilityno') order by id desc"; # sql語法存在變數中 $sql = "SELECT * FROM wipproduction where (facilityno = '$facilityno') order by id desc"; # sql語法存在變數中
} else { } else {
if (in_array($facilityno, [
'3JX01701', '3JX01702', '3JX01703', '3JX01704', '3JX01705', '3JX01706', '3JX01707', '3JX01708', '3JX01709', '3JX01710', '3JX01711'
])) {
$sql = "
SELECT
'0' AS id,
facilityno,
'2024-06-30' AS issue_time,
'生產中' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
UNION
SELECT
'1' AS id,
facilityno,
SUBSTR(estimated_shipping_date,1,10) AS issue_time,
'生產完成' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
AND estimated_shipping_date != ''
AND estimated_shipping_date IS NOT NULL
UNION
SELECT
'2' AS id,
facilityno,
SUBSTR(estimated_shipping_schedule_date,1,10) AS issue_time,
'預計攬收' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
AND estimated_shipping_schedule_date != ''
AND estimated_shipping_schedule_date IS NOT NULL
UNION
SELECT
'3' AS id,
facilityno,
SUBSTR(actual_tofactory_date,1,10) AS issue_time,
'攬收成功(桃園)' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
AND actual_tofactory_date != ''
AND actual_tofactory_date IS NOT NULL
UNION
SELECT
'4' AS id,
facilityno,
'2023-05-10' AS issue_time,
'預計出貨日' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
AND real_contract_arrival_date != ''
AND real_contract_arrival_date IS NOT NULL
UNION
SELECT
'5' AS id,
facilityno,
SUBSTR(real_arrival_date,1,10) AS issue_time,
'出貨' AS 'process',
'bg-success' AS 'light_color',
'' AS memo,
creater,
create_at
FROM wipwholestatus
WHERE facilityno = '$facilityno'
AND real_arrival_date != ''
AND real_arrival_date IS NOT NULL
ORDER BY id DESC
";
} else {
$sql = " $sql = "
SELECT SELECT
'0' AS id, '0' AS id,
@ -206,6 +306,7 @@ if ($user_id == 'A000000001') {
ORDER BY id DESC ORDER BY id DESC
"; ";
}
} }
$data = mysqli_query($link, $sql); # 用mysqli_query方法執行(sql語法)將結果存在變數中 $data = mysqli_query($link, $sql); # 用mysqli_query方法執行(sql語法)將結果存在變數中

2
app/db/database.php

@ -1,5 +1,5 @@
<?php <?php
$envFile = __DIR__ . '/../.env'; // .env 文件的路径 $envFile = dirname(dirname(dirname(__FILE__))) . '\.env'; // .env 文件的路径
if (file_exists($envFile)) { if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

9
wms/header.php

@ -1,11 +1,16 @@
<?php <?php
ini_set('display_errors', 'off'); // ini_set('display_errors', 'off');
// 維護專用 // 維護專用
// include "maintenance.php"; // include "maintenance.php";
// $maintenancePeriod = "2023-11-17 15:30 AM 至 17:30 PM"; // $maintenancePeriod = "2023-11-17 15:30 AM 至 17:30 PM";
// $maintenancePage = new MaintenancePage($maintenancePeriod); // $maintenancePage = new MaintenancePage($maintenancePeriod);
// $maintenancePage->displayPage(); // $maintenancePage->displayPage();
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
function CreateToken($user_id, $user_name) function CreateToken($user_id, $user_name)
{ {
@ -56,6 +61,7 @@ try {
*****************************/ *****************************/
$token = isset($_REQUEST["token"]) ? $_REQUEST["token"] : ""; $token = isset($_REQUEST["token"]) ? $_REQUEST["token"] : "";
if (count(explode(".", $token)) > 1) { if (count(explode(".", $token)) > 1) {
$token_link = "token=" . $_REQUEST["token"]; $token_link = "token=" . $_REQUEST["token"];
list($user_id, $enc_user_name, $login_dt) = explode(".", $token); list($user_id, $enc_user_name, $login_dt) = explode(".", $token);
@ -85,6 +91,7 @@ if (count(explode(".", $token)) > 1) {
} }
} }
include 'IncludeCommon.php'; include 'IncludeCommon.php';
$includecommon = new IncludeCommon(); $includecommon = new IncludeCommon();
$accounttype = getAccounttype($link, $user_id); $accounttype = getAccounttype($link, $user_id);

Loading…
Cancel
Save