Gitlab@Informatics

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

Project Round 4

parent cb650d2f
Branches
No related tags found
No related merge requests found
......@@ -11,8 +11,9 @@
<h1>Welcome to Our Tour Website</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
<% if (session.userId) { %>
<a href="/create" class="btn-create">Create Tour</a>
<% } %>
<% if (session && session.userId) { %> <!-- ตรวจสอบว่า userId อยู่ใน session หรือไม่ -->
<a href="/profile"><%= session.userName %></a> <!-- แสดงชื่อผู้ใช้ -->
......@@ -20,21 +21,15 @@
<% } else { %>
<a href="/login">Login</a> <!-- ถ้ายังไม่ได้ login -->
<% } %>
<form action="/search" method="GET">
<input type="text" name="query" placeholder="Search for tours..." required>
<button type="submit">Search</button>
</form>
</nav>
</header>
<section>
<form action="/search" method="GET">
<input type="text" name="query" placeholder="Search for tours..." required>
<button type="submit">Search</button>
</form>
<br>
<!-- แสดงปุ่ม "Create Tour" สำหรับผู้ใช้ที่เข้าสู่ระบบแล้ว -->
<% if (session.userId) { %>
<a href="/create" class="btn-create">Create Tour</a>
<% } %>
<br>
<h2>โปรแกรมทัวร์ที่เปิดให้จองขณะนี้</h2>
<ul>
<% tours.forEach(tour => { %>
<li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment