From 3970b8e3454ae465dad726ce584bb74b0afd036c Mon Sep 17 00:00:00 2001
From: 65160381 <65160381@go.buu.ac.th>
Date: Tue, 25 Mar 2025 03:50:03 +0700
Subject: [PATCH] 9.5

---
 app.js               | 1 +
 public/checkout.html | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/app.js b/app.js
index ea6b99b..e807d3e 100644
--- a/app.js
+++ b/app.js
@@ -56,6 +56,7 @@ app.use(express.static(path.join(__dirname, 'public')));
 // Session และ routes
 app.get('/', (req, res) => {
     if (req.session.user) {
+        res.locals.user = req.session.user;  // ส่งข้อมูล user จาก session ไปยัง template
         res.sendFile(path.join(__dirname, 'public', 'index.html'));
     } else {
         res.redirect('/login');
diff --git a/public/checkout.html b/public/checkout.html
index 3780870..8c059dd 100644
--- a/public/checkout.html
+++ b/public/checkout.html
@@ -15,9 +15,13 @@
         <!-- Cart items will be dynamically loaded here -->
     </div>
 
+    <button>
+        <div class="checkout-button" onclick="processCheckout()">Confirm and Checkout</div>
+    </button>
+
     <footer>
         <p>&copy; 2025 ASA</p>
-        <div class="checkout-button" onclick="processCheckout()">Confirm and Checkout</div>
+        
     </footer>
 
     <script>
-- 
GitLab