diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
index cd2423d..eb2a821 100644
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -1,5 +1,3 @@
-version: "3.9"
-
services:
app:
build:
@@ -29,7 +27,7 @@ services:
- db_data:/var/lib/mysql
- ../docker/mysql/initdb:/docker-entrypoint-initdb.d
ports:
- - "3306:3306"
+ - "3307:3306"
volumes:
db_data:
\ No newline at end of file
diff --git a/src/index.php b/src/index.php
index a811f79..5ee1f64 100644
--- a/src/index.php
+++ b/src/index.php
@@ -4,50 +4,110 @@ $base = __DIR__;
// Load DB connection if present (bbs/db_conn.php contains DB info)
if (file_exists($base . '/bbs/db_conn.php')) {
- require_once $base . '/bbs/db_conn.php';
+ require_once $base . '/bbs/db_conn.php';
} elseif (file_exists($base . '/db_conn.php')) {
- require_once $base . '/db_conn.php';
+ require_once $base . '/db_conn.php';
}
// Serve skin/index.php as the intro page if it exists
$skin = $base . '/skin/index.php';
if (file_exists($skin)) {
- if (session_status() === PHP_SESSION_NONE) {
- @session_start();
- }
- require $skin;
- exit;
+ if (session_status() === PHP_SESSION_NONE) {
+ @session_start();
+ }
+ require $skin;
+ exit;
}
// Try alternate locations (compat)
$alt = $base . '/hmac_edu/index.php';
if (file_exists($alt)) {
- require $alt;
- exit;
+ require $alt;
+ exit;
}
// Fallback diagnostic page
$dirs = [];
foreach (scandir($base) as $d) {
- if ($d === '.' || $d === '..') continue;
- if (is_dir($base . '/' . $d)) $dirs[] = $d;
+ if ($d === '.' || $d === '..') continue;
+ if (is_dir($base . '/' . $d)) $dirs[] = $d;
}
+
+// --- [추가된 부분] 도커 DB 연결 및 데이터 조회 테스트 로직 ---
+$dbStatus = "";
+$usersData = [];
+try {
+ // ⚠️ TODO: 아래 유저명과 비밀번호를 .env 파일과 동일하게 맞춰주세요!
+ $dsn = "mysql:host=db;dbname=appdb;charset=utf8mb4";
+ $dbUser = "app"; // 또는 설정하신 유저명
+ $dbPass = "secret"; // .env에 설정한 비밀번호
+
+ $pdo = new PDO($dsn, $dbUser, $dbPass);
+ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+ $dbStatus = "✅ DB 연결 성공! (도커 내부 통신 정상)";
+
+ // 아까 만든 users 테이블에서 데이터 가져오기
+ $stmt = $pdo->query("SELECT * FROM users");
+ $usersData = $stmt->fetchAll(PDO::FETCH_ASSOC);
+
+} catch (PDOException $e) {
+ $dbStatus = "❌ DB 연결 실패: " . htmlspecialchars($e->getMessage()) . "";
+}
+// -------------------------------------------------------------
?>
-
- hmac_edu - Missing Intro
-
+
+ hmac_edu - Missing Intro
+
- Intro 페이지를 찾을 수 없습니다
- 현재 `skin/index.php` 파일이 프로젝트의 `src` 폴더에 없습니다.
- 호스트에 업로드된 디렉터리 목록:
-
+ Intro 페이지를 찾을 수 없습니다
+ 현재 `skin/index.php` 파일이 프로젝트의 `src` 폴더에 없습니다.
+
+
+
🐳 도커 DB 연결 테스트
+
+
+
+
`users` 테이블 데이터:
+
+
+
+ | ID |
+ Username |
+ Email |
+ Created At |
+
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
테이블에 데이터가 없거나 조회할 수 없습니다. (초기 데이터가 비어있을 수 있습니다)
+
+
+ 호스트에 업로드된 디렉터리 목록:
+
diff --git a/src/skin/adm_index.php b/src/skin/adm_index.php
new file mode 100644
index 0000000..9d21cd1
--- /dev/null
+++ b/src/skin/adm_index.php
@@ -0,0 +1,206 @@
+
+
+
+
+
+ 배움터 LMS 관리자 모드
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
법인별 통계
+
+
+
+
+ 한맥기술15.2회
+
+
+ 삼안12.8회
+
+
+ 장현산업18.5회
+
+
+ GAIA14.1회
+
+
+
+
+
+
+
+
+
+
+
+ 가장 많이 본 영상
+
+
+
+
+
+
+
+
실리콘밸리 PM이 말해주는 AI 시대 PM 생존법
+
시청수: 1,245회 | 완료율: 92%
+
+
+
+
+
+
AI와 함께 진화하는 법 : AI 일잘러의 비밀
+
시청수: 1,127회 | 완료율: 88%
+
+
+
+
+
+
+
+
+
+ 배움터 학습 랭킹
+
+
+
+
+
+
+
+ | 1 |
+
+ 홍길동
+ 한맥기술 본부장
+ |
+
+ 52시간
+ Master
+ |
+
+
+ | 2 |
+
+ 김철수
+ 삼안 전략기획팀
+ |
+
+ 48시간
+ Master
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/skin/index.php b/src/skin/index.php
new file mode 100644
index 0000000..6b8fe79
--- /dev/null
+++ b/src/skin/index.php
@@ -0,0 +1,11 @@
+
+
+
+
+ 한맥가족사 배움터
+
+
+ 🎉 메인 스킨 화면에 성공적으로 들어왔습니다!
+ 여기가 진짜 사용자가 보게 될 첫 화면(skin)입니다.
+
+
\ No newline at end of file