<?php
header('Content-Type: text/html; charset=utf-8');
session_start();
include 'db.php';
// Latest reviews
$latestReviews = $pdo->query("
SELECT r.comment, r.rating, u.username, c.name AS company_name
FROM reviews r
JOIN users u ON r.user_id = u.id
JOIN companies c ON r.company_id = c.id
ORDER BY r.id DESC
LIMIT 5
")->fetchAll();
// Top companies
$topCompanies = $pdo->query("
SELECT c.id, c.name, c.image, ROUND(AVG(r.rating),1) AS avg_rating
FROM companies c
JOIN reviews r ON c.id = r.company_id
GROUP BY c.id
HAVING COUNT(r.id) >= 1
ORDER BY avg_rating DESC
LIMIT 5
")->fetchAll();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Terms of Use - Review Stream</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Sans-serif fonts -->
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" href="/favicon.png" type="image/png" />
<style>
body { font-family: Arial, sans-serif; font-size: 16px; line-height: 1.7; padding-bottom: 60px}
.content-layout { display: flex; gap: 20px; flex-wrap: wrap; }
.main-content { flex: 3; min-width: 250px; }
.sidebar { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 15px; }
.legal-section {
background: #f9f9f9;
padding: 22px;
border-radius: 8px;
margin-bottom: 20px;
}
.legal-section h3 {
color: #4A90E2;
margin-top: 0;
font-size: 20px;
}
.highlight-box {
background: #e6f4ea;
padding: 14px;
border-left: 4px solid #28a745;
margin: 15px 0;
border-radius: 4px;
}
.star-box {
display: inline-block;
width: 16px; height: 16px;
font-size: 12px; line-height: 16px;
text-align: center;
border-radius: 3px;
margin-right: 2px;
color: white;
background-color: #ccc;
}
.star-box.filled { background-color: #28a745; }
.fixed-footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #222;
text-align: center;
padding: 10px 0;
color: #fff;
z-index: 1000;
}
.fixed-footer p{
font-family: 'Poppins', sans-serif !important;
font-size: 13px !important;
}
.footer-menu a {
margin: 0 10px;
text-decoration: none;
color: #fff;
font-family: 'Poppins', sans-serif !important;
font-size: 13px !important;
}
.footer-menu a:hover {
text-decoration: underline;
}
/* Collapsible menu */
.menu { display: none; flex-direction: column; }
.menu.active { display: flex; }
.menu a { padding: 8px 0; text-decoration: none; color: #333; }
.menu-toggle { font-size: 1.5em; cursor: pointer; }
@media(min-width: 768px){
.menu { display: flex !important; flex-direction: row; }
.menu a { margin-left: 15px; }
.menu-toggle { display: none; }
}
.topbar {
display:flex;
justify-content:space-between;
align-items:center;
padding:10px 20px;
background:#007BFF;
color:white;
}
.logo {
font-size: 20px;
font-weight: bold;
display: flex;
align-items: center;
gap: 10px;
}
.logo-icon {
display: inline-flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #a2d4f5, #fefb72); /* light blue to lemon */
border-radius: 50%;
width: 36px;
height: 36px;
box-shadow