diff --git a/public/css/styles.css b/public/css/styles.css index 4a00cac358a51fa340ff8c4adde30d6dc5148137..033ebe417610a7982e053905d0d9ab0d0bea0b51 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -111,6 +111,22 @@ ul li span { background-color: #007bb5; } +.btn-delete { + display: inline-block; + padding: 10px 20px; + background-color: #ff0000; + color: white; + text-decoration: none; + border-radius: 5px; + margin-top: 20px; + font-size: 1rem; + transition: background-color 0.3s ease; +} + +.btn-delete:hover { + background-color: #e72323; +} + footer { background-color: #333; color: white; diff --git a/routes/tourRoutes.js b/routes/tourRoutes.js index 6f58f78d1df1be62a39d01f5f9fc5833261417a2..d1602417568946004418da02fb9b8ffa9708809c 100644 --- a/routes/tourRoutes.js +++ b/routes/tourRoutes.js @@ -17,4 +17,7 @@ router.get('/logout', tourController.Logout); // ออกจากระบบ router.get('/create', tourController.getCreateTour); // หน้าสร้างทัวร์ router.post('/create', tourController.createTour); // บันทึกทัวร์ลงฐานข้อมูล +//แก้ไขทัวร์ +router.get('/edit/:id', tourController.getTourDetails); // หน้ารายละเอียดของทัวร์ + module.exports = router; diff --git a/views/index.ejs b/views/index.ejs index ece7e6533b64462a560e2db386a4d1c088560ad5..cd22e5cd9778cd556af8cd455866593a35aa69ee 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -37,6 +37,7 @@ <% if (session.userId) { %> <!-- ตรวจสอบว่าเป็นผู้ใช้ที่ล็อกอินแล้วหรือไม่ --> <a href="/edit/<%= tour.id %>" class="btn-edit">Edit</a> <!-- ปุ่มสำหรับแก้ไขทัวร์ --> + <a href="/delete/<%= tour.id %>" class="btn-delete">Delete</a> <% } %> </li> <% }) %>