<!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/png" href="<?= base_url('assets_/assets/img/logo-mini.png') ?>">
    <!-- ... (link CSS lainnya tetap sama) ... -->
    <style>
        .table-responsive {
            height: 720px;
            /* Sesuaikan tinggi tabel */
            overflow-y: auto;
            /* Aktifkan autoscroll vertikal */
            -ms-overflow-style: none;
            /* IE and Edge */
            scrollbar-width: none;
            /* Firefox */
        }

        .table-responsive::-webkit-scrollbar {
            display: none;
            /* Chrome, Safari, and Opera */
        }

        .background-image {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url('<?= base_url('assets_/assets/img/backgroundhd1.jpg') ?>');
            background-size: cover;
            background-position: center;
            opacity: 0.3;
            z-index: -1;
        }

        .table-bordered {
            width: 100%;
            border-collapse: collapse;
        }

        .table-bordered thead {
            position: sticky;
            top: 0;
            background-color: #007bff;
            /* Warna latar belakang header */
            z-index: 1;
            /* Pastikan header berada di atas konten */
        }

        .table-bordered th,
        .table-bordered td {
            border: 1px solid #dee2e6;
            /* Garis tabel lebih jelas */
            padding: 0.75rem;
            /* Tambah padding */
            vertical-align: middle;
            /* Rata tengah vertikal */
        }

        .table-bordered th {
            background-color: #007bff;
            /* Biru */
            color: white;
            text-align: center;
            font-weight: bold;
            font-size: 1.2em;
        }

        .table-bordered td {
            background-color: white;
            text-align: center;
            font-size: 1em;
        }



        .watermark {
            position: absolute;
            /* Gunakan absolute untuk posisi yang lebih fleksibel */
            bottom: 10px;
            /* Jarak dari bawah */
            left: 50%;
            transform: translateX(-50%);
            /* Pusatkan secara horizontal */
            pointer-events: none;
            z-index: -1;
            opacity: 0.6;
            font-size: 20px;
            /* Sesuaikan ukuran font */
            font-family: sans-serif;
            font-weight: bold;
            color: #000;
            text-align: center;
            /* Ratakan teks ke tengah */
            width: 100%;
            /* Pastikan watermark memenuhi lebar halaman */
        }
    </style>
    <!-- ... (link CSS lainnya tetap sama) ... -->
    <title>Antrean Poliklinik</title>
</head>

<body onload="table();">
    <div class="background-image"></div>
    <script>
        function table() {
            const xhttp = new XMLHttpRequest();
            xhttp.onload = function() {
                document.getElementById("tablei").innerHTML = this.responseText;
            }
            xhttp.open("GET", "<?= base_url("Poli/antrean") ?>");
            xhttp.send();
        }

        setInterval(function() {
            table();
        }, 1000); // Ubah interval menjadi 1000ms (1 detik)
    </script>

    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-24">
                    <div class="card">
                        <center>
                            <img src="<?php echo base_url(); ?>assets_/assets/img/and.png" height="70px" width="240px" style="margin-bottom: 20px; display: block; margin-left: auto; margin-right: auto;">

                            <h1><strong>INFORMASI ANTREAN POLI</strong></h1>
                            <h2 style=margin-bottom:20px><strong>RUMAH SAKIT UMUM ANANDA PURWOKERTO</strong></h2>
                        </center>
                        <!-- /.card-header -->
                        <div class="card-body">
                            <div id="table-container" class="table-responsive">
                                <table class="table table-bordered header-table">
                                    <thead>
                                        <tr>
                                            <th>Nama Dokter</th>
                                            <th>Klinik</th>
                                            <th>
                                                <center>Jam</center>
                                            </th>
                                            <th>Jumlah Pasien</th>
                                            <th>Dilayani</th>
                                            <th>Batal</th>
                                        </tr>
                                    </thead>
                                    <tbody id="tablei"></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.col -->
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <div id="table-container">
        <table>
            <tbody id="tablei">
            </tbody>
        </table>
    </div>
    <div class="watermark">By IT Support RSU ANANDA 2024</div>
    <!-- <script>
        document.addEventListener("DOMContentLoaded", function() {
            const container = document.getElementById('table-container');
            let scrollAmount = 0;
            const scrollStep = 1;
            const scrollInterval = 100;

            function autoScroll() {
                scrollAmount += scrollStep;
                if (scrollAmount >= container.scrollHeight - container.clientHeight) {
                    scrollAmount = 0;
                }
                container.scrollTop = scrollAmount;
            }

            setInterval(autoScroll, scrollInterval);
        });
    </script> -->
</body>

</html>