<?php
include '../koneksi.php';

// Query untuk menghitung jumlah data
$jumlah_penyakit = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM penyakit"));
$jumlah_gejala = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM gejala"));
$jumlah_rule = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM rule"));
?>

<!DOCTYPE html>
<html>
<head>
    <title>Dashboard</title>
    <style>
        .card {
            width: 300px;
            height: 80px;
            margin: 10px;
            padding: 15px;
            color: white;
            font-weight: bold;
            display: inline-block;
            text-align: center;
        }
        .penyakit { background-color:rgb(83, 226, 242); }
        .gejala { background-color: #2196F3; }
        .rule { background-color:rgb(174, 54, 244); }
        .container { text-align: left; margin-top: 40px; }
        h2 {
            color: #000;
            margin-top: 80px;
            text-align: center;
        }
        h3 {
            color: #000;
            text-align: left;
            font-size: 24px;
            margin-bottom: 30px;
        }
    </style>
</head>
<body>
    <div class="container">
    <h3><strong>Dashboard Admin</strong></h3>
    <hr style="border: 0,9px solid #000; width: 100%; margin-bottom: 30px;">

        <div class="card penyakit">
            DATA PENYAKIT<br><?php echo $jumlah_penyakit; ?>
        </div>
        <div class="card gejala">
            DATA GEJALA<br><?php echo $jumlah_gejala; ?>
        </div>
        <div class="card rule">
            DATA RULE<br><?php echo $jumlah_rule; ?>
        </div>

            <h2>Selamat Datang di Sistem Pakar</h2>
            <p style="text-align: center;">Diagnosa Hama & Penyakit Tembakau</p>

    </div>
</body>
</html>
