From 9a11a8afd1cda4163d94ba18712304c98f3fb209 Mon Sep 17 00:00:00 2001 From: wallace Date: Mon, 10 Nov 2025 21:20:09 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EA=B5=90=EC=9C=A1=EA=B3=BC=EC=A0=95=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D,=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=9E=AC=EC=84=A4=EC=A0=95=20=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin_home/page.tsx | 0 app/admin_lecture1/page.tsx | 608 ++++++++++++++++++++++++++++++++++ app/admin_lecture2/page.tsx | 0 app/login/page.tsx | 2 +- app/myinfo/page.tsx | 7 +- app/mylecture/page.tsx | 9 +- app/page.tsx | 7 +- app/pwfind/page.tsx | 253 ++++++++++++++ package-lock.json | 448 ++++++++++++++++++++++++- package.json | 2 + public/svg/chevron_middle.tsx | 15 + public/svg/close.tsx | 14 + 12 files changed, 1353 insertions(+), 12 deletions(-) create mode 100644 app/admin_home/page.tsx create mode 100644 app/admin_lecture1/page.tsx create mode 100644 app/admin_lecture2/page.tsx create mode 100644 app/pwfind/page.tsx create mode 100644 public/svg/chevron_middle.tsx create mode 100644 public/svg/close.tsx diff --git a/app/admin_home/page.tsx b/app/admin_home/page.tsx new file mode 100644 index 0000000..e69de29 diff --git a/app/admin_lecture1/page.tsx b/app/admin_lecture1/page.tsx new file mode 100644 index 0000000..920f421 --- /dev/null +++ b/app/admin_lecture1/page.tsx @@ -0,0 +1,608 @@ +"use client"; + +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; +import Close from '../../public/svg/close'; + +const imgLogo = "http://localhost:3845/assets/89fda8e949171025b1232bae70fc9d442e4e70c8.png"; +const imgArrowDisabled = "http://localhost:3845/assets/6edcb2defc36a2bf4a05a3abe53b8da3d42b2cb4.svg"; +const imgArrowDefault = "http://localhost:3845/assets/ad0cb4418492f1b020bb38a2ff038a331294ce87.svg"; +const imgArrowNext = "http://localhost:3845/assets/6328cf96ee1169c1425c2ce55e7a2dcca0374508.svg"; +const imgLogout = "http://localhost:3845/assets/2277a58aa2f582fd42132439745c5bb051f322c2.svg"; +const imgClose = "http://localhost:3845/assets/51206896b81ebe68b2d80b5b603e576227587007.svg"; +const imgCloseX = "http://localhost:3845/assets/91a45a4f2e47cd854574f32ee6ac1b84e12807cf.svg"; +const imgMingcuteDownLine = "http://localhost:3845/assets/a50ea05576e2bcccf052b5be6750edaf476ad4d4.svg"; + +interface Course { + id: number; + courseName: string; + instructorName: string; + isIncluded: string; + createdAt: string; + registrar: string; +} + +type PaginationMove = "Previous" | "Next"; +type PaginationStatus = "Default" | "Disabled"; + +function PaginationBtnMove({ status = "Default", move = "Previous" }: { status?: PaginationStatus; move?: PaginationMove }) { + const isDisabled = status === "Disabled"; + const isNext = move === "Next"; + + if (isDisabled && isNext) { + // Disabled Next 버튼 + return ( +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ ); + } + + if (isDisabled && !isNext) { + // Disabled Previous 버튼 + return ( +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ ); + } + + if (isNext) { + // Default Next 버튼 + return ( +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ ); + } + + // Default Previous 버튼 + return ( +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ ); +} + +export default function AdminLecture1Page() { + const router = useRouter(); + const [currentPage, setCurrentPage] = useState(1); + const [isModalOpen, setIsModalOpen] = useState(false); + const [courseName, setCourseName] = useState(''); + const [instructorName, setInstructorName] = useState(''); + const [showInstructorDropdown, setShowInstructorDropdown] = useState(false); + const [nextId, setNextId] = useState(14); + + // 샘플 강좌 데이터 + const [courses, setCourses] = useState([ + { id: 39, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 38, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 37, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 36, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 35, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 34, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 33, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 32, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 31, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 30, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 29, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 28, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 27, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 26, courseName: '방사선 원리', instructorName: '김강사', isIncluded: '포함', createdAt: '2025-12-11', registrar: '김등록' }, + { id: 25, courseName: '방사선 원리', instructorName: '김강사', isIncluded: '포함', createdAt: '2025-12-11', registrar: '김등록' }, + { id: 24, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 23, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 22, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 21, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 20, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 19, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 18, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 17, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 16, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 15, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 14, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 13, courseName: '방사선 원리', instructorName: '김강사', isIncluded: '포함', createdAt: '2025-12-11', registrar: '김등록' }, + { id: 12, courseName: '방사선 원리', instructorName: '김강사', isIncluded: '포함', createdAt: '2025-12-11', registrar: '김등록' }, + { id: 11, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 10, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 9, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 8, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 7, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 6, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 5, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 4, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 3, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 2, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + { id: 1, courseName: '방사선 적용', instructorName: '김강사', isIncluded: '포함', createdAt: '2026-01-15', registrar: '이철수' }, + ]); + + const instructors = ['김강사', '이강사', '박강사', '최강사']; + + const handleOpenModal = () => { + setIsModalOpen(true); + setCourseName(''); + setInstructorName(''); + }; + + const handleCloseModal = () => { + setIsModalOpen(false); + setCourseName(''); + setInstructorName(''); + setShowInstructorDropdown(false); + }; + + const handleSave = () => { + if (!courseName.trim() || !instructorName.trim()) { + alert('교육 과정명과 강사를 입력해 주세요.'); + return; + } + + const today = new Date(); + const formattedDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`; + + const newCourse: Course = { + id: nextId, + courseName: courseName.trim(), + instructorName: instructorName.trim(), + isIncluded: '미포함', + createdAt: formattedDate, + registrar: '관리자', + }; + + const updatedCourses = [...courses, newCourse]; + setCourses(updatedCourses); + setNextId(nextId + 1); + + // 13개를 넘어가면 해당 페이지로 이동 + const newTotalPages = Math.ceil(updatedCourses.length / 13); + if (newTotalPages > 1 && updatedCourses.length > 13) { + setCurrentPage(newTotalPages); + } + + handleCloseModal(); + }; + + const handleSelectInstructor = (instructor: string) => { + setInstructorName(instructor); + setShowInstructorDropdown(false); + }; + + const itemsPerPage = 13; + const totalPages = Math.ceil(courses.length / itemsPerPage); + const pageNumbers = Array.from({ length: totalPages }, (_, i) => i + 1); + const startIndex = (currentPage - 1) * itemsPerPage; + const endIndex = startIndex + itemsPerPage; + const currentCourses = courses.slice(startIndex, endIndex); + + return ( +
+ {/* 사이드바 */} +
+ {/* 로고 */} + + {/* 메뉴 */} +
+
+ + + + + + + + + +
+
+ {/* 로그아웃 */} +
+
+
+
+ +
+
+
+ +
+
+ + {/* 메인 콘텐츠 */} +
+ {/* 헤더 */} +
+
+
+

+ 교육 과정 관리 +

+
+
+
+ + {/* 교육 과정 등록 버튼 */} + + + {/* 테이블 */} +
+ {/* 테이블 헤더 */} +
+
+
+
+

교육 과정명

+
+
+
+
+

강사명

+
+
+
+
+

강좌 포함 여부

+
+
+
+
+

생성일

+
+
+
+
+

등록 담당자

+
+
+
+
+ + {/* 테이블 바디 */} +
+ {currentCourses.map((course) => ( +
+
+
+
+

{course.courseName}

+
+
+
+
+

{course.instructorName}

+
+
+
+
+

{course.isIncluded}

+
+
+
+
+

{course.createdAt}

+
+
+
+
+

{course.registrar}

+
+
+
+
+ ))} +
+
+ + {/* 페이지네이션 */} +
+ +
+ {pageNumbers.map((pageNum) => ( + + ))} +
+ +
+
+ + {/* 모달 팝업 */} + {isModalOpen && ( +
+ {/* 배경 오버레이 */} +
+ {/* 모달 컨텐츠 */} +
e.stopPropagation()} + > + {/* 닫기 버튼 */} + + + {/* 저장 버튼 */} + + + {/* 취소 버튼 */} + + + {/* 폼 컨텐츠 */} +
+
+ {/* 제목 */} +
+
+

교육 과정 등록

+
+
+ + {/* 교육 과정명 */} +
+
+
+

+ 교육 과정명 * +

+
+ setCourseName(e.target.value)} + placeholder="교육 과정명을 입력해 주세요." + className="basis-0 border border-[#b9b9b9] border-solid box-border content-stretch flex gap-[10px] grow items-center justify-center min-h-px min-w-px p-[10px] relative rounded-[8px] shrink-0 bg-white text-[16px] text-[#515151] focus:outline-none focus:border-[#2b82e8]" + /> +
+
+ + {/* 강사 */} +
+
+
+

+ 강사 * +

+
+
+ + {showInstructorDropdown && ( +
+ {instructors.map((instructor) => ( + + ))} +
+ )} +
+
+
+ + {/* 교육 과정 이미지 */} +
+
+
+
+

+ 교육 과정 이미지 +

+
+
+
+ +
+
+
+
+
+

30MB 미만의 교육 과정 이미지를 첨부해 주세요.

+

첨부하지 않을 경우 기본 이미지가 노출돼요.

+
+
+
+
+
+
+
+
+ )} +
+ ); +} + diff --git a/app/admin_lecture2/page.tsx b/app/admin_lecture2/page.tsx new file mode 100644 index 0000000..e69de29 diff --git a/app/login/page.tsx b/app/login/page.tsx index f8f797f..957625d 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -71,7 +71,7 @@ export default function LoginPage() { } // 아이디와 비밀번호 검증 - if (username === 'admin' && password === '1234') { + if (username === 'qwre@naver.com' && password === '1234') { // 로그인 성공 localStorage.setItem('isLoggedIn', 'true'); // 아이디 기억하기 체크 시 아이디 저장 diff --git a/app/myinfo/page.tsx b/app/myinfo/page.tsx index 14a571d..7caa2fb 100644 --- a/app/myinfo/page.tsx +++ b/app/myinfo/page.tsx @@ -34,11 +34,14 @@ export default function MyLecturePage() {
{/* 로고 */} -
+
+ {/* 메뉴 */}
diff --git a/app/mylecture/page.tsx b/app/mylecture/page.tsx index 6eb221b..792132e 100644 --- a/app/mylecture/page.tsx +++ b/app/mylecture/page.tsx @@ -94,11 +94,14 @@ export default function MyLecturePage() {
{/* 로고 */} -
+
+ {/* 메뉴 */}
@@ -320,7 +323,7 @@ export default function MyLecturePage() {
{/* 푸터 */} -