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%
+