15 changed files with 1383 additions and 551 deletions
After Width: | Height: | Size: 276 KiB |
@ -0,0 +1,157 @@ |
|||||
|
<?php |
||||
|
require_once dirname(__FILE__) . "/../mkt/database.php"; |
||||
|
include "fun_global.php"; |
||||
|
|
||||
|
// AJAX 顯示合約明細 |
||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||
|
$form_name = $_POST['form_name']; |
||||
|
$type = $_POST['type']; |
||||
|
$mtype = $_POST['mtype']; |
||||
|
$year = $_POST['year']; |
||||
|
$month = $_POST['month']; |
||||
|
if ($form_name == 'getShipping') { |
||||
|
echo getShipping($type, $mtype, $year, $month); |
||||
|
} |
||||
|
if ($form_name == 'getInstalling') { |
||||
|
echo getInstalling($type, $mtype, $year, $month); |
||||
|
} |
||||
|
if ($form_name == 'getInstalling2') { |
||||
|
echo getInstalling2($type, $mtype, $year, $month); |
||||
|
} |
||||
|
if ($form_name == 'getQCing') { |
||||
|
echo getQCing($type, $mtype, $year, $month); |
||||
|
} |
||||
|
if ($form_name == 'getDeliverying') { |
||||
|
echo getDeliverying($type, $mtype, $year, $month); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 出貨台數 |
||||
|
function getShipping($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
* |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND ( |
||||
|
real_arrival_date IS NOT NULL |
||||
|
AND real_arrival_date != '' |
||||
|
) |
||||
|
"; |
||||
|
if(!empty($month)){ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'"; |
||||
|
}else{ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'"; |
||||
|
} |
||||
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
||||
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
||||
|
$result = mysqli_query($link, $sql); |
||||
|
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); |
||||
|
return json_encode($data, JSON_UNESCAPED_UNICODE); |
||||
|
} |
||||
|
|
||||
|
// 在裝台數 |
||||
|
function getInstalling($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
* |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND ( |
||||
|
install_start_date IS NOT NULL |
||||
|
OR install_start_date != '' |
||||
|
) |
||||
|
AND ( |
||||
|
install_end_date IS NULL |
||||
|
OR install_end_date = '' |
||||
|
) |
||||
|
"; |
||||
|
if(!empty($month)){ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'"; |
||||
|
}else{ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'"; |
||||
|
} |
||||
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
||||
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
||||
|
$result = mysqli_query($link, $sql); |
||||
|
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); |
||||
|
return json_encode($data, JSON_UNESCAPED_UNICODE); |
||||
|
} |
||||
|
|
||||
|
// 完工台數 |
||||
|
function getInstalling2($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
* |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND install_start_date IS NOT NULL |
||||
|
AND install_start_date != '' |
||||
|
AND install_end_date IS NOT NULL |
||||
|
AND install_end_date != '' |
||||
|
"; |
||||
|
if(!empty($month)){ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'"; |
||||
|
}else{ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'"; |
||||
|
} |
||||
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
||||
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
||||
|
$result = mysqli_query($link, $sql); |
||||
|
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); |
||||
|
return json_encode($data, JSON_UNESCAPED_UNICODE); |
||||
|
} |
||||
|
|
||||
|
// QC台數 |
||||
|
function getQCing($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
* |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND end_qc_date IS NOT NULL |
||||
|
AND end_qc_date != '' |
||||
|
"; |
||||
|
if(!empty($month)){ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'"; |
||||
|
}else{ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'"; |
||||
|
} |
||||
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
||||
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
||||
|
$result = mysqli_query($link, $sql); |
||||
|
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); |
||||
|
return json_encode($data, JSON_UNESCAPED_UNICODE); |
||||
|
} |
||||
|
|
||||
|
// 移交台數 |
||||
|
function getDeliverying($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
* |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND delivery_date IS NOT NULL |
||||
|
AND delivery_date != '' |
||||
|
"; |
||||
|
if(!empty($month)){ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31'"; |
||||
|
}else{ |
||||
|
$sql .= " AND real_arrival_date BETWEEN '$year-01-01' AND '$year-12-31'"; |
||||
|
} |
||||
|
$sql .= !empty($type) ? " AND contract_type = '$type'" : ""; |
||||
|
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : ""; |
||||
|
$result = mysqli_query($link, $sql); |
||||
|
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); |
||||
|
return json_encode($data, JSON_UNESCAPED_UNICODE); |
||||
|
} |
@ -0,0 +1,391 @@ |
|||||
|
<?php |
||||
|
// ini_set('display_errors', 'on'); |
||||
|
include "header.php"; |
||||
|
include "css/view/wipwhole-index.php"; |
||||
|
|
||||
|
|
||||
|
// 出貨台數 |
||||
|
function getShipping($type, $mtype, $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 '$year-$month-01' AND '$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']; |
||||
|
} |
||||
|
|
||||
|
// 在裝台數 |
||||
|
function getInstalling($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
count(*) AS all_count |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31' |
||||
|
AND ( |
||||
|
install_start_date IS NOT NULL |
||||
|
OR install_start_date != '' |
||||
|
) |
||||
|
AND ( |
||||
|
install_end_date IS NULL |
||||
|
OR install_end_date = '' |
||||
|
) |
||||
|
"; |
||||
|
$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']; |
||||
|
} |
||||
|
|
||||
|
// 完工台數 |
||||
|
function getInstalling2($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
count(*) AS all_count |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31' |
||||
|
AND install_start_date IS NOT NULL |
||||
|
AND install_start_date != '' |
||||
|
AND install_end_date IS NOT NULL |
||||
|
AND install_end_date != '' |
||||
|
"; |
||||
|
$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']; |
||||
|
} |
||||
|
|
||||
|
// QC台數 |
||||
|
function getQCing($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
count(*) AS all_count |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31' |
||||
|
AND end_qc_date IS NOT NULL |
||||
|
AND end_qc_date != '' |
||||
|
|
||||
|
"; |
||||
|
$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']; |
||||
|
} |
||||
|
|
||||
|
// 移交台數 |
||||
|
function getDeliverying($type, $mtype, $year, $month) |
||||
|
{ |
||||
|
global $link; |
||||
|
$sql = " |
||||
|
SELECT |
||||
|
count(*) AS all_count |
||||
|
FROM wipwholestatus |
||||
|
WHERE status = '1' |
||||
|
AND real_arrival_date BETWEEN '$year-$month-01' AND '$year-$month-31' |
||||
|
AND delivery_date IS NOT NULL |
||||
|
AND delivery_date != '' |
||||
|
|
||||
|
"; |
||||
|
$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']; |
||||
|
} |
||||
|
$contract_type = [ |
||||
|
'' => '新梯+汰改', |
||||
|
'A' => '新梯', |
||||
|
'B' => '汰改' |
||||
|
]; |
||||
|
foreach ($contract_type as $c_val => $c_key) { |
||||
|
|
||||
|
?> |
||||
|
|
||||
|
<div id="myModal" class="modal"> |
||||
|
<div class="back"></div> |
||||
|
<div class="modal-content"> |
||||
|
<button type="button" class="close" id="myCloseBtn">X</button> |
||||
|
<div class='col-12' style='text-align:center'> |
||||
|
<div class='row'> |
||||
|
<div class='col-12'> |
||||
|
<table id="table_detail" class="table table-bordered" style="width:100%; margin:0 auto;"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>合約號</th> |
||||
|
<th>作番號</th> |
||||
|
<th>客戶名稱</th> |
||||
|
<th>預計出貨日</th> |
||||
|
<th>試車完工日</th> |
||||
|
<th>QC合格日</th> |
||||
|
<th>官檢日</th> |
||||
|
<th>移交日</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<table class="table table-striped table-bordered" style="width:98.5%;overflow-x:auto"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th style='text-align:center;vertical-align:middle;' colspan='15'> |
||||
|
<h4>出貨完工推移表(<?php echo $c_key; ?>)</h4> |
||||
|
</th> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style='text-align:center;width:150px;vertical-align:middle;' rowspan='2'>階段台數</th> |
||||
|
<th style='text-align:center;width:150px;vertical-align:middle;' rowspan='2'>年度</th> |
||||
|
<th style='text-align:center;vertical-align:middle;' colspan='12'>月份</th> |
||||
|
<th style='text-align:center;vertical-align:middle;' rowspan='2'>合計</th> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<?php |
||||
|
for ($i = 1; $i <= 12; $i++) { |
||||
|
echo "<td style='text-align:center;'>" . $i . "月</td>"; |
||||
|
} |
||||
|
?> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<?php |
||||
|
$type_arr = [ |
||||
|
'A' => '出貨台數', |
||||
|
'B' => '在裝台數', |
||||
|
'C' => '完工台數', |
||||
|
'D' => 'QC台數', |
||||
|
'E' => '移交台數' |
||||
|
]; |
||||
|
foreach ($type_arr as $val => $key) { |
||||
|
?> |
||||
|
<tr> |
||||
|
<td style='text-align:center;vertical-align:middle;' rowspan='2'> |
||||
|
<?php |
||||
|
echo $key; |
||||
|
echo "<br/>"; |
||||
|
if ($val == 'A') |
||||
|
echo "<span style='font-size:12px;'>有出貨日</span>"; |
||||
|
if ($val == 'B') |
||||
|
echo "<span style='font-size:12px;'>有安裝開工日,沒安裝完工日</span> "; |
||||
|
if ($val == 'C') |
||||
|
echo "<span style='font-size:12px;'>有安裝完工日</span> "; |
||||
|
if ($val == 'D') |
||||
|
echo "<span style='font-size:12px;'>有QC完工日</span> "; |
||||
|
if ($val == 'E') |
||||
|
echo "<span style='font-size:12px;'>移交日</span> "; |
||||
|
?> |
||||
|
|
||||
|
</td> |
||||
|
<td>前一年度(<?php echo (date("Y") - 1); ?>)</td> |
||||
|
<?php |
||||
|
$a_count = 0; |
||||
|
$b_count = 0; |
||||
|
$c_count = 0; |
||||
|
$d_count = 0; |
||||
|
$e_count = 0; |
||||
|
for ($i = 1; $i <= 12; $i++) { |
||||
|
if ($val == 'A') { |
||||
|
$a = getShipping($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$a_count += $a; |
||||
|
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'B') { |
||||
|
$b = getInstalling($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$b_count += $b; |
||||
|
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'C') { |
||||
|
$c = getInstalling2($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$c_count += $c; |
||||
|
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'D') { |
||||
|
$d = getQCing($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$d_count += $d; |
||||
|
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'E') { |
||||
|
$e = getDeliverying($c_val, null, (date("Y") - 1), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$e_count += $e; |
||||
|
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y") - 1) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>'; |
||||
|
} |
||||
|
} |
||||
|
if ($val == 'A') { |
||||
|
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")-1) . "', '')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'B') { |
||||
|
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")-1) . "', '')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'C') { |
||||
|
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")-1) . "', '')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'D') { |
||||
|
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")-1) . "', '')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'E') { |
||||
|
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")-1) . "', '')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . '</a></td>'; |
||||
|
} |
||||
|
?> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>本年度(<?php echo date("Y"); ?>)</td> |
||||
|
<?php |
||||
|
$a_count = 0; |
||||
|
$b_count = 0; |
||||
|
$c_count = 0; |
||||
|
$d_count = 0; |
||||
|
$e_count = 0; |
||||
|
for ($i = 1; $i <= 12; $i++) { |
||||
|
if ($val == 'A') { |
||||
|
$a = getShipping($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$a_count += $a; |
||||
|
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $a . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'B') { |
||||
|
$b = getInstalling($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$b_count += $b; |
||||
|
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $b . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'C') { |
||||
|
$c = getInstalling2($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$c_count += $c; |
||||
|
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $c . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'D') { |
||||
|
$d = getQCing($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$d_count += $d; |
||||
|
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $d . '</a></td>'; |
||||
|
} |
||||
|
if ($val == 'E') { |
||||
|
$e = getDeliverying($c_val, null, (date("Y")), str_pad($i, 2, '0', STR_PAD_LEFT)); |
||||
|
$e_count += $e; |
||||
|
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '" . str_pad($i, 2, '0', STR_PAD_LEFT) . "')"; |
||||
|
echo '<td style="text-align:center;"><a class="myBtn" href="#" onclick="' . $onclick . '">' . $e . '</a></td>'; |
||||
|
} |
||||
|
} |
||||
|
if ($val == 'A') { |
||||
|
$onclick = "showDetail('getShipping', '$c_val', '', '" . (date("Y")) . "', '')"; |
||||
|
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $a_count . ' </a></td>'; |
||||
|
} |
||||
|
if ($val == 'B') { |
||||
|
$onclick = "showDetail('getInstalling', '$c_val', '', '" . (date("Y")) . "', '')"; |
||||
|
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $b_count . ' </a></td>'; |
||||
|
} |
||||
|
if ($val == 'C') { |
||||
|
$onclick = "showDetail('getInstalling2', '$c_val', '', '" . (date("Y")) . "', '')"; |
||||
|
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $c_count . ' </a></td>'; |
||||
|
} |
||||
|
if ($val == 'D') { |
||||
|
$onclick = "showDetail('getQCing', '$c_val', '', '" . (date("Y")) . "', '')"; |
||||
|
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $d_count . ' </a></td>'; |
||||
|
} |
||||
|
if ($val == 'E') { |
||||
|
$onclick = "showDetail('getDeliverying', '$c_val', '', '" . (date("Y")) . "', '')"; |
||||
|
echo '<td style="text-align:center;"> <a class="myBtn" href="#" onclick="' . $onclick . '">' . $e_count . ' </a></td>'; |
||||
|
} |
||||
|
?> |
||||
|
</tr> |
||||
|
<?php |
||||
|
} |
||||
|
?> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
|
||||
|
<script> |
||||
|
var modal = document.getElementById("myModal"); |
||||
|
$(".myBtn").click(function() { |
||||
|
$("#myModal").show(); |
||||
|
}); |
||||
|
$("#myCloseBtn").click(function(e) { |
||||
|
$("#myModal").hide(); |
||||
|
}); |
||||
|
$(".back").click(function(e) { |
||||
|
$("#myModal").hide(); |
||||
|
}); |
||||
|
|
||||
|
function showDetail(form_name, type, mtype, year, month) { |
||||
|
$.ajax({ |
||||
|
type: "POST", |
||||
|
dataType: "json", |
||||
|
url: "ship_run_chart-model.php", |
||||
|
data: { |
||||
|
form_name: form_name, |
||||
|
type: type, |
||||
|
mtype: mtype, |
||||
|
year: year, |
||||
|
month: month |
||||
|
}, |
||||
|
complete: function(data) { |
||||
|
console.log(data); |
||||
|
var data = data.responseJSON |
||||
|
var str = ""; |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
str += "<tr>"; |
||||
|
str += "<td>" + data[i]['contractno'] + "</td>"; |
||||
|
str += "<td>" + data[i]['facilityno'] + "</td>"; |
||||
|
str += "<td>" + data[i]['custom'] + "</td>"; |
||||
|
str += "<td>" + data[i]['real_arrival_date'] + "</td>"; |
||||
|
str += "<td>" + data[i]['tryrun_end_date'] + "</td>"; |
||||
|
str += "<td>" + data[i]['end_qc_date'] + "</td>"; |
||||
|
str += "<td>" + data[i]['official_check_date'] + "</td>"; |
||||
|
str += "<td>" + data[i]['delivery_date'] + "</td>"; |
||||
|
str += "</tr>"; |
||||
|
} |
||||
|
if ($('#table_detail').hasClass('dataTable')) { |
||||
|
dttable = $('#table_detail').dataTable(); |
||||
|
dttable.fnClearTable(); |
||||
|
dttable.fnDestroy(); |
||||
|
} |
||||
|
$("#table_detail").find("tbody").html(str); |
||||
|
$('#table_detail').dataTable(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
</script> |
||||
|
<?php |
||||
|
} |
||||
|
|
||||
|
include("footer.php"); |
||||
|
?> |
Loading…
Reference in new issue