From b4b5778f162efeb59331df263e4dbf3af7215da4 Mon Sep 17 00:00:00 2001 From: "gary_chen\\gary_chen" Date: Mon, 18 Dec 2023 19:08:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E5=AE=89=E8=A3=9D?= =?UTF-8?q?=E5=A4=A7=E6=97=A5=E7=A8=8B=20edit=20=E6=8C=89=E9=88=95=202.?= =?UTF-8?q?=E5=87=BA=E8=B2=A8=E6=97=A5=E8=AA=BF=E6=95=B4=E5=96=AE=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=96=B0=E5=A2=9E=E7=B8=A3=E5=B8=82=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=BC=8F=E9=81=B8=E5=96=AE=203.=E5=87=BA=E8=B2=A8?= =?UTF-8?q?=E5=9C=B0=E5=8D=80=E9=A0=90=E5=AE=9A=E6=98=8E=E7=B4=B0=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=A8=E9=83=A8=E4=BD=9C=E7=95=AA=20?= =?UTF-8?q?=E7=9A=84=E8=A1=A8=204.index=20=E7=8B=80=E6=85=8B=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=87=9F=E6=A5=AD=E7=B6=93=E7=90=86=E7=A2=BA=E8=AA=8D?= =?UTF-8?q?=E4=B8=AD=20=E7=9A=84=E9=81=B8=E9=A0=85=205.=E5=A4=A7=E6=97=A5?= =?UTF-8?q?=E7=A8=8B=E6=96=B0=E5=A2=9E=20=E6=9E=97=E9=9D=9C=E9=9B=AF=20?= =?UTF-8?q?=E6=AA=A2=E8=A6=96=E6=AC=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + wms/estimated_shipping_date_report.php | 309 +++++++++++++----- wms/wipwhole-change-contractdate-function.php | 20 ++ wms/wipwhole-change-contractdate-submit.php | 3 +- wms/wipwhole-change-contractdate.php | 10 +- wms/wipwhole-index-function.php | 11 +- wms/wipwhole-index.php | 20 +- wms/wipwhole-rec-invoice-edit.php | 44 +-- wms/wipwhole-renovate-index-function.php | 25 +- wms/wipwhole-renovate-index.php | 24 +- wms/wipwhole-renovate-rec-invoice-edit.php | 48 +-- wms/wipwholeinstall-index-function.php | 2 +- ...ipwholeinstall-renovate-index-function.php | 2 +- 13 files changed, 371 insertions(+), 148 deletions(-) diff --git a/.gitignore b/.gitignore index 3faa3b7a..31786233 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ wms/mkt/WriteOffRepair.xlsx wms/contract/images/contracts wms/test.php app/account_log/ +wms/gary2.php diff --git a/wms/estimated_shipping_date_report.php b/wms/estimated_shipping_date_report.php index a428e639..606b06b7 100644 --- a/wms/estimated_shipping_date_report.php +++ b/wms/estimated_shipping_date_report.php @@ -148,6 +148,27 @@ while ($row = $result->fetch_assoc()) { $data2[] = $row; } +$sql = " + SELECT + new_order.facility_kind, + COUNT(new_order.facility_kind) AS facility_count + FROM( + SELECT + w.facility_kind + FROM wipwholestatus AS w + WHERE 1=1 + AND status = '1' + AND contract_type = 'A' + ) AS new_order + WHERE 1 = 1 + GROUP BY new_order.facility_kind +"; +$result = mysqli_query($link, $sql); +$data4 = []; +while ($row = $result->fetch_assoc()) { + $data4[] = $row; +} + function findFacilityTypeAllCount($data2) { $count = 0; @@ -187,6 +208,20 @@ while ($row = $result->fetch_assoc()) { $data3[] = $row; } +$sql = " + SELECT + w.renovate_type + FROM wipwholestatus AS w + WHERE 1=1 + AND status = '1' + AND contract_type = 'B' +"; +$result = mysqli_query($link, $sql); +$data5 = []; +while ($row = $result->fetch_assoc()) { + $data5[] = $row; +} + // 分開計算 // $M1 = 0; @@ -222,6 +257,16 @@ foreach ($data3 as $row) { $m_type_arr[implode("+", json_decode($row['renovate_type']))]++; } +$M_count2 = count($data5); +$m_type_arr2 = []; +$m_type_arr2[''] = 0; +foreach ($data5 as $row) { + $m_type_arr2[implode("+", json_decode($row['renovate_type']))] = 0; +} +foreach ($data5 as $row) { + $m_type_arr2[implode("+", json_decode($row['renovate_type']))]++; +} + //數字轉英文(0=>A、1=>B、26=>AA...以此類推) function num2alpha($n) @@ -240,7 +285,7 @@ function alpha2num($a) $n = $n * 26 + ord($a[$i]) - 0x40; return $n - 1; } -if($_SERVER["REQUEST_METHOD"] == 'POST'){ +if ($_SERVER["REQUEST_METHOD"] == 'POST') { if ($_POST['excel_output'] == 'excel_output') { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); @@ -1183,96 +1228,186 @@ if($_SERVER["REQUEST_METHOD"] == 'POST'){ -

-
- - - - - - - - - - " . $row['facility_kind'] . ""; - } - ?> - - - - - " . getFacilityNamebyType($row['facility_kind']) . ""; - } - ?> - - - - - " . $row['facility_count'] . ""; - } - ?> - - - - - " . (round($row['facility_count'] / findFacilityTypeAllCount($data2), 4) * 100) . "%" . ""; - } - ?> - - - -
受定規格分析
代碼
機種合計
數量
百分比
-
+
+
+ + + + + + + + + + " . $row['facility_kind'] . ""; + } + ?> + + + + + " . getFacilityNamebyType($row['facility_kind']) . ""; + } + ?> + + + + + " . $row['facility_count'] . ""; + } + ?> + + + + + " . (round($row['facility_count'] / findFacilityTypeAllCount($data2), 4) * 100) . "%" . ""; + } + ?> + + + +
受定規格分析(時間區間)
代碼
機種合計
數量
百分比
+
+ +
+ + + + + + + + + + $val) { + $title_tmp = empty($key) ? '未分類' : $key; + echo ""; + } + ?> + + + + + $val) { + echo ""; + } + ?> + + + + + $val) { + echo ""; + } + ?> + + + +
舊改受訂規格分析(時間區間)
類型" . $title_tmp . "合計
數量" . $val . "
百分比" . round($val / $M_count, 4) * 100 . "%" . "100%
+
+


