From a0ebce1a143fc557644fb34377e5be7877f6f751 Mon Sep 17 00:00:00 2001 From: Hyojin Ahn Date: Wed, 29 Apr 2026 13:30:04 -0400 Subject: [PATCH] =?UTF-8?q?v1.2.5=20-=20[INSTALL=20WAIT=20LIST]=20Preferre?= =?UTF-8?q?d=20Date=20=ED=91=9C=EC=8B=9C=20=EC=B6=94=EA=B0=80.=20-=20[INST?= =?UTF-8?q?ALL=20WAIT=20LIST]=20Assigned=20List=20=EB=8F=84=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.=20-=20[EXPORT]=20=EB=93=9C=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B2=84=20=EA=B0=80=EC=A0=B8=EC=98=AC=20=EB=95=8C=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95.=20-=20[CUSTOMER]=20?= =?UTF-8?q?=EA=B0=81=20=EC=84=B9=EC=85=98=EB=A7=88=EB=8B=A4=20SAVE=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80.=20Install=20Date,=20Ex?= =?UTF-8?q?change=20Date,=20Removal=20Date=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/assets/api/install.php | 7 ++ public_html/assets/css/main.css | 21 +++- public_html/doc/customer_detail.php | 67 +++++++++++-- public_html/doc/export_process.php | 2 + public_html/doc/install_wait_list.php | 107 +++++++++++++-------- public_html/js/install_wait_modal.js | 1 + public_html/lib/add_install_wait_modal.php | 7 +- 7 files changed, 161 insertions(+), 51 deletions(-) diff --git a/public_html/assets/api/install.php b/public_html/assets/api/install.php index 805f54a..41cb5cb 100644 --- a/public_html/assets/api/install.php +++ b/public_html/assets/api/install.php @@ -436,6 +436,7 @@ trait InstallAPI { $scheduled = intval($_POST['scheduled'] ?? 0); $cycle = intval($_POST['scheduled_cycle'] ?? 0); + $lock_date = intval($_POST['lock_date'] ?? 0); // Two-person OFF = NULL if (!$person_cnt) { @@ -453,6 +454,7 @@ trait InstallAPI { SET iw_request_at = ".($request_at ? "'{$request_at}'" : "NOW()").", iw_requested_due_date = ".($due_date ? "'{$due_date}'" : "NULL").", + iw_lock_date = '{$lock_date}', iw_request_by = ".($request_by ? "'{$request_by}'" : "NULL").", iw_request_note = ".($request_note ? "'".addslashes($request_note)."'" : "NULL").", iw_cs_note = ".($cs_note ? "'".addslashes($cs_note)."'" : "NULL").", @@ -529,6 +531,7 @@ trait InstallAPI { ifnull(mem.m_initial,'') as di_customer_driver_initial, di.di_install_date, di.di_install_time, + di.di_lock_date, di.di_wait_uid, di.di_customer_uid, di.di_accountno, @@ -603,6 +606,7 @@ trait InstallAPI { di_order_seq, di_driver_uid, di_install_date, + di_lock_date, di_wait_uid, di_customer_uid, di_customer_name, @@ -618,12 +622,14 @@ trait InstallAPI { di_oil_pickup, di_request_note, di_work_note, + di_cs_note, di_created_by ) SELECT '{$di_order_seq}', '{$di_driver_uid}', '{$di_install_date}', + iw.iw_lock_date, iw.iw_uid, iw.iw_customer_uid, iw.iw_customer_name, @@ -639,6 +645,7 @@ trait InstallAPI { iw.iw_need_oil_pickup, iw.iw_request_note, iw.iw_work_note, + iw.iw_cs_note, '{$created_by}' FROM tbl_install_waitlist iw LEFT JOIN tbl_customer c diff --git a/public_html/assets/css/main.css b/public_html/assets/css/main.css index bdbbfda..b00cd72 100644 --- a/public_html/assets/css/main.css +++ b/public_html/assets/css/main.css @@ -1833,6 +1833,10 @@ table.table-search-report .tb-list th { border-color: #ffc107; box-shadow: 0 0 0 2px rgba(255,193,7,.25); } +.wait-card.assigned { + opacity: 0.5; + pointer-events: none; +} .container-chips { cursor: pointer; display: flex; @@ -2308,6 +2312,7 @@ tr.status-X { border: 1px solid #ccc; border-radius: 10px; overflow: hidden; + width: 100%; } /* label = button */ @@ -2322,13 +2327,16 @@ tr.status-X { } .radio-segment span { - display: block; + display: flex; width: 100%; text-align: center; + align-items: center; + justify-content: center; padding: 8px 0; background: #e7e7e7; color: #333; font-weight: 500; + height: 100%; } .radio-segment input[type="radio"]:checked + span { @@ -2345,6 +2353,17 @@ tr.status-X { border-radius: 0 5px 5px 0; } +/* check box */ +.radio-segment input[type="checkbox"] { + position: absolute; + opacity: 0; + pointer-events: none; +} +.radio-segment input[type="checkbox"]:checked + span { + background: #ffca1a; + color: #333; +} + /* mobile */ @media (max-width: 768px) { .radio-segment { diff --git a/public_html/doc/customer_detail.php b/public_html/doc/customer_detail.php index b97e8c2..23dfa8a 100644 --- a/public_html/doc/customer_detail.php +++ b/public_html/doc/customer_detail.php @@ -407,7 +407,7 @@ addLog ("add", "CUSTOMER DETAIL", "VIEW", $lguserid, $query, $c_uid); $(document).ready(function(){ $(function () { - $('#c_contractdate, #c_form_eu, #c_form_corsia, #c_fpickup, #c_removaldate, #d_visitdate, #c_inactivedate, #c_switchformdate').datepicker({ + $('#c_contractdate, #c_form_eu, #c_form_corsia, #c_fpickup, #c_removaldate, #c_installdate, #c_exchangedate, #d_visitdate, #c_inactivedate, #c_switchformdate').datepicker({ dateFormat: 'yy-mm-dd', buttonImage: "/images/cal_red.png", buttonImageOnly: true, @@ -696,9 +696,7 @@ $(document).ready(function() { $('#fpna').val($(this).is(':checked')); }); - - //set initial state. $('#sfna').val($(this).is(':checked')); $('#sfna').change(function() { @@ -711,7 +709,49 @@ $(document).ready(function() { } $('#sfna').val($(this).is(':checked')); - }); + }); + + $('#inna').val($(this).is(':checked')); + + $('#inna').change(function() { + if($(this).is(":checked")) { + $(this).attr("checked", 1); + document.getElementById('c_installdate').value = ""; + } + else { + document.getElementById('c_installdate').value = ""; + } + + $('#inna').val($(this).is(':checked')); + }); + + $('#rena').val($(this).is(':checked')); + + $('#rena').change(function() { + if($(this).is(":checked")) { + $(this).attr("checked", 1); + document.getElementById('c_removaldate').value = ""; + } + else { + document.getElementById('c_removaldate').value = ""; + } + + $('#rena').val($(this).is(':checked')); + }); + + $('#exna').val($(this).is(':checked')); + + $('#exna').change(function() { + if($(this).is(":checked")) { + $(this).attr("checked", 1); + document.getElementById('c_exchangedate').value = ""; + } + else { + document.getElementById('c_exchangedate').value = ""; + } + + $('#exna').val($(this).is(':checked')); + }); }); @@ -1461,6 +1501,11 @@ $(document).ready(function() + +
+ +
+ @@ -1492,24 +1537,26 @@ $(document).ready(function() - First Install Date + First Install Date
Init
- Removal Date + Removal Date
Init
- Last Container Work Date + Last Container Work Date
Init
- - + +
+ +
@@ -1853,7 +1900,7 @@ $(document).ready(function()
- +
diff --git a/public_html/doc/export_process.php b/public_html/doc/export_process.php index 9e07006..ec52a8d 100644 --- a/public_html/doc/export_process.php +++ b/public_html/doc/export_process.php @@ -364,6 +364,8 @@ if ($actionStr == "CUSTOMER") { FROM tbl_daily d JOIN tbl_customer c ON d.d_customeruid = c.c_uid + JOIN tbl_member m + ON d.d_driveruid = m.m_uid WHERE d.d_status = 'F' AND d.d_orderdate BETWEEN '$oil_period_fromTMP' AND '$oil_period_toTMP' ORDER BY d.d_orderdate, c.c_accountno diff --git a/public_html/doc/install_wait_list.php b/public_html/doc/install_wait_list.php index ca33c4f..9fe902d 100644 --- a/public_html/doc/install_wait_list.php +++ b/public_html/doc/install_wait_list.php @@ -7,7 +7,18 @@ $where = []; if (!empty($kw_customer)) $where[] = "(iw_customer_name LIKE '%{$kw_customer}%' OR iw_address LIKE '%{$kw_customer}%' OR iw_accountno LIKE '%{$kw_customer}%' OR iw_city LIKE '%{$kw_customer}%')"; if (!empty($kw_work)) $where[] = "(iw_work_type = '{$kw_work}')"; if (!empty($_GET['kw_two_person'])) $where[] = "(iw_required_person_cnt IS NOT NULL AND iw_required_person_cnt > 0)"; -if (!empty($_GET['kw_draft'])) $where[] = "(iw_status = 'DRAFT')"; + +$statusList = []; +if (!empty($_GET['kw_waiting'])) $statusList[] = "'WAITING'"; +if (!empty($_GET['kw_draft'])) $statusList[] = "'DRAFT'"; +if (!empty($_GET['kw_assigned'])) $statusList[] = "'ASSIGNED'"; +// 기본 +if (!$statusList) { + $statusList = ["'WAITING'", "'DRAFT'"]; +} + +$statusWhere = "iw_status IN (" . implode(',', $statusList) . ")"; + if (!empty($where)) { $add_where = ' AND ' . implode(' AND ', $where); } @@ -21,8 +32,8 @@ function db_escape($jdb, $str) { $sql_cnt = " SELECT COUNT(*) FROM tbl_install_waitlist - WHERE iw_status in ('WAITING','DRAFT') - $add_where + WHERE {$statusWhere} + $add_where "; $total_count = $jdb->rQuery($sql_cnt, "Install wait list count error"); @@ -30,12 +41,20 @@ $total_count = $jdb->rQuery($sql_cnt, "Install wait list count error"); // 1) Load waitlist // ============================ $sql = " - SELECT iw.*, CONCAT(m.m_firstname, ' ', m.m_lastname) as iw_created_member + SELECT iw.*, CONCAT(m.m_firstname, ' ', m.m_lastname) as iw_created_member, di.di_install_date FROM tbl_install_waitlist iw LEFT OUTER JOIN tbl_member m - ON iw.iw_created_by = m.m_uid - WHERE iw_status in ('WAITING','DRAFT') - $add_where + ON iw.iw_created_by = m.m_uid + LEFT JOIN ( + SELECT + di_wait_uid, + MAX(di_install_date) as di_install_date + FROM tbl_daily_install + WHERE di_status != 'X' + GROUP BY di_wait_uid + ) di ON di.di_wait_uid = iw.iw_uid + WHERE {$statusWhere} + $add_where ORDER BY iw_requested_due_date ASC, iw_request_at ASC "; $rs = $jdb->nQuery($sql, "Load waitlist error"); @@ -391,6 +410,7 @@ function formatPhone($phone) { // Step3 의 기본 필드 채우기 iwRequestDate.value = data.iw_request_at?.substring(0,10) || ''; iwScheduleDate.value = data.iw_requested_due_date || ''; + document.getElementById('iwLockDate').checked = (data.iw_lock_date == 1); //iwRequestBy.value = data.iw_request_by || ''; iwRequestNote.value = data.iw_request_note || ''; iwCsNote.value = data.iw_cs_note || ''; @@ -412,8 +432,7 @@ function formatPhone($phone) { } // job label 갱신 - document.getElementById('iwStep3Title').innerText = - `Step 3 of 3 - ${data.iw_work_type} Detail`; + document.getElementById('iwStep3Title').innerText = `Step 3 of 3 - ${data.iw_work_type} Detail`; // action box 다시 그림 setStep3Title(); @@ -514,15 +533,27 @@ function formatPhone($phone) { -
- - +
+
+ + + + + +
-
+
- +
- +
+ +
+ +
+