Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ body {
background-color: #d84040;
color: #fff;
font-size: 18px;
cursor: pointer;
}
73 changes: 70 additions & 3 deletions web/admin.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ko">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script type="module" src="logout.js" defer></script>
<script type="module" src="firebase.js" defer></script>
<title>Document</title>
<title>예약확인 시스템</title>
</head>

<body>
Expand Down Expand Up @@ -46,7 +46,74 @@ <h1>예약내역</h1>
</thead>
</table>
</div>
</div>

<header>
<div class="header">
<h1>예약확인</h1>
<img src="./image/user.png" alt="">
<p>관리자</p>
<button id="logOutButton">로그아웃</button>

</header>

<div class="container">
<h1>예약내역</h1>
<div class="divider"></div>
<div class="Reserve_info">
<li>
<a href="#">예약번호</a>
<a href="#">고객명</a>
<a href="#">예약날짜</a>
<a href="#">결제금액</a>
</li>
</div>

<div class="divider2"></div>

<div class="Reserve_filed">
<li>
<a href="#">AB12345</a>
<a href="#">김덕원</a>
<a href="#">2025년 03월 06일</a>
<a href="#">30,000원</a>
</li>
</div>
</div>

<script type="module">
// Firebase 모듈 가져오기
import { initializeApp } from 'firebase/app';
import { getAuth, signOut } from 'firebase/auth';

// Firebase 구성
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};

// Firebase 초기화
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);

// 로그아웃 함수 정의
const logout = async () => {
try {
await signOut(auth);
console.log('로그아웃 성공');
window.location.href = '/index.html';
} catch (error) {
console.error('로그아웃 실패:', error.message);
}
};

document.getElementById('logOutButton').addEventListener('click', logout);
</script>

</body>


</html>
35 changes: 32 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="ko">
<html lang="en">

<head>
<meta charset="UTF-8">
Expand Down Expand Up @@ -29,10 +29,39 @@

</div>

</div>
<div class="login_container">
<h1>로그인</h1>
<input type="email" id="email" placeholder="이메일" />
<br />
<input type="password" id="password" placeholder="비밀번호" />
<br />
<button id="loginButton">로그인</button>
<p id="message"></p>
</div>


</body>
<script type="module">


// 로그인 처리 함수
window.handleLogin = async () => {
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const result = await login(email, password);

const messageElement = document.getElementById('message');
if (result.success) {
messageElement.style.color = 'green';
messageElement.text.color = '로그인 성공! 환영합니다, ${result.user.email}';
window.location.href = '/admin.html';
} else {
messageElement.style.color = 'red';
messageElement.textContent = `로그인 실패: ${result.message}`;
}
};

document.getElementById('loginButton').addEventListener('click', handleLogin);
</script>
</body>

</html>
Loading