<style>
    .float {
        background: #4e73df;
        color: white;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        text-decoration: none;
        font-family: sans-serif;
        font-size: 14pt;
        position: fixed;
        width: 60px;
        height: 60px;
        bottom: 40px;
        right: 40px;
        background-color: #4e73df;
        color: #FFF;
        border-radius: 50px;
        text-align: center;
        box-shadow: 2px 2px 3px #999;
        margin-top: 32px;
    }

    .scroll-to-top {
        display: none !important;
    }
</style>

<!-- Begin Page Content -->
<div class="container-fluid">
    <div class="row">
        <?php if ($_SESSION['role'] == "admin") { ?>
            <!-- Earnings (Monthly) Card Example -->
            <div class="col-xl-3 col-md-6 mb-4">
                <div class="card border-left-primary shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                    Jumlah Gejala</div>
                                <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo $total_gejala['total']; ?> Gejala</div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-pen fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Earnings (Monthly) Card Example -->
            <div class="col-xl-3 col-md-6 mb-4">
                <div class="card border-left-success shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-success text-uppercase mb-1">
                                    Jumlah Penyakit</div>
                                <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo $total_penyakit['total']; ?> Penyakit</div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-list fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Earnings (Monthly) Card Example -->
            <div class="col-xl-3 col-md-6 mb-4">
                <div class="card border-left-info shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-info text-uppercase mb-1">Data Pengetahuan
                                </div>
                                <div class="row no-gutters align-items-center">
                                    <div class="col-auto">
                                        <div class="h5 mb-0 mr-3 font-weight-bold text-gray-800"><?php echo $total_basis_pengetahuan['total']; ?> Data</div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-comments fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Pending Requests Card Example -->
            <div class="col-xl-3 col-md-6 mb-4">
                <div class="card border-left-warning shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
                                    Jumlah Pengguna</div>
                                <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo $total_users['total']; ?> Pengguna</div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-users fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <?php } else { ?>
            <!-- Earnings (Monthly) Card Example -->
            <div class="col-xl-6 col-md-6 mb-4">
                <div class="card border-left-info shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-info text-uppercase mb-1">Total Diagnosa
                                </div>
                                <div class="row no-gutters align-items-center">
                                    <div class="col-auto">
                                        <div class="h5 mb-0 mr-3 font-weight-bold text-gray-800"><?php echo $total_diagnosa['total']; ?> Hasil</div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-comments fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Pending Requests Card Example -->
            <div class="col-xl-6 col-md-6 mb-4">
                <div class="card border-left-warning shadow h-100 py-2">
                    <div class="card-body">
                        <div class="row no-gutters align-items-center">
                            <div class="col mr-2">
                                <div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
                                    Riwayat Konsultasi Saya</div>
                                <div class="h5 mb-0 font-weight-bold text-gray-800"><?php echo $total_diagnosa_saya['total']; ?> Hasil</div>
                            </div>
                            <div class="col-auto">
                                <i class="fas fa-users fa-2x text-gray-300"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <?php } ?>

        <div class="col-xl-12 col-md-12">
            <div class="card">
                <div class="card-body">
                    <h2 style="color: #000;">Diagnosa Penyakit</h2>
                    <hr>
                    <div class='alert alert-success alert-dismissible'>
                        <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
                        <h4><i class='icon fa fa-exclamation-triangle'></i>Perhatian !</h4>
                        Silahkan memilih gejala sesuai dengan kondisi ayam anda, anda dapat memilih kepastian kondisi ayam dari pasti tidak sampai pasti ya, pada kondisi dari pasti tidak sampai tidak tahu merupakan nilai ketidakbenaran dalam suatu gejala sedangkan kondisi mungkin ya sampai pasti ya merupakan nilai kebenaran dalam suatu gejala jika sudah tekan tombol proses <strong>🔍</strong> di bawah untuk melihat hasil.
                    </div>

                    <div class="table-responsive">
                        <form method="POST" action="">
                            <table class="table table-bordered" width="100%" cellspacing="0">
                                <thead>
                                    <tr>
                                        <th>No</th>
                                        <th>Kode</th>
                                        <th>Gejala</th>
                                        <th>Pilih Kondisi</th>
                                    </tr>
                                </thead>
                                <tbody class="pilihkondisi">
                                    <?php $no = 1;
                                    foreach ($datasets as $k => $d) { ?>
                                        <tr>
                                            <td><?php echo $no;
                                                $no++; ?></td>
                                            <td><?php echo str_pad($d['kode_gejala'], 3, '0', STR_PAD_LEFT); ?></td>
                                            <td><?php echo $d['nama_gejala']; ?></td>
                                            <td class="opsi">
                                                <select name="kondisi[]" id="sl<?php echo $k; ?>" class="form-control opsikondisi">
                                                    <option data-id="0" value="0">Pilih jika sesuai</option>
                                                    <?php foreach ($kondisi as $ki) { ?>
                                                        <option data-id="<?php echo $ki['id']; ?>" value="<?php echo $d['kode_gejala'] . '_' . $ki['id']; ?>"><?php echo $ki['kondisi']; ?></option>
                                                    <?php } ?>
                                                </select>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                    <input class="float" type="submit" data-toggle="tooltip" data-placement='top' title='Klik disini untuk melihat hasil diagnosa' name="submit" value='🔍' style='font-family:Arial, FontAwesome'>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /.container-fluid -->