Gitlab@Informatics

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

Project Round 11

parent bda8d324
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,11 @@ class Tour { ...@@ -78,7 +78,11 @@ class Tour {
// ดึงทัวร์ตาม ID // ดึงทัวร์ตาม ID
static async getTourById(tourId) { static async getTourById(tourId) {
const query = 'SELECT id, name, description, price, duration, userId FROM tours WHERE id = ?'; const query = `
SELECT t.id, t.name, t.description, t.price, t.duration, t.userId, c.name AS company_name
FROM tours t
JOIN company c ON t.company_id = c.id
WHERE t.id = ?`;
try { try {
const [results] = await pool.execute(query, [tourId]); const [results] = await pool.execute(query, [tourId]);
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
<section> <section>
<h2>รายละเอียดทัวร์</h2> <h2>รายละเอียดทัวร์</h2>
<p>รายละเอียด: <%= tour.description %></p> <p><strong>ชื่อทัวร์:</strong> <%= tour.name %></p>
<p>Price: <%= tour.price %> THB</p> <p><strong>คำอธิบาย:</strong> <%= tour.description %></p>
<p>ระยะเวลา: <%= tour.duration %> วัน</p> <p><strong>ราคา:</strong> <%= tour.price %></p>
<p><strong>ระยะเวลา:</strong> <%= tour.duration %></p>
<p><strong>บริษัท:</strong> <%= tour.company_name %></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