diff --git a/Admin/admin_page.php b/Admin/admin_page.php index 93930dfab6fafd066899321c90508b5379d1364c..a72a169c25770732021eddbf4fd502288d2317b9 100644 --- a/Admin/admin_page.php +++ b/Admin/admin_page.php @@ -13,8 +13,9 @@ if (!isset($_SESSION['user_type'])) { <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>管理员管理页面</title> + <title>Admin Page</title> <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> </head> <body class="bg-gray-100"> <div class="flex h-screen"> @@ -29,15 +30,24 @@ if (!isset($_SESSION['user_type'])) { </ul> </div> <!-- 主内容区 --> - <div class="flex-1"> + <div class="flex-1 items-center justify-center"> <iframe id="mainContent" class="w-full h-full overflow-auto" src="about:blank"></iframe> </div> </div> + +<div class="fixed bottom-0 left-0 p-4"> + <a href="http://localhost/zhushou/Presentation/interface.php" id="return-home-btn" class="inline-block bg-black p-4 rounded-md"> + <i class="fas fa-arrow-left text-white text-xl"></i> + </a> +</div> + <script> document.querySelectorAll('a').forEach(link => { link.addEventListener('click', function(event) { - event.preventDefault(); - document.getElementById('mainContent').src = this.getAttribute('data-src'); + if (this.hasAttribute('data-src')) { + event.preventDefault(); + document.getElementById('mainContent').src = this.getAttribute('data-src'); + } }); }); </script> diff --git a/Admin/brs_manage.php b/Admin/brs_manage.php index eb6391346d3dd88ecdc7568f78764129bb15e795..97b32d363be04a3998e2dea4559b8fe0e5661d63 100644 --- a/Admin/brs_manage.php +++ b/Admin/brs_manage.php @@ -248,7 +248,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { addButtons.forEach(button => { button.addEventListener('click', function () { modalContent.innerHTML = ` - <h2 class="text-lg font-bold mb-4">Edit Building Info</h2> + <h2 class="text-lg font-bold mb-4">Add Building</h2> <form id="addBuildingForm" class="space-y-4" action="../Admin/brs_manage.php" method="post"> <input type="hidden" name="formType" value="addBuildingForm"> <div class="flex"> @@ -275,11 +275,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { </div> <div> <label class="block text-sm font-medium text-gray-700" for="latitude">Latitude</label> - <input type="text" name="latitude" id="latitude" class="mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> + <input type="text" name="latitude" id="latitude" class="mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" required> </div> <div> <label class="block text-sm font-medium text-gray-700" for="longitude">Longitude</label> - <input type="text" name="longitude" id="longitude" class="mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> + <input type="text" name="longitude" id="longitude" class="mt-1 block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" required> </div> <div> <label class="block text-sm font-medium text-gray-700" for="address">Address</label> diff --git a/Logic/responses.php b/Logic/responses.php deleted file mode 100644 index 15aad7efca576dc0b099c9158c013073e1510407..0000000000000000000000000000000000000000 --- a/Logic/responses.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -//\b来指定单词边界,确保只匹配整个单词,而不是字符串中的子字符串 -//i修饰符使得匹配不区分大小写 -return [ - '/\b(体育中心|UWE)\b/i' => 'UWE的体育中心提供了多种体育和健身设施,包括健身房,多功能球场,壁球场,攀岩,并且开设多种课程:瑜伽,篮球,拳击等...', - '/\b(bye|farewell|goodbye)\b/i' => 'Goodbye! Looking forward to our next conversation!', - // 其他预定义的回答 -]; diff --git a/Presentation/chatPage.php b/Presentation/chatPage.php index 9130feced458952c0d13b3ea252737b90a99a934..495fc303546a534678f3d6705cb98525ed35b2c2 100644 --- a/Presentation/chatPage.php +++ b/Presentation/chatPage.php @@ -27,7 +27,7 @@ </div> </div> -<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a> +<!--<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a>--> <script src="../Logic/chat.js"></script> </body> diff --git a/Presentation/city.php b/Presentation/city.php index 52b8aaab93a9cd743bb968feb35da8c94b10ff41..54ba70a77be78f95a7778b775b6ed232af4b8098 100644 --- a/Presentation/city.php +++ b/Presentation/city.php @@ -106,7 +106,7 @@ $buildings = $stmt->fetchAll(PDO::FETCH_ASSOC); </div> -<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a> +<!--<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a>--> <script src="../Logic/city.js"></script> </body> diff --git a/Presentation/interface.php b/Presentation/interface.php index cf90c96d12321084d0fc20ae112f7b92816b2162..6603b68c6ce92d43ce508d3dbfba871ec82fe2eb 100644 --- a/Presentation/interface.php +++ b/Presentation/interface.php @@ -7,6 +7,7 @@ <title>Chat Interface with Aligned Messages</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> + <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> <link rel="stylesheet" href="../css/interface.css"> </head> <body> @@ -19,10 +20,10 @@ </div> <div id="sidebar"> - <a href="map.php" class="sidebar-item" target="contentFrame">Around Frenchay Campus</a> - <a href="city.php" class="sidebar-item" target="contentFrame">Around Bristol</a> - <a href="chatPage.php" class="sidebar-item" target="contentFrame">Campus Voices</a> - <a href="settings.php" class="sidebar-item" target="contentFrame"><i class="fas fa-home"></i> User Profile</a> + <a href="#" class="sidebar-item" target="contentFrame" data-src="map.php">Around Frenchay Campus</a> + <a href="#" class="sidebar-item" target="contentFrame" data-src="city.php">Around Bristol</a> + <a href="#" class="sidebar-item" target="contentFrame" data-src="chatPage.php">Campus Voices</a> + <a href="#" class="sidebar-item" target="contentFrame" data-src="settings.php">User Profile</a> <?php if (isset($userType) && $userType === 'admin') { echo '<a href="../Admin/admin_page.php" class="sidebar-item" target="contentFrame">Admin Page</a>'; @@ -36,5 +37,15 @@ </div> +<script> + document.querySelectorAll('a').forEach(link => { + link.addEventListener('click', function(event) { + if (this.hasAttribute('data-src')) { + event.preventDefault(); + document.getElementById('contentFrame').src = this.getAttribute('data-src'); + } + }); + }); +</script> </body> </html> diff --git a/Presentation/map.php b/Presentation/map.php index cd1836b0135b6ebc8dd5a10f9b4152255febd22d..531e339882bf42ddfafff5ab2cd01f2bdd59731f 100644 --- a/Presentation/map.php +++ b/Presentation/map.php @@ -37,7 +37,7 @@ $buildings = $stmt->fetchAll(PDO::FETCH_ASSOC); <div id="place-info"></div> -<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a> +<!--<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a>--> <script src="../Logic/map.js"></script> </body> diff --git a/Presentation/settings.php b/Presentation/settings.php index f83c8ed560e3ddb87292a13835b8e1324cc16cab..d3785ccc28e79567cf6e04afe93022023b9e4cfc 100644 --- a/Presentation/settings.php +++ b/Presentation/settings.php @@ -177,9 +177,6 @@ $user = $stmt->fetch(PDO::FETCH_ASSOC); <!-- </form>再加一个模态框来确定用户是否退出账号--> </div> - -<a href="interface.php" id="return-home-btn"><i class="fas fa-arrow-left"></i></a> - <!--src="js/settings.js"--> <script src="../Logic/settings.js"></script> </body>