<!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 rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/icheck-bootstrap/icheck-bootstrap.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/jqvmap/jqvmap.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/summernote/summernote-bs4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/select2/css/select2.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bs-stepper/css/bs-stepper.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/dropzone/min/dropzone.min.css">
    <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/adminlte.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <title>Antrean Poliklinik</title>
    <style>
        #table-container {
            width: 100%;
            height: 500px;
            overflow: hidden;
            border: 1px solid #000;
            position: relative;
        }

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

        th,
        td {
            padding: 8px;
            border: 1px solid #ddd;
        }

        iframe {
            border: 0;
            overflow: hidden;
        }

        body {
            --space: 2rem;
        }

        .marquee {
            --duration: 60s;
            --gap: var(--space);
            background-color: rgb(21, 21, 165);
            font-color: #ffff;
            display: flex;
            overflow: hidden;
            user-select: none;
            gap: var(--gap);
        }

        .marquee__group {
            flex-shrink: 0;
            display: flex;
            margin: 10px;
            align-items: center;
            justify-content: space-around;
            gap: var(--gap);
            min-width: 100vw;
            animation: scroll var(--duration) linear infinite;
        }

        .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;
        }

        @media (prefers-reduced-motion: reduce) {
            .marquee__group {
                animation-play-state: paused;
            }
        }

        .marquee--reverse .marquee__group {
            animation-direction: reverse;
            animation-delay: calc(var(--duration) / -2);
        }

        @keyframes scroll {
            0% {
                transform: translateX(0);
            }

            100% {
                transform: translateX(calc(-100% - var(--gap)));
            }
        }

        /* Tambahan untuk memperbesar font judul */
        .title {
            font-size: 2.5em;
            /* Ukuran font yang lebih besar */
            color: #000;
            /* Warna font */
            /* Vertikal center */
        }

        .card-white {
            background-color: #ffffff;
            /* Warna latar belakang card */
            padding: 20px;
            /* Padding di dalam card */
            border-radius: 5px;
            /* Sudut melengkung */
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            /* Bayangan */
            margin-top: 20px;
            /* Jarak atas */
        }

        .logo {
            margin-right: 10px;
            /* Jarak antara logo dan judul */
            height: 50px;
            /* Tinggi logo */
        }

        .waktu {
            font-size: 25px;
            /* Perbesar ukuran font */
            text-align: right;
            /* Ratakan teks ke kiri */
            /* Tambahkan style lainnya jika diperlukan */
        }
    </style>
