반환) * - customer_detail.php 와 동일한 칩 스타일 (CSS 는 부모 화면이 보유) * - AJAX 로 모달 등에 주입해서 재사용 (map.php 등) * - 각 박스는 .box-clickable[data-popup] 이라 부모의 클릭 핸들러가 편집 팝업을 연다 * ===================================================================== */ include getenv("DOCUMENT_ROOT")."/include/session_include.php"; require_once getenv("DOCUMENT_ROOT")."/assets/dbCon.php"; require_once getenv("DOCUMENT_ROOT")."/lib/customer_open_status.php"; $c_uid = isset($_GET['c_uid']) ? intval($_GET['c_uid']) : 0; // 지금 닫힘 여부 (Access Time 제목 옆 경고 배지용) $openStat = ($c_uid > 0) ? customerIsOpenNow($c_uid) : ['restricted'=>false,'open'=>true,'reason'=>'']; $closedNow = (!empty($openStat['restricted']) && empty($openStat['open'])); // Restricted 토글 현재값 $isRestricted = false; if ($c_uid > 0) { $rR = qry("SELECT c_time_restricted AS f FROM tbl_customer WHERE c_uid = $c_uid LIMIT 1"); $rowR = fetch_array($rR); $isRestricted = ($rowR && $rowR['f'] === 'Y'); } $accessTimeMap = []; $closingDays = []; if ($c_uid > 0) { $res = qry("SELECT ca_day_of_week, ca_seq, ca_open_time, ca_close_time, ca_note FROM tbl_customer_accesstime WHERE ca_customer_uid = $c_uid AND ca_status = 'A' ORDER BY ca_day_of_week, ca_seq"); while ($row = fetch_array($res)) { $accessTimeMap[(int)$row['ca_day_of_week']][] = $row; } // 지나간 휴무(종료일 < 오늘)는 제외 $res2 = qry("SELECT ccd_start_date, ccd_end_date, ccd_note FROM tbl_customer_closing_days WHERE ccd_customer_uid = $c_uid AND ccd_end_date >= CURDATE() ORDER BY ccd_start_date"); while ($row = fetch_array($res2)) { $closingDays[] = $row; } } $dowNames = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; $todayDow = (int)date('w'); // 0=Sun .. 6=Sat (서버 기준, open-status 와 동일) if (!function_exists('fmtAccT')) { function fmtAccT($t){ return $t ? substr($t, 0, 5) : ''; } } ?>