Spaces:
Running
Running
Commit History
-
remove the nav bar retain the header
Verified signatureuse this for the main content make it better in functionalities when connecting to db i guess, <main class="max-w-7xl mx-auto px-4 py-8 sm:px-6 lg:px-8"><div class="mb-6 flex flex-wrap gap-4 items-center justify-between"><div class="flex items-center gap-4"><label for="topicFilter">Filter by Topic:</label><select id="topicFilter" class="px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent outline-none"><option value="all">All Topics</option><option value="1">foodsave</option><option value="2">foodstore</option><option value="3">store</option><option value="4">ocr</option><option value="5">cv</option><option value="6">thesis</option><option value="7">hello</option><option value="8">hi</option><option value="9">emoji</option><option value="10">nine</option></select></div><button class="flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-green-500 to-emerald-500 text-white rounded-lg hover:from-green-600 hover:to-emerald-600 transitio…8320f93 -
<?php
Verified signatureif (session_status() === PHP_SESSION_NONE) { session_start(); } include 'db.php'; if (!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); } $userName = $_SESSION['name'] ?? 'Guest'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>FoodSave Chatbot</title> <style> body { margin: 0; font-family: Arial, sans-serif; } .header { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; background-color: #ffffff; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; } .header-left { display: flex; align-items: center; gap: 12px; } .logo-container { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 12px; } .main-logo { width: 10…db2676d -
<?php
Verified signaturesession_start(); include 'db.php'; include 'header.php'; if (!isset($_SESSION['user_id'])) { header("Location: index.html"); exit(); } $user_id = (int)$_SESSION['user_id']; if (!isset($_SESSION['current_session'])) { $sqlLast = "SELECT MAX(session_id) AS last FROM chat_logs WHERE user_id = $user_id"; $resLast = mysqli_query($conn, $sqlLast); $rowLast = mysqli_fetch_assoc($resLast); $active_session = ($rowLast['last'] ?? 0) + 1; $_SESSION['current_session'] = $active_session; } else { $active_session = $_SESSION['current_session']; } // FETCH TOPICS GROUPED BY CATEGORY $sqlTopics = "SELECT category, user_query FROM chatbot_responses ORDER BY category ASC, user_query ASC"; $resTopics = mysqli_query($conn, $sqlTopics); $categorizedTopics = []; while ($row = mysqli_fetch_assoc($resTopics)) { $cat = $row['category'] ?: 'General'; $categorizedTopics[$cat][] = $row['user_query']; } // FETCH PREVIOUS SESSIONS ("Your Chats" history) $sqlS…ead5792 -
you didnt do anything?
Verified signaturee6d88c6 -
<?php
Verified signaturesession_start(); include 'db.php'; include 'header.php'; if (!isset($_SESSION['user_id'])) { header("Location: index.html"); exit(); } $user_id = (int)$_SESSION['user_id']; if (!isset($_SESSION['current_session'])) { $sqlLast = "SELECT MAX(session_id) AS last FROM chat_logs WHERE user_id = $user_id"; $resLast = mysqli_query($conn, $sqlLast); $rowLast = mysqli_fetch_assoc($resLast); $active_session = ($rowLast['last'] ?? 0) + 1; $_SESSION['current_session'] = $active_session; } else { $active_session = $_SESSION['current_session']; } // FETCH TOPICS GROUPED BY CATEGORY $sqlTopics = "SELECT category, user_query FROM chatbot_responses ORDER BY category ASC, user_query ASC"; $resTopics = mysqli_query($conn, $sqlTopics); $categorizedTopics = []; while ($row = mysqli_fetch_assoc($resTopics)) { $cat = $row['category'] ?: 'General'; $categorizedTopics[$cat][] = $row['user_query']; } // FETCH PREVIOUS SESSIONS ("Your Chats" history) $sqlS…659d490