+
+
+ + + + + + + + + + " . $row['facility_kind'] . ""; + } + ?> + + + + + " . getFacilityNamebyType($row['facility_kind']) . ""; + } + ?> + + + + + " . $row['facility_count'] . ""; + } + ?> + + + + + " . (round($row['facility_count'] / findFacilityTypeAllCount($data4), 4) * 100) . "%" . ""; + } + ?> + + + +
受定規格分析(全部)
代碼
機種合計
數量
百分比
+
-
- - - - - - - - - - $val) { - $title_tmp = empty($key) ? '未分類' : $key; - echo ""; - } - ?> - - - - - $val) { - echo ""; - } - ?> - - - - - $val) { - echo ""; - } - ?> - - - -
舊改受訂規格分析
類型" . $title_tmp . "合計
數量" . $val . "
百分比" . round($val / $M_count, 4) * 100 . "%" . "100%
+
+ + + + + + + + + + $val) { + $title_tmp = empty($key) ? '未分類' : $key; + echo ""; + } + ?> + + + + + $val) { + echo ""; + } + ?> + + + + + $val) { + echo ""; + } + ?> + + + +
舊改受訂規格分析(全部)
類型" . $title_tmp . "合計
數量" . $val . "
百分比" . round($val / $M_count2, 4) * 100 . "%" . "100%
+