Gitlab@Informatics

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

Project Round 4

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