Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit b1da3496 authored by 65160394's avatar 65160394
Browse files

Project Round 5

parent ea7bcf64
No related branches found
No related tags found
No related merge requests found
.profile-container {
max-width: 600px;
margin: 30px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
h2 {
text-align: center;
color: #0073e6;
margin-bottom: 20px;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input {
width: 100%;
padding: 10px;
margin-top: 5px;
border-radius: 5px;
border: 1px solid #ccc;
}
button {
display: block;
width: 100%;
padding: 10px;
background: #007bff;
color: white;
border-radius: 5px;
cursor: pointer;
transition: 0.3s;
}
button:hover {
background: #0056b3;
}
\ No newline at end of file
.profile-container {
max-width: 600px;
margin: 30px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
text-align: center;
}
.profile-card {
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
margin-bottom: 15px;
}
.btn-edit {
display: inline-block;
padding: 10px 15px;
background: #007bff;
color: white;
border-radius: 5px;
text-decoration: none;
transition: 0.3s;
}
.btn-edit:hover {
background: #0056b3;
}
\ No newline at end of file
...@@ -27,4 +27,8 @@ router.get('/delete/:id', tourController.deleteTour); //ลบทัวร์ ...@@ -27,4 +27,8 @@ router.get('/delete/:id', tourController.deleteTour); //ลบทัวร์
//ค้นหา //ค้นหา
router.get('/search', tourController.searchTours); //หน้าค้นหาทัวร์ router.get('/search', tourController.searchTours); //หน้าค้นหาทัวร์
//Profile
router.get('/profile', userController.getProfilePage);//หน้าโปรไฟล์
router.post('/edit-profile', userController.updateProfile);// อัปเดตข้อมูลโปรไฟล์
module.exports = router; module.exports = router;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Profile - <%= user.name %></title>
<link rel="stylesheet" href="/css/editprofile.css">
</head>
<body>
<header>
<h1>Edit Your Profile</h1>
<nav>
<a href="/">Home</a>
<a href="/profile">Back to Profile</a>
<a href="/logout">Logout</a>
</nav>
</header>
<section class="profile-container">
<h2>Edit Your Information</h2>
<form action="/edit-profile" method="POST">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" value="<%= user.name %>" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" value="<%= user.email %>" required>
</div>
<div class="form-group">
<label for="password">New Password </label>
<input type="password" id="password" name="password">
</div>
<button type="submit" class="btn-edit">Save Changes</button>
</form>
</section>
<footer>
<p>&copy; 2025 Tour Website</p>
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Profile - <%= user.name %></title>
<link rel="stylesheet" href="/css/profile.css">
</head>
<body>
<header>
<h1>Welcome, <%= user.name %>!</h1>
<nav>
<a href="/">Home</a>
<a href="/logout">Logout</a>
</nav>
</header>
<section class="profile-container">
<h2>Your Profile</h2>
<div class="profile-card">
<p><strong>Name:</strong> <%= user.name %></p>
<p><strong>Email:</strong> <%= user.email %></p>
</div>
<a href="/edit-profile" class="btn-edit">Edit Profile</a>
</section>
<footer>
<p>&copy; 2025 Tour Website</p>
</footer>
</body>
</html>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<h2>Description</h2> <h2>Description</h2>
<p><%= tour.description %></p> <p><%= tour.description %></p>
<p>Price: <%= tour.price %> THB</p> <p>Price: <%= tour.price %> THB</p>
<p>ระยะเวลา: <%= tour.duration %></p> <p>ระยะเวลา: <%= tour.duration %> วัน</p>
<a href="/" class="btn-edit">ย้อนกลับ</a> <a href="/" class="btn-edit">ย้อนกลับ</a>
</section> </section>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment