window.top.location.href = '../seller/home.php'; "; } if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === 'admin'){ echo ""; } if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === 'guide'){ echo ""; } } ?>

Admin page






Data Aanalysis

connect_error) { die("Connection failed: " . $conn->connect_error); } // data analysis $query = "SELECT attraction_id, COUNT(attraction_id) AS attribute_count FROM attraction_booking GROUP BY attraction_id ORDER BY attribute_count DESC LIMIT 1"; $result = $conn->query($query); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $most_common_attribute_value = $row['attraction_id']; // the most popular,times echo "The most popular attraction is:" . $most_common_attribute_value . ",the times is:" . $row['attribute_count'] . "
"; // all information $query_all_info = "SELECT * FROM attraction_booking JOIN attraction USING(attraction_id) WHERE attraction_id = '$most_common_attribute_value'"; $result_all_info = $conn->query($query_all_info); if ($result_all_info->num_rows > 0) { echo '
'; echo ''; echo ''; while ($row_info = $result_all_info->fetch_assoc()) { echo ''; echo ''; echo ''; echo ''; } echo '
attraction_idName
' . $row_info['attraction_id'] . '' . $row_info['name'] . '
'; } else { echo 'No information found for the most common attribute value.'; } } else { echo "No records found"; } ?>
connect_error) { die("Connection failed: " . $conn->connect_error); } // data analysis $query = "SELECT restaurant_id, COUNT(restaurant_id) AS restaurant_count FROM restaurant_booking GROUP BY restaurant_id ORDER BY restaurant_count DESC LIMIT 1"; $result = $conn->query($query); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $most_common_attribute_value = $row['restaurant_id']; $query_all_info = "SELECT * FROM restaurant_booking JOIN restaurant USING(restaurant_id) WHERE restaurant_id = '$most_common_attribute_value'"; $result_all_info = $conn->query($query_all_info); if ($result_all_info->num_rows > 0) { echo '
'; echo ''; echo ''; echo "

The most popular restaurant is:" . $most_common_attribute_value . ",the times is:" . $row['restaurant_count'] . "

"; while ($row_info = $result_all_info->fetch_assoc()) { echo ''; echo ''; echo ''; echo ''; } echo '
restaurant_idName
' . $row_info['restaurant_id'] . '' . $row_info['name'] . '
'; } else { echo 'No information found for the most common attribute value.'; } } else { echo "No records found"; } // Close database connection $conn->close(); ?>