<?php
session_start();

// Pastikan hanya pelanggan yang dapat mengakses
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'pelanggan') {
    header("Location: login.php");
    exit;
}
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home - Aplikasi Jasa Servis AC di Kabupaten Pidie</title>
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f4f4f4;
        }
        .navbar-custom {
            background-color: #28a745; /* Hijau */
        }
        .header {
            text-align: center;
            padding: 20px 0;
            color: #fff;
            background-color: #28a745; /* Hijau */
        }
        .icon-container {
            background-color: #ffffff;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            margin: 20px;
        }
        .icon-row {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap; /* Agar responsif */
        }
        .icon-box {
            text-align: center;
            margin: 10px;
            width: 80px; /* Ukuran tetap untuk ikon */
        }
        .icon-box i {
            font-size: 24px; /* Ukuran ikon */
            color: #28a745; /* Hijau untuk ikon */
        }
        .icon-box h5 {
            font-size: 11px; /* Ukuran teks judul ikon lebih kecil */
            margin-top: 5px;
        }
        footer {
            text-align: center;
            padding: 10px 0;
            background-color: #28a745; /* Hijau */
            color: white;
        }
    </style>
</head>
<body>

    <nav class="navbar navbar-expand-lg navbar-custom">
        <a class="navbar-brand" href="#" style="color: white;">Jasa Servis AC</a>
    </nav>

    <div class="header">
        <h1>Selamat Datang, Pelanggan</h1>
        <p>Aplikasi Jasa Servis AC di Kabupaten Pidie</p>
    </div>

    <div class="container icon-container">
        <h4>Menu Utama</h4>
        <div class="icon-row">

            <div class="icon-box">
                <a href="servis.php">
                    <i class="fas fa-wrench"></i>
                    <h5>Pesan Servis AC</h5>
                </a>
            </div>
            <div class="icon-box">
                <a href="riwayat_servis.php">
                    <i class="fas fa-history"></i>
                    <h5>Riwayat Servis</h5>
                </a>
            </div>
            <div class="icon-box">
                <a href="status_pesanan.php">
                    <i class="fas fa-info-circle"></i>
                    <h5>Status Servis</h5>
                </a>
            </div>
            <div class="icon-box">
                <a href="profil_pelanggan.php">
                    <i class="fas fa-user"></i>
                    <h5>Profil Pelanggan</h5>
                </a>
            </div>
            <div class="icon-box">
                <a href="logout.php">
                    <i class="fas fa-sign-out-alt"></i>
                    <h5>Logout</h5>
                </a>
            </div>

        </div>
    </div>

    <footer>
        <p>&copy; 2024 Jasa Servis AC Kabupaten Pidie. All rights reserved.</p>
    </footer>

</body>
</html>
