|
@ -15,7 +15,20 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; |
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
|
|
use PhpOffice\PhpSpreadsheet\Style\Fill; |
|
|
use PhpOffice\PhpSpreadsheet\Style\Fill; |
|
|
|
|
|
|
|
|
|
|
|
function getArea($address) |
|
|
|
|
|
{ |
|
|
|
|
|
$address = mb_substr($address, 0, 2); |
|
|
|
|
|
if (in_array($address, ['宜蘭', '花蓮', '台東'])) |
|
|
|
|
|
return '宜花東'; |
|
|
|
|
|
if (in_array($address, ['臺北', '台北', '基隆', '新北'])) |
|
|
|
|
|
return '北區'; |
|
|
|
|
|
if (in_array($address, ['桃園', '新竹'])) |
|
|
|
|
|
return '桃竹'; |
|
|
|
|
|
if (in_array($address, ['南投', '臺中', '台中', '彰化', '雲林', '苗栗'])) |
|
|
|
|
|
return '中區'; |
|
|
|
|
|
if (in_array($address, ['台南', '臺南', '嘉義', '屏東', '高雄'])) |
|
|
|
|
|
return '南區'; |
|
|
|
|
|
} |
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
|
|
|
|
|
|
$contractno = empty($_POST['contractno']) ? null : $_POST['contractno']; |
|
|
$contractno = empty($_POST['contractno']) ? null : $_POST['contractno']; |
|
@ -54,9 +67,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', |
|
|
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', |
|
|
'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', |
|
|
'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', |
|
|
'AW', 'AX', 'AY', 'AZ', 'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', |
|
|
'AW', 'AX', 'AY', 'AZ', 'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', |
|
|
'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN' |
|
|
'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO' |
|
|
]; |
|
|
]; |
|
|
$colTitleArr = [ |
|
|
$colTitleArr = [ |
|
|
|
|
|
'區域', |
|
|
'合約號', |
|
|
'合約號', |
|
|
'作番號', |
|
|
'作番號', |
|
|
'客戶名稱', |
|
|
'客戶名稱', |
|
@ -268,7 +282,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$dbuilding_heigh_verify_status = !empty($status_arr[$row['building_heigh_verify']]) ? $status_arr[$row['building_heigh_verify']] : ""; |
|
|
$dbuilding_heigh_verify_status = !empty($status_arr[$row['building_heigh_verify']]) ? $status_arr[$row['building_heigh_verify']] : ""; |
|
|
// 工務 工勘確認 |
|
|
// 工務 工勘確認 |
|
|
$site_survey_contact_verify_status = !empty($site_survey_status[$row['site_survey_contact_verify']]) ? $site_survey_status[$row['site_survey_contact_verify']] : ""; |
|
|
$site_survey_contact_verify_status = !empty($site_survey_status[$row['site_survey_contact_verify']]) ? $site_survey_status[$row['site_survey_contact_verify']] : ""; |
|
|
|
|
|
|
|
|
// 生管 是否齊備確認 |
|
|
// 生管 是否齊備確認 |
|
|
$shengguanok_status = !empty($status_arr[$row['shengguanok_status']]) ? $status_arr[$row['shengguanok_status']] : ""; |
|
|
$shengguanok_status = !empty($status_arr[$row['shengguanok_status']]) ? $status_arr[$row['shengguanok_status']] : ""; |
|
|
$prattford_order_date_verify_status = !empty($status_arr[$row['prattford_order_date_verify']]) ? $status_arr[$row['prattford_order_date_verify']] : ""; |
|
|
$prattford_order_date_verify_status = !empty($status_arr[$row['prattford_order_date_verify']]) ? $status_arr[$row['prattford_order_date_verify']] : ""; |
|
@ -279,6 +293,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
$arrival_date_verify_status = !empty($status3_arr[$row['arrival_date_verify']]) ? $status3_arr[$row['arrival_date_verify']] : ""; |
|
|
$arrival_date_verify_status = !empty($status3_arr[$row['arrival_date_verify']]) ? $status3_arr[$row['arrival_date_verify']] : ""; |
|
|
|
|
|
|
|
|
$colContentArr = [ |
|
|
$colContentArr = [ |
|
|
|
|
|
getArea($row['address']), |
|
|
$row['contractno'], |
|
|
$row['contractno'], |
|
|
$row['facilityno'], |
|
|
$row['facilityno'], |
|
|
$row['custom'], |
|
|
$row['custom'], |
|
@ -345,31 +360,31 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 背景顏色為藍色 |
|
|
// 背景顏色為藍色 |
|
|
$styleA1toC1 = $sheet->getStyle('A1:L1'); |
|
|
$styleA1toC1 = $sheet->getStyle('A1:M1'); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
->getStartColor()->setRGB('8EA9DB'); |
|
|
->getStartColor()->setRGB('8EA9DB'); |
|
|
|
|
|
|
|
|
// 背景顏色為藍色 |
|
|
// 背景顏色為藍色 |
|
|
$styleA1toC1 = $sheet->getStyle('M1:W1'); |
|
|
$styleA1toC1 = $sheet->getStyle('N1:X1'); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
->getStartColor()->setRGB('BBFFEE'); |
|
|
->getStartColor()->setRGB('BBFFEE'); |
|
|
|
|
|
|
|
|
// 背景顏色為橘色 |
|
|
// 背景顏色為橘色 |
|
|
$styleA1toC1 = $sheet->getStyle('X1:AH1'); |
|
|
$styleA1toC1 = $sheet->getStyle('Y1:AI1'); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
->getStartColor()->setRGB('FFBB66'); |
|
|
->getStartColor()->setRGB('FFBB66'); |
|
|
|
|
|
|
|
|
// 背景顏色為綠色 |
|
|
// 背景顏色為綠色 |
|
|
$styleA1toC1 = $sheet->getStyle('AI1:AM1'); |
|
|
$styleA1toC1 = $sheet->getStyle('AJ1:AN1'); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
->getStartColor()->setRGB('DDFF77'); |
|
|
->getStartColor()->setRGB('DDFF77'); |
|
|
|
|
|
|
|
|
// 背景顏色為橘色 |
|
|
// 背景顏色為橘色 |
|
|
$styleA1toC1 = $sheet->getStyle('AN1:BB1'); |
|
|
$styleA1toC1 = $sheet->getStyle('AO1:BC1'); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1 = $styleA1toC1->getFill(); |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
$fillA1toC1->setFillType(Fill::FILL_SOLID) |
|
|
->getStartColor()->setRGB('FFCCCC'); |
|
|
->getStartColor()->setRGB('FFCCCC'); |
|
|