'/edu/img/leadership/img_banner_01.png', 'mobile' => '/edu/img/leadership/img_banner_01_m.png', 'title' => '실천으로 완성하는 리더십'], ['normal' => '/edu/img/leadership/img_banner_02.png', 'mobile' => '/edu/img/leadership/img_banner_02_m.png', 'title' => '성장하는 리더십 여정'], ['normal' => '/edu/img/leadership/img_banner_03.png', 'mobile' => '/edu/img/leadership/img_banner_03_m.png', 'title' => '리더로 성장하는 과정'], ]; }else if($prefixCondition=='I'){//L=리더십(기본값), I=인사이트 $array_banner_img = [ ['normal' => '/edu/img/insight/img_banner_01.png', 'mobile' => '/edu/img/insight/img_banner_01_m.png', 'title' => '배너 1'], ['normal' => '/edu/img/insight/img_banner_02.png', 'mobile' => '/edu/img/insight/img_banner_02_m.png', 'title' => '배너 2'], ]; } $dbSuccess = false; $array_tab_info = []; try { $pdo = db_conn(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->exec("SET NAMES 'utf8mb4'"); // LIKE 연산자를 안전하게 처리하기 위해 준비된 선언(Prepared Statement) 사용 $stmtCode = $pdo->prepare(" SELECT group_code, base_code, code, code_name FROM edu_codes WHERE is_active = 1 AND group_code = 'CA200' AND code LIKE :prefix ORDER BY base_code ASC "); // 'L%' 형태로 바인딩하여 검색 $stmtCode->execute([':prefix' => $prefixCondition . '%']); $rows = $stmtCode->fetchAll(PDO::FETCH_ASSOC); if ($rows) { $i = 1; foreach ($rows as $cr) { $index = sprintf('%02d', $i); $index_src = '/edu/img/ico/ico_'.$prefixSvg.'_' . $index . '.svg'; $array_tab_info[] = [ 'base_code' => $cr['base_code'], 'code_name' => $cr['code_name'], 'src' => $index_src ]; $i++; } } $dbSuccess = true; } catch (Exception $e) { $errMsg = $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine(); error_log('[leadership_init_data.php] DB Error: ' . $errMsg); // api_log 함수가 있다면 기록 if (function_exists('api_log')) { api_log('leadership_init', 'DB_ERROR', ['error' => $errMsg]); } }