<?php
// Redirect to welcome page for new design
header('Location: welcome.php');
exit();
require_once 'config/database.php';
require_once 'includes/auth.php';
$database = new Database();
$db = $database->getConnection();
// Get services for homepage
$query = "SELECT * FROM services WHERE status = 'active' ORDER BY created_at DESC LIMIT 6";
$stmt = $db->prepare($query);
$stmt->execute();
$services = $stmt->fetchAll(PDO::FETCH_ASSOC);
// Get doctors for homepage
$query = "SELECT * FROM doctors WHERE status = 'active' ORDER BY created_at DESC LIMIT 4";
$stmt = $db->prepare($query);
$stmt->execute();
$doctors = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Opti-Vision Eye Clinic - Professional Eye Care</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm fixed-top">
<div class="container">
<a class="navbar-brand fw-bold text-primary" href="index.php">
<i class="fas fa-eye me-2"></i>Opti-Vision
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services.php">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="doctors.php">Doctors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<?php if (isLoggedIn()): ?>
<li class="nav-item">
<a class="nav-link" href="user/dashboard.php">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout</a>
</li>
<?php else: ?>
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
<li class="nav-item">
<a class="btn btn-outline-primary ms-2 me-2" href="register.php">Register</a>
</li>
<li class="nav-item">
<a class="btn btn-primary ms-2" href="shop-signup.php">Register Shop</a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero-section">
<div class="container">
<div class="row align-items-center min-vh-100">
<div class="col-lg-6">
<h1 class="display-4 fw-bold text-white mb-4">Your Vision, Our Priority</h1>
<p class="lead text-white mb-4">Professional eye care services with state-of-the-art technology and experienced specialists.</p>
<div class="d-flex gap-3">
<a href="appointment.php" class="btn btn-primary btn-lg">Book Appointment</a>
<a href="services.php" class="btn btn-outline-light btn-lg">Our Services</a>
</div>
</div>
<div class="col-lg-6">
<div class="hero-image">
<img src="assets/images/hero-eye-care.jpg" alt="Eye Care" class="img-fluid rounded-3 shadow">
</div>
</div>
</div>
</div>
</section>
<!-- Services Section -->
<section class="py-5">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Our Services</h2>
<p class="lead text-muted">Comprehensive eye care solutions for all ages</p>
</div>
<div class="row g-4">
<?php foreach($services as $service): ?>
<div class="col-lg-4 col-md-6">
<div class="card h-100 shadow-sm border-0">
<div class="card-body text-center p-4">
<div class="service-icon mb-3">
<i class="fas fa-eye fa-3x text-primary"></i>
</div>
<h5 class="card-title"><?php echo htmlspecialchars($service['title']); ?></h5>
<p class="card-text text-muted"><?php echo htmlspecialchars($service['description']); ?></p>
<div class="price-tag">
<span class="h5 text-primary">PKR <?php echo number_format($service['price']); ?></span>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="text-center mt-5">
<a href="services.php" class="btn btn-primary btn-lg">View All Services</a>
</div>
</div>
</section>
<!-- Doctors Section -->
<section class="py-5 bg-light">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Our Expert Doctors</h2>
<p class="lead text-muted">Meet our experienced ophthalmologists</p>
</div>
<div class="row g-4">
<?php foreach($doctors as $doctor): ?>
<div class="col-lg-3 col-md-6">
<div class="card h-100 shadow-sm border-0">
<div class="card-body text-center p-4">
<div class="doctor-image mb-3">
<img src="assets/images/doctors/<?php echo $doctor['image'] ?: 'default.jpg'; ?>"
alt="<?php echo htmlspecialchars($doctor['name']); ?>"
class="rounded-circle" width="120" height="120">
</div>
<h5 class="card-title"><?php echo htmlspecialchars($doctor['name']); ?></h5>
<p class="text-primary fw-semibold"><?php echo htmlspecialchars($doctor['specialization']); ?></p>
<p class="card-text small text-muted"><?php echo htmlspecialchars($doctor['qualification']); ?></p>
<p class="text-muted"><?php echo $doctor['experience']; ?> years experience</p>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="text-center mt-5">
<a href="doctors.php" class="btn btn-primary btn-lg">Meet All Doctors</a>
</div>
</div>
</section>
<!-- CTA Section -->
<section class="py-5 bg-primary text-white">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-8">
<h2 class="display-6 fw-bold mb-3">Ready to Take Care of Your Vision?</h2>
<p class="lead mb-0">Book your appointment today and experience professional eye care.</p>
</div>
<div class="col-lg-4 text-lg-end">
<a href="appointment.php" class="btn btn-light btn-lg">Book Now</a>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-dark text-white py-5">
<div class="container">
<div class="row g-4">
<div class="col-lg-4">
<h5 class="fw-bold mb-3">
<i class="fas fa-eye me-2"></i>Opti-Vision
</h5>
<p class="text-muted">Professional eye care services with modern technology and experienced specialists.</p>
<div class="social-links">
<a href="#" class="text-white me-3"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="text-white me-3"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-white me-3"><i class="fab fa-instagram"></i></a>
<a href="#" class="text-white"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="col-lg-2">
<h6 class="fw-bold mb-3">Quick Links</h6>
<ul class="list-unstyled">
<li><a href="about.php" class="text-muted text-decoration-none">About Us</a></li>
<li><a href="services.php" class="text-muted text-decoration-none">Services</a></li>
<li><a href="doctors.php" class="text-muted text-decoration-none">Doctors</a></li>
<li><a href="contact.php" class="text-muted text-decoration-none">Contact</a></li>
</ul>
</div>
<div class="col-lg-3">
<h6 class="fw-bold mb-3">Services</h6>
<ul class="list-unstyled">
<li><a href="#" class="text-muted text-decoration-none">Eye Examination</a></li>
<li><a href="#" class="text-muted text-decoration-none">Cataract Surgery</a></li>
<li><a href="#" class="text-muted text-decoration-none">LASIK Surgery</a></li>
<li><a href="#" class="text-muted text-decoration-none">Glaucoma Treatment</a></li>
</ul>
</div>
<div class="col-lg-3">
<h6 class="fw-bold mb-3">Contact Info</h6>
<ul class="list-unstyled text-muted">
<li><i class="fas fa-map-marker-alt me-2"></i>123 Medical Center, Karachi</li>
<li><i class="fas fa-phone me-2"></i>+92 300 1234567</li>
<li><i class="fas fa-envelope me-2"></i>info@optivision.com</li>
<li><i class="fas fa-clock me-2"></i>Mon-Fri: 9AM-6PM</li>
</ul>
</div>
</div>
<hr class="my-4">
<div class="text-center text-muted">
<p>© 2024 Opti-Vision Eye Clinic. All rights reserved.</p>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>