execute(); $db_results = $schemaManager->get_results(); $data_msg = insert_default_data() ? "성공" : "실패"; $menu_msg = create_admin_menu_file(); $install_result = ['db' => $db_results, 'data' => $data_msg, 'menu' => $menu_msg]; } catch (Exception $e) { $install_result['errors'][] = '설치 중 심각한 오류 발생: ' . $e->getMessage(); } } else if ($action === 'delete') { check_admin_token(); $delete_result = ['tables' => [], 'menu' => '']; $tables_to_delete = $tables_to_check; foreach ($tables_to_delete as $table) { sql_query("DROP TABLE IF EXISTS `{$table}`", false); $delete_result['tables'][] = $table; } $menu_file = G5_ADMIN_PATH . '/admin.menu850.consultant_manage.php'; if (file_exists($menu_file)) { if (@unlink($menu_file)) { $delete_result['menu'] = '메뉴 파일 삭제 성공'; } else { $delete_result['menu'] = '메뉴 파일 삭제 실패 (권한 확인 필요)'; } } } function insert_default_data() { $default_configs = [ ['consultation_duration', '60', '1회 상담 시간 (분)'], ['max_persons_per_slot', '2', '동시간대 최대 예약 인원'], ['consultation_fee', '50000', '상담 비용 (원)'], ['account_info', '국민은행 123-456-789 (주)상담센터', '상담비 입금 계좌'], ['notification_enabled', '1', '알림 발송 사용 여부'], ['auto_confirm_enabled', '0', '자동 예약 확정 사용 여부'], ['max_advance_days', '30', '최대 예약 가능 일수'], ['min_advance_hours', '24', '최소 예약 시간 (시간)'], ['cancel_deadline_hours', '24', '예약 취소 마감 시간 (시간)'] ]; foreach ($default_configs as $config) { sql_query("INSERT IGNORE INTO consultant_config (config_key, config_value, config_desc) VALUES ('{$config[0]}', '{$config[1]}', '{$config[2]}')"); } // 💡 [수정] 메일 템플릿 기본 데이터 $mail_templates = [ ['consultant_reservation_customer', '고객 예약 신청 확인', '[상담예약] 예약 신청이 접수되었습니다', "안녕하세요 {customer_name}님,\n\n상담 예약 신청이 정상적으로 접수되었습니다.\n\n예약 정보:\n- 날짜: {reservation_date}\n- 시간: {reservation_time}\n- 상담비: {payment_amount}원\n\n입금 계좌: {account_info}\n\n입금 확인 후 예약이 확정됩니다.\n\n감사합니다."], ['consultant_confirmed_customer', '고객 예약 확정 알림', '[상담예약] 예약이 확정되었습니다', "안녕하세요 {customer_name}님,\n\n입금이 확인되어 예약이 확정되었습니다.\n\n예약 정보:\n- 날짜: {reservation_date}\n- 시간: {reservation_time}\n\n상담 당일 시간에 맞춰 방문해주시기 바랍니다.\n\n감사합니다."], ['consultant_cancelled_customer', '고객 예약 취소 알림', '[상담예약] 예약이 취소되었습니다', "안녕하세요 {customer_name}님,\n\n예약이 취소되었습니다.\n\n취소된 예약 정보:\n- 날짜: {reservation_date}\n- 시간: {reservation_time}\n\n취소 사유: {cancel_reason}\n\n문의사항이 있으시면 연락주시기 바랍니다.\n\n감사합니다."] ]; foreach ($mail_templates as $template) { sql_query("INSERT IGNORE INTO consultant_mail_templates (template_key, template_name, template_subject, template_content) VALUES ('{$template[0]}', '{$template[1]}', '{$template[2]}', '" . sql_real_escape_string($template[3]) . "')"); } // 💡 [추가] SMS 템플릿 기본 데이터 $sms_templates = [ ['consultant_reservation_customer', '고객 예약 신청 확인', '[상담예약] 예약 신청 접수', "{customer_name}님, 상담 예약이 접수되었습니다.\n일시: {reservation_date} {reservation_time}\n계좌: {account_info}\n입금 확인 후 확정됩니다."], ['consultant_confirmed_customer', '고객 예약 확정 알림', '[상담예약] 예약 확정', "{customer_name}님, 예약이 확정되었습니다.\n일시: {reservation_date} {reservation_time}\n시간 맞춰 방문 부탁드립니다."], ['consultant_cancelled_customer', '고객 예약 취소 알림', '[상담예약] 예약 취소', "{customer_name}님, 예약이 취소되었습니다.\n일시: {reservation_date} {reservation_time}\n사유: {cancel_reason}"] ]; foreach ($sms_templates as $template) { sql_query("INSERT IGNORE INTO consultant_sms_templates (template_key, template_name, template_subject, template_content) VALUES ('{$template[0]}', '{$template[1]}', '{$template[2]}', '" . sql_real_escape_string($template[3]) . "')"); } return true; } function create_admin_menu_file() { $source_file = __DIR__ . '/admin.menu850.consultant_manage.php'; $target_file = G5_ADMIN_PATH . '/admin.menu850.consultant_manage.php'; if (!file_exists($source_file)) return "실패 (메뉴 원본 파일 없음)"; if (file_exists($target_file)) return "성공 (이미 존재함)"; if (@copy($source_file, $target_file)) return "성공"; return "실패 (파일 복사 오류)"; } $existing_tables = []; foreach ($tables_to_check as $table) { if (sql_query("SHOW TABLES LIKE '$table'", false) && sql_num_rows(sql_query("SHOW TABLES LIKE '$table'", false)) > 0) { $existing_tables[] = $table; } } $is_installed = count($existing_tables) == count($tables_to_check); ?>
전문적인 상담 예약 관리 및 일정 관리 솔루션
솔루션 관련 데이터와 파일이 삭제되었습니다.
상담 예약 시스템을 사용하기 위해 설치가 필요합니다.
| 테이블명 | 설명 | 상태 |
|---|---|---|
|
'환경 설정', 'consultant_schedule' => '상담 스케줄', 'consultant_reservations' => '예약 정보', 'consultant_mail_templates' => '메일 템플릿', 'consultant_sms_templates' => '문자 템플릿', 'consultant_log' => '시스템 로그')[$table] ?? '데이터 테이블'; ?> | 설치됨 미설치 |