|
|
@ -1,22 +1,6 @@ |
|
|
|
<?php |
|
|
|
// ini_set('display_errors', 'on'); |
|
|
|
|
|
|
|
// 新梯 |
|
|
|
// $Adata |
|
|
|
// 出貨台數 = 有實際出貨日期 |
|
|
|
// $Adata2 |
|
|
|
// 在裝台數 = 已出貨且官檢日跟移交日都沒填日期 |
|
|
|
// $Adata3 |
|
|
|
// 工收台數 = 已出貨且官檢日或移交日其中一個有日期 |
|
|
|
|
|
|
|
// 合計 |
|
|
|
// $data |
|
|
|
// 出貨台數 = 有實際出貨日期 |
|
|
|
// $data2 |
|
|
|
// 在裝台數 = 已出貨且官檢日跟移交日都沒填日期 |
|
|
|
// $data3 |
|
|
|
// 工收台數 = 已出貨且官檢日或移交日其中一個有日期 |
|
|
|
|
|
|
|
$real_arrival_date_start = empty($_REQUEST['real_arrival_date_start']) ? date("Y") . '-01' : $_REQUEST['real_arrival_date_start']; |
|
|
|
$real_arrival_date_end = empty($_REQUEST['real_arrival_date_end']) ? date("Y-m") : $_REQUEST['real_arrival_date_end']; |
|
|
|
$radsY = SUBSTR($real_arrival_date_start, 0, 4); |
|
|
@ -26,287 +10,117 @@ $radeM = SUBSTR($real_arrival_date_end, 5, 2); |
|
|
|
|
|
|
|
include "header.php"; |
|
|
|
|
|
|
|
// 新梯-出貨台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'A' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Adata = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// 新梯-在裝台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'A' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND ( |
|
|
|
delivery_date IS NULL |
|
|
|
OR delivery_date = '' |
|
|
|
)AND ( |
|
|
|
official_check_date IS NULL |
|
|
|
OR official_check_date = '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Adata2 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// 新梯-工收台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'A' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND (( |
|
|
|
delivery_date IS NOT NULL |
|
|
|
AND delivery_date != '' |
|
|
|
)OR ( |
|
|
|
official_check_date IS NOT NULL |
|
|
|
AND official_check_date != '' |
|
|
|
)) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Adata3 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
|
|
|
|
// M1-出貨台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%M1%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$M1data = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// M1-在裝台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%M1%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND ( |
|
|
|
delivery_date IS NULL |
|
|
|
OR delivery_date = '' |
|
|
|
)AND ( |
|
|
|
official_check_date IS NULL |
|
|
|
OR official_check_date = '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$M1data2 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// M1-工收台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%M1%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND (( |
|
|
|
delivery_date IS NOT NULL |
|
|
|
AND delivery_date != '' |
|
|
|
)OR ( |
|
|
|
official_check_date IS NOT NULL |
|
|
|
AND official_check_date != '' |
|
|
|
)) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$M1data3 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
|
|
|
|
// MA-出貨台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%MA%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Madata = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// MA-在裝台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%MA%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND ( |
|
|
|
delivery_date IS NULL |
|
|
|
OR delivery_date = '' |
|
|
|
)AND ( |
|
|
|
official_check_date IS NULL |
|
|
|
OR official_check_date = '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Madata2 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// MA-工收台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND contract_type = 'B' |
|
|
|
AND renovate_type like '%MA%' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND (( |
|
|
|
delivery_date IS NOT NULL |
|
|
|
AND delivery_date != '' |
|
|
|
)OR ( |
|
|
|
official_check_date IS NOT NULL |
|
|
|
AND official_check_date != '' |
|
|
|
)) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$Madata3 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
|
|
|
|
// 合計-出貨台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$data = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// 合計-在裝台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND ( |
|
|
|
delivery_date IS NULL |
|
|
|
OR delivery_date = '' |
|
|
|
)AND ( |
|
|
|
official_check_date IS NULL |
|
|
|
OR official_check_date = '' |
|
|
|
) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$data2 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
|
|
|
|
// 合計-工收台數 |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
SUBSTR(real_arrival_date,1,4) AS year, |
|
|
|
SUBSTR(real_arrival_date,6,2) AS month, |
|
|
|
COUNT(real_arrival_date) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
)AND (( |
|
|
|
delivery_date IS NOT NULL |
|
|
|
AND delivery_date != '' |
|
|
|
)OR ( |
|
|
|
official_check_date IS NOT NULL |
|
|
|
AND official_check_date != '' |
|
|
|
)) |
|
|
|
GROUP BY year, month |
|
|
|
"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data_count = $result->num_rows; |
|
|
|
$data3 = $result->fetch_all(MYSQLI_ASSOC); |
|
|
|
// 出貨台數 |
|
|
|
function getShipping($type, $mtype, $radsY, $radsM, $year, $month) |
|
|
|
{ |
|
|
|
global $link; |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
count(*) AS all_count |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
"; |
|
|
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
|
|
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
|
|
|
// echo $sql . "<br/>"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); |
|
|
|
return $data['all_count']; |
|
|
|
} |
|
|
|
|
|
|
|
// 試車完台數 |
|
|
|
function getInstalling($type, $mtype, $radsY, $radsM, $year, $month) |
|
|
|
{ |
|
|
|
global $link; |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
count(*) AS all_count |
|
|
|
-- real_arrival_date, |
|
|
|
-- tryrun_end_date |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND ( |
|
|
|
real_arrival_date IS NOT NULL |
|
|
|
AND real_arrival_date != '' |
|
|
|
) |
|
|
|
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
AND tryrun_end_date <= '$year-$month-31' |
|
|
|
AND tryrun_end_date != '' |
|
|
|
AND tryrun_end_date IS NOT NULL |
|
|
|
"; |
|
|
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
|
|
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
|
|
|
// echo $sql."<br/>"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); |
|
|
|
return $data['all_count']; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 工收台數 |
|
|
|
function getEnding($type, $mtype, $radsY, $radsM, $year, $month) |
|
|
|
{ |
|
|
|
global $link; |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
count( |
|
|
|
* |
|
|
|
) AS all_count |
|
|
|
-- real_arrival_date, |
|
|
|
-- delivery_date, |
|
|
|
-- official_check_date |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
AND (delivery_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
OR |
|
|
|
official_check_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
) |
|
|
|
"; |
|
|
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
|
|
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
|
|
|
// echo $sql . "<br/>"; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); |
|
|
|
return $data['all_count']; |
|
|
|
} |
|
|
|
|
|
|
|
// 在裝中台數 |
|
|
|
function getInstalling2($type, $mtype, $radsY, $radsM, $year, $month) |
|
|
|
{ |
|
|
|
global $link; |
|
|
|
$sql = " |
|
|
|
SELECT |
|
|
|
count(*) AS all_count |
|
|
|
-- delivery_date, |
|
|
|
-- official_check_date |
|
|
|
FROM wipwholestatus |
|
|
|
WHERE status = '1' |
|
|
|
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31' |
|
|
|
AND ( |
|
|
|
delivery_date IS NULL |
|
|
|
OR delivery_date = '' |
|
|
|
OR delivery_date >= '$year-$month-31' |
|
|
|
) |
|
|
|
AND( |
|
|
|
official_check_date IS NULL |
|
|
|
OR official_check_date = '' |
|
|
|
OR official_check_date >= '$year-$month-31' |
|
|
|
) |
|
|
|
"; |
|
|
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
|
|
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
|
|
|
$result = mysqli_query($link, $sql); |
|
|
|
$data = mysqli_fetch_array($result, MYSQLI_ASSOC); |
|
|
|
return $data['all_count']; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
|
<form id='myForm' method='post' action='wipwhole-wipinstallstatus-index.php?<?= $token_link ?>'> |
|
|
@ -371,11 +185,11 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
$end_month = $radeM; |
|
|
|
} |
|
|
|
?> |
|
|
|
<th style='text-align:center;' colspan="<?php echo $end_month * 3 ?>"><?php echo $radsYi . '年'; ?></th> |
|
|
|
<th style='text-align:center;' colspan="<?php echo $end_month * 4 ?>"><?php echo $radsYi . '年'; ?></th> |
|
|
|
<?php |
|
|
|
} |
|
|
|
?> |
|
|
|
<th style='width:200px' colspan="3" rowspan="2">總計(全部)</th> |
|
|
|
<!-- <th style='width:200px' colspan="3" rowspan="2">總計(全部)</th> --> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<!-- <th style="width:150px;"></th> --> |
|
|
@ -398,7 +212,7 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
|
|
|
|
for ($start_month; $start_month <= $end_month; $start_month++) { |
|
|
|
?> |
|
|
|
<th style='width:200px' colspan="3"><?php echo (int)$start_month . '月'; ?></th> |
|
|
|
<th style='width:200px;text-align:center;' colspan="4"><?php echo (int)$start_month . '月'; ?></th> |
|
|
|
<?php |
|
|
|
} |
|
|
|
?> |
|
|
@ -430,16 +244,17 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
?> |
|
|
|
<th style="background-color:#CECECE;">出貨</th> |
|
|
|
<th style="background-color:#DEDEDE;">工收</th> |
|
|
|
<th>在裝</th> |
|
|
|
<th style="background-color:#EEEEEE;">試車完</th> |
|
|
|
<th style="background-color:#FFFFFF;">在裝中</th> |
|
|
|
<?php |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php |
|
|
|
} |
|
|
|
?> |
|
|
|
<th style="background-color:#FF8040;">出貨</th> |
|
|
|
<!-- <th style="background-color:#FF8040;">出貨</th> |
|
|
|
<th style="background-color:#FFAF60;">工收</th> |
|
|
|
<th style="background-color:#9D9D9D;">在裝</th> |
|
|
|
<th style="background-color:#9D9D9D;">試車完</th> --> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
@ -465,40 +280,33 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
} |
|
|
|
|
|
|
|
for ($start_month; $start_month <= $end_month; $start_month++) { |
|
|
|
|
|
|
|
// 新梯出貨 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Adata as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$a_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getShipping("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#CECECE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 新梯工收 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Adata3 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$b_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getEnding("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 新梯試車完 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Adata2 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$c_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
echo "<td>$all_count</td>"; |
|
|
|
$all_count = getInstalling("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 新梯在裝中 |
|
|
|
$all_count = 0; |
|
|
|
$all_count = getInstalling2("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php |
|
|
|
} |
|
|
|
echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
// echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
// echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
?> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
@ -523,40 +331,33 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
} |
|
|
|
|
|
|
|
for ($start_month; $start_month <= $end_month; $start_month++) { |
|
|
|
|
|
|
|
// M1出貨 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($M1data as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$a_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getShipping("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#CECECE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// M1工收 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($M1data3 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$b_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getEnding("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// M1試車完 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($M1data2 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$c_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
echo "<td>$all_count</td>"; |
|
|
|
$all_count = getInstalling("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// M1在裝中 |
|
|
|
$all_count = 0; |
|
|
|
$all_count = getInstalling2("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php |
|
|
|
} |
|
|
|
echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
// echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
// echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
?> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
@ -581,40 +382,33 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
} |
|
|
|
|
|
|
|
for ($start_month; $start_month <= $end_month; $start_month++) { |
|
|
|
|
|
|
|
// MA出貨 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Madata as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$a_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getShipping("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#CECECE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// MA工收 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Madata3 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$b_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getEnding("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// MA試車完 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($Madata2 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$c_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
echo "<td>$all_count</td>"; |
|
|
|
$all_count = getInstalling("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// MA在裝中 |
|
|
|
$all_count = 0; |
|
|
|
$all_count = getInstalling2("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php |
|
|
|
} |
|
|
|
echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
// echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
// echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
?> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
@ -639,40 +433,33 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) { |
|
|
|
} |
|
|
|
|
|
|
|
for ($start_month; $start_month <= $end_month; $start_month++) { |
|
|
|
|
|
|
|
// 出貨 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($data as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$a_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getShipping("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#CECECE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 工收 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($data3 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$b_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$all_count = getEnding("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#DEDEDE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 試車完 |
|
|
|
$all_count = 0; |
|
|
|
foreach ($data2 as $row) { |
|
|
|
if ($radsYi == $row['year'] && $start_month == $row['month']) { |
|
|
|
$all_count = $row['all_count']; |
|
|
|
$c_count += $all_count; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
echo "<td>$all_count</td>"; |
|
|
|
$all_count = getInstalling("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#EEEEEE;'>$all_count</td>"; |
|
|
|
|
|
|
|
// 在裝中 |
|
|
|
$all_count = 0; |
|
|
|
$all_count = getInstalling2("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT)); |
|
|
|
echo "<td style='background-color:#FFFFFF;'>$all_count</td>"; |
|
|
|
} |
|
|
|
?> |
|
|
|
<?php |
|
|
|
} |
|
|
|
echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
// echo "<td style='background-color:#FF8040;'>$a_count</td>"; |
|
|
|
// echo "<td style='background-color:#FFAF60;'>$b_count</td>"; |
|
|
|
// echo "<td style='background-color:#9D9D9D;'>$c_count</td>"; |
|
|
|
?> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|