</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(null);
        }

        setInterval(function() {
            table();
        }, 1)
    </script>



    <center><br>
        <div
            style="display: flex; align-items: center; justify-content: center; gap: 10px;">
            <div>
                <h1 class="title">
                    <strong>LAYAR UFO</strong>
                </h1>
                <h3 style="font-size: 30px;">
                    <strong>(LAYAR ANTREAN & UPDATE INFORMASI)</strong> <br>
                    RUMAH SAKIT ANANDA PURWOKERTO
                </h3>
            </div>
        </div>
        <?php
        defined('BASEPATH') or exit('No direct script access allowed');

        if (!function_exists('format_indo')) {
            function format_indo($date)
            {
                date_default_timezone_set('Asia/Bangkok'); // Perbaikan zona waktu
                $Hari = array("Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu");
                $Bulan = array("Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");

                $tahun = substr($date, 0, 4);
                $bulan = substr($date, 5, 2);
                $tgl = substr($date, 8, 2);
                $waktu = substr($date, 11, 5);
                $hari = date("w", strtotime($date));
                $result = $Hari[$hari] . ", " . $tgl . " " . $Bulan[(int)$bulan - 1] . " " . $tahun . " " . $waktu;

                return $result;
            }
        }
        date_default_timezone_set('Asia/Bangkok');
        $initialDate = date('Y-m-d H:i:s'); // Tanggal awal dari server


        ?>

        <!-- Setting Waktu Realtime  -->
        <span class="waktu" id="waktu_indo"><?php echo format_indo($initialDate); ?></span>

        <script>
            function updateWaktuIndo() {
                const now = new Date();
                const options = {
                    weekday: 'long',
                    year: 'numeric',
                    month: 'long',
                    day: 'numeric',
                    hour: 'numeric',
                    minute: 'numeric',
                    second: 'numeric',
                    timeZone: 'Asia/Bangkok'
                };
                const waktuIndoString = now.toLocaleString('id-ID', options);

                document.getElementById('waktu_indo').textContent = waktuIndoString;
            }

            setInterval(updateWaktuIndo, 1000);
            updateWaktuIndo();
        </script>

        <br>
    </center>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6">
                    <div class="card card-white">
                        <div class="card-body">
                            <table class="table " style="width: 100%;">
                                <thead>
                                    <tr>
                                        <th width="25%" style="color:#000080">
                                            <center>Nama Dokter</center>
                                        </th>
                                        <th width="20%" style="color:#000080">
                                            <center>Klinik</center>
                                        </th>
                                        <th width="20%" style="color:#000080">
                                            <center>Jam</center>
                                        </th>
                                        <th width="10%" style="color:#000080">
                                            <center>Jumlah Pasien</center>
                                        </th>
                                        <th width="11%" style="color:#000080">
                                            <center>Dilayani</center>
                                        </th>
                                        <th width="8%" style="color:#000080">
                                            <center>Sisa</center>
                                        </th>
                                    </tr>
                                </thead>
                            </table>
                            <div id="table-container">
                                <table>
                                    <tbody id="tablei">
                                    </tbody>
                                </table>
                            </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>
                        </div>
                    </div>
                </div>
                <div class="marquee">
                    <div class="marquee__group">
                        <p style="color: #fff;">"RSU ANANDA PURWOKERTO - KESEHATAN ANDA KEBAHAGIAAN KAMI"</p>
                        <p aria-hidden="true" style="color: #fff;">"RUMAH SAKIT PILIHAN UTAMA MASYARAKAT YANG
                            BERFOKUS KEPADA PASIEN DENGAN
                            MENGUTAMAKAN MUTU DAN KESELAMATAN PASIEN"</p>
                    </div>
                    <div aria-hidden="true" class="marquee__group">
                        <p style="color: #fff;">"RSU ANANDA PURWOKERTO - KESEHATAN ANDA KEBAHAGIAAN KAMI"</p>
                        <p style="color: #fff;">"RUMAH SAKIT PILIHAN UTAMA MASYARAKAT YANG
                            BERFOKUS KEPADA PASIEN DENGAN
                            MENGUTAMAKAN MUTU DAN KESELAMATAN PASIEN"</p>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <center>
        <h6 style="margin-top: 20px;"><strong>by IT RSU ANANDA PURWOKERTO</strong></h6>
    </center>
    <script src="<?php echo base_url(); ?>plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="<?php echo base_url(); ?>plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
    <script src="<?php echo base_url(); ?>dist/js/adminlte.js"></script>
    <script src="<?php echo base_url() ?>plugins/select2/js/select2.full.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/moment/moment.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/daterangepicker/daterangepicker.js"></script>
    <script src="<?php echo base_url() ?>plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/summernote/summernote-bs4.min.js"></script>
    <script src="<?php echo base_url(); ?>plugins/jquery-mousewheel/jquery.mousewheel.js"></script>
    <script src="<?php echo base_url(); ?>plugins/raphael/raphael.min.js"></script>
    <script src="<?php echo base_url(); ?>plugins/jquery-mapael/jquery.mapael.min.js"></script>
    <script src="<?php echo base_url(); ?>plugins/jquery-mapael/maps/usa_states.min.js"></script>
    <script src="<?php echo base_url(); ?>plugins/chart.js/Chart.min.js"></script>
    <script src="<?php echo base_url(); ?>dist/js/pages/dashboard2.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/jszip/jszip.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/pdfmake/pdfmake.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/pdfmake/vfs_fonts.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-buttons/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-buttons/js/buttons.print.min.js"></script>
    <script src="<?php echo base_url() ?>plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
    <script src="<?php echo base_url() ?>assets_/js/antibiotik_rajal.js"></script>
    <script>
        $(function() {
            $("#example1").DataTable({
                "responsive": true,
                "lengthChange": false,
                "autoWidth": false,
            }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
            $('#example2').DataTable({
                "paging": true,
                "lengthChange": false,
                "searching": false,
                "ordering": true,
                "info": true,
                "autoWidth": false,
                "responsive": true,
            });
        });
    </script>
</body>

</html>