diff --git a/public_html/doc/customer_detail.php b/public_html/doc/customer_detail.php
index 9870f7c..4800b80 100644
--- a/public_html/doc/customer_detail.php
+++ b/public_html/doc/customer_detail.php
@@ -93,6 +93,9 @@ if ($mode == "update") {
if ($c_installdate != "N/A") $c_installdateSTR = $func -> convertFormat ($c_installdate, 3);
else $c_installdateSTR = "N/A";
+
+ if ($c_removaldate != "N/A") $c_removaldateSTR = $func -> convertFormat ($c_removaldate, 3);
+ else $c_removaldateSTR = "N/A";
//
function safeDate($val) {
@@ -1491,9 +1494,9 @@ $(document).ready(function()
-
Last Container Work Date |
+ Last Removal Date |
-
+
|
diff --git a/public_html/doc/forecast_list.php b/public_html/doc/forecast_list.php
index 8479f1a..29332bc 100644
--- a/public_html/doc/forecast_list.php
+++ b/public_html/doc/forecast_list.php
@@ -104,7 +104,6 @@ if ($count > 0) {
//$c_fullquantityR = $c_fullquantity;
-
// Get Area Info
$qry_area = "SELECT * FROM tbl_area GROUP BY a_text ORDER BY a_text ASC ";
$rt_area = $jdb->nQuery($qry_area, "list error");
@@ -138,45 +137,6 @@ while($lt_area=mysqli_fetch_array($rt_area, MYSQLI_ASSOC)) {
$area_cnt++;
}
-
-
-// Get Bin (Main Container) Info
-// 불필요 (2024.01.17)
-/*
-$bin_cnt=1;
-foreach ($arrBin AS $key=>$value)
-{
- //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]...
-
- if ($bin_cnt%2 == 0) $binSTR = "
";
- else $binSTR = "";
-
- //if ($c_maincontainerall) $checkedFlag = "checked";
- //else {
- if(is_array($c_maincontainer)) {
- $count_m = count($c_maincontainer);
- for($ia = 0; $ia < $count_m; $ia ++) {
- if ($c_maincontainer[$ia] == $key) {
- $checkedFlag = "checked";
- break;
- }
- else $checkedFlag = "";
- }
- }
- //}
-
- $c_maincontainerSTR .= "
- ".$binSTR;
- $checkedFlag = "";
- $bin_cnt++;
-}
-*/
-
-
-
if ($c_fullcycle) {
$fullcycleQRY = " AND (c_fullcycle >= $c_fullcycle) ";
$fullcycleSTR = $c_fullcycle;
@@ -259,6 +219,8 @@ $rt_driver = $jdb->fQuery($qry_driver, "fetch query error");
// ORDER BY tbl_members.m_uid DESC ";
// 중복 제거
+$uids_R = [];
+$uids_P = [];
$qryR_dupQRY = "";
if ($c_type_r == 'R') {
$orderdate = str_replace("-", "", $orderdate);
@@ -271,6 +233,7 @@ if ($c_type_r == 'R') {
$$key = $value;
}
$qryR_dupQRY = $qryR_dupQRY . $r_customeruid . ',';
+ $uids_R[] = $r_customeruid;
}
$qryR_dupQRY = $qryR_dupQRY . '0) '; // 의미없는 uid 추가
}
@@ -289,9 +252,52 @@ if ($c_type_p == 'P') {
$$key = $value;
}
$qryS_dupQRY = $qryS_dupQRY . $c_uid . ',';
+ $uids_P[] = $c_uid;
}
$qryS_dupQRY = $qryS_dupQRY . '0) '; // 의미없는 uid 추가
}
+$uids_R = array_values(array_unique($uids_R));
+$uids_P = array_values(array_unique($uids_P));
+
+$containerMap_R = [];
+
+if (!empty($uids_R)) {
+ $in = implode(',', array_map('intval', $uids_R));
+
+ $sql = "
+ SELECT cc_customer_uid, cc_type, cc_owner_type, cc_is_used, cc_has_lock, cc_has_wheel, cc_has_woodframe
+ FROM tbl_customer_container
+ WHERE cc_status = 'A'
+ AND cc_customer_uid IN ($in)
+ ORDER BY cc_customer_uid, cc_type, cc_uid
+ ";
+
+ $res = $jdb->nQuery($sql, "Load R containers error");
+
+ while ($row = mysqli_fetch_assoc($res)) {
+ $containerMap_R[$row['cc_customer_uid']][] = $row;
+ }
+}
+
+$containerMap_P = [];
+
+if (!empty($uids_P)) {
+ $in = implode(',', array_map('intval', $uids_P));
+
+ $sql = "
+ SELECT cc_customer_uid, cc_type, cc_owner_type, cc_is_used, cc_has_lock, cc_has_wheel, cc_has_woodframe
+ FROM tbl_customer_container
+ WHERE cc_status = 'A'
+ AND cc_customer_uid IN ($in)
+ ORDER BY cc_customer_uid, cc_type, cc_uid
+ ";
+
+ $res = $jdb->nQuery($sql, "Load P containers error");
+
+ while ($row = mysqli_fetch_assoc($res)) {
+ $containerMap_P[$row['cc_customer_uid']][] = $row;
+ }
+}
//total record
$query = "SELECT COUNT(c_uid) FROM tbl_customer
@@ -596,8 +602,10 @@ if ($c_type_r == 'R') {
//$c_fullquantitySTR = number_format(floatval($c_fullquantity));
$c_fullquantityActual = round(floatval($c_fullquantity + ($dDiff * $c_fullquantitydaily)));
$c_fullquantitySTR = number_format($c_fullquantityActual);
-
-
+ $customerContainers = $containerMap_R[$c_uid] ?? [];
+ ob_start();
+ include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php';
+ $containerChipsHtml = ob_get_clean();
///////////////////////
// Get This/Last year Quantity
@@ -663,6 +671,7 @@ if ($c_type_r == 'R') {
if ($c_type_p == 'P') {
+
/*
select c_accountno,c_schedule,c_scheduleday
from tbl_customer where c_schedule > '1W' AND c_schedule <= '6W'
@@ -680,13 +689,14 @@ if ($c_type_p == 'P') {
$rt_s=$jdb->nQuery($qry_s, "list error");
+
while($list=mysqli_fetch_array($rt_s, MYSQLI_ASSOC)) {
for($i=0; $i $value )
$$key = $value;
}
-
+
$c_nameSTR = str_replace("\\", "", $c_name);
$c_addressSTR = str_replace("\\", "", $c_address);
$c_containerSTR = str_replace("\\", "", $c_container);
@@ -696,7 +706,10 @@ if ($c_type_p == 'P') {
//$c_fullquantitySTR = number_format(floatval($c_fullquantity));
$c_fullquantityActual = round(floatval($c_fullquantity + ($dDiff * $c_fullquantitydaily)));
$c_fullquantitySTR = number_format($c_fullquantityActual);
-
+ $customerContainers = $containerMap_P[$c_uid] ?? [];
+ ob_start();
+ include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php';
+ $containerChipsHtml = ob_get_clean();
///////////////////////
// Get This/Last year Quantity
diff --git a/public_html/doc/install_order.php b/public_html/doc/install_order.php
index 28284f5..a5b65d0 100644
--- a/public_html/doc/install_order.php
+++ b/public_html/doc/install_order.php
@@ -1772,18 +1772,14 @@ function renderSummary(){
}
function getContainerIcon(type){
-
- switch(type){
- case 'D':
- case '3D':
- return 'bi-database-fill'; // 드럼 느낌
- case '400B':
- case '600B':
- case '600B/L':
- return 'bi-archive-fill'; // 빈 느낌
- default:
- return 'bi-box';
+ if(type === 'D'){
+ return 'bi-database-fill';
}
+
+ if(type && type.endsWith('B')){
+ return 'bi-archive-fill';
+ }
+ return 'bi-box';
}
function buildTypeChips(typeCounts){
diff --git a/public_html/doc/order_driver.php b/public_html/doc/order_driver.php
index 83948c9..40f9e8e 100644
--- a/public_html/doc/order_driver.php
+++ b/public_html/doc/order_driver.php
@@ -124,7 +124,8 @@ foreach ($rows as $list) {
$d_quantitySTR = number_format(floatval($d_quantity));
$d_quantitySUM = $d_quantitySUM + floatval($d_quantity);
-
+
+ $c_uid = $d_customeruid;
$customerContainers = $customerContainerMap[$c_uid] ?? [];
ob_start();
include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php';
@@ -210,8 +211,6 @@ foreach ($rows as $list) {
else if ($d_driveruid == $d_createruid) $d_ordertypeSTR = "class='bg-period'";
else $d_ordertypeSTR = "";
- $c_uid = $d_customeruid;
-
if ($d_fullcycleflag == 1) {
$d_fullcycleSTR = $d_fullcycleforced;
$d_fullcycleCSS = "style='color:red;'";