https://regonline.rs-elisabeth.com/

URL inviato:
https://regonline.rs-elisabeth.com/
Report terminato:

I link in uscita identificati dalla pagina

Variabili JavaScript · 8 trovate

Le variabili JavaScript globali caricate sull'oggetto finestra di una pagina sono variabili dichiarate all'esterno delle funzioni e accessibili da qualsiasi punto del codice nell'ambito corrente

NomeTipo
onbeforetoggleobject
documentPictureInPictureobject
onscrollendobject
Popperobject
uidEventnumber
bootstrapobject
$function
jQueryfunction

Messaggi di log della console · 0 trovati

Messaggi registrati nella console Web

HTML

Il corpo HTML non elaborato della pagina

<html lang="en"><head><meta http-equiv="Content-Language" content="en">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://rs-elisabeth.com/css/regonlinecss/assets/css/bootstrap.css">
<link rel="stylesheet" href="https://rs-elisabeth.com/css/regonlinecss/assets/css/inputstyle.css">
<link rel="stylesheet" href="https://rs-elisabeth.com/css/regonlinecss/assets/css/style.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.min.css">
<link rel="stylesheet" type="text/css" href="https://rs-elisabeth.com/css/regonlinecss/assets/css/bootstrap-datepicker3.min.css">


<title>Registrasi Online || RS St. Elisabeth Semarang</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.9.2/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.2/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.14.0-beta/js/bootstrap-select.min.js" integrity="sha512-I0sRMhP0loaoXaytYuOHHU3pGmyQklf5irZZ8cSaIPi9ETq5qvfcDAiBJ4vqpaq8xeUe7ZVwYM5xqQlxYDK3Uw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://rs-elisabeth.com/css/regonlinecss/assets/js/bootstrap-datepicker.min.js">
</script>
<style>
    @media screen {
        #printSection {
            display: none;
        }
    }

    @media print {
        body * {
            visibility: hidden;
            color: black;
        }

        #printSection,
        #printSection * {
            visibility: visible;
        }

        #printSection {
            width: 100%;
            /* auto is the initial value */
            margin: 0mm;
            font-size: 20px;
            position: absolute;
            left: 0;
            top: 0;
        }

        #btnPrint {
            display: none;
        }
    }
</style>

</head><body><div class="modal" id="imageModal">
  <div class="modal-dialog  modal-xl">
    <div class="modal-content">
      <div class="modal-body">
        <img src="popupnotifikasi.jpg" width="100%" alt="Image">
      </div>
    </div>
  </div>
</div>
<div class="container p-3">
<div class="alert alert-success" role="alert">
  <h4 class="alert-heading">Pemberitahuan</h4>
  <p>Pendaftaran <strong>dr. B. Kris Pranarka, Sp.F-ML, Sp.PD, KGer, FINASIM</strong> dapat dilakukan dengan memilih poli <strong>Klinik Lanjut Usia (Geriatri)</strong></p>
</div>
</div>
<div class="container text-white" style="padding-top: 15%; font-size: 38px; display: none;" id="partialweb">
    <div class="row mt-5 text-center">
        <div>
            <p>Registrasi Online dapat diakses kembali pada pukul 05:00 WIB. Terimakasih</p>
            <p>—Rumah Sakit St. Elisabeth</p>
        </div>
    </div>
</div>
<div class="container contact-form" id="fullweb" style="display: block;">
    <input type="text" id="ip_pasien" value="104.28.154.61" hidden="">
    <div class="contact-image">
        <img src="header.png">
    </div>
    <div class="row p-3 mt-1 mb-1">
        <div class="col-12 text-center" id="notifikasiBar">
            <span>Bila Anda belum pernah berobat di RS ST Elisabeth Semarang, silahkan klik </span> <br><button class="btn btn-success" id="linkDaftarBaru">Pendaftaran Baru</button>
                <br>
            <button class="btn btn-danger mt-2" id="btnBatalAppointment">Batal Appointment</button>
        </div>
        <div class="col-12 text-center" id="BatalDaftar" style="display: none;">
            <button class="btn btn-danger" id="linkBatalDaftar">Batal Pendaftaran Baru</button>
        </div>
    </div>
    <form method="post" id="daftarbaru" enctype="multipart/form-data" style="display: none;">
        <div class="row mt-1 p-1 mb-3">
        <!-- <div class="alert alert-danger" role="alert">
  <h4 class="alert-heading">Pemberitahuan</h4>
  <p>Terkait dengan pemeliharaan sistem informasi RS, <strong>Bagi pasien yang belum pernah melakukan pemeriksaan di RS ST.Elisabeth Semarang, Silahkan menghubungi Whatsapp di nomor 082138927232 untuk dilakukan proses pembuatan nomor rekam medis pasien. Mohon maaf atas ketidaknyamanannya. Terima Kasih. </strong></p>
</div> -->
            <div class="col-md-6 p-2 mt-1">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Data Diri</b></h6>
                <span id="ceknikalert" style="color:green;font-size:12px;"><span class="text-danger">NIK harus 16 karakter!</span></span>
                <div class="input ">
                    <input type="text" class="input-field" id="nik" name="nik" maxlength="16" required="">
                    <label class="input-label">No. KTP / No. Identitas</label>
                </div>
                <div class="input">
                    <input type="text" class="input-field" name="nama" onkeyup="this.value = this.value.toUpperCase();" required="">
                    <label class="input-label">Nama Lengkap</label>
                </div>
                <div class="input-select">

                    <select class="form-select" name="jk" id="jk">
                        <option value="0">-- Pilih Jenis Kelamin --</option>
                        <option value="M">PRIA</option>
                        <option value="F">WANITA</option>
                    </select>
                    <label>Jenis Kelamin</label>
                </div>
                <div class="input">
                    <input type="date" class="input-field" name="tgllahir" id="tgllahir" onfocus="(this.type='date')" onblur="if(!this.value)this.type='text'" required="">
                    <label class="input-label">Tgl Lahir</label>
                </div>
                <div class="input">
                    <input type="text" class="input-field" name="kotalahir" onkeyup="this.value = this.value.toUpperCase();" required="">
                    <label class="input-label">Tempat Lahir</label>
                </div>
                <div class="input">
                    <input type="text" class="input-field" name="alamat" onkeyup="this.value = this.value.toUpperCase();" required="">
                    <label class="input-label">Alamat</label>
                </div>
                <div class="input-select">
                    <select class="form-select" id="prov" name="prov"> <option value="0" selected="">-- Pilih Provinsi --</option><option value="11">ACEH</option><option value="12">SUMATERA UTARA</option><option value="13">SUMATERA BARAT</option><option value="14">RIAU</option><option value="15">JAMBI</option><option value="16">SUMATERA SELATAN</option><option value="17">BENGKULU</option><option value="18">LAMPUNG</option><option value="19">KEPULAUAN BANGKA BELITUNG</option><option value="21">KEPULAUAN RIAU</option><option value="31">DKI JAKARTA</option><option value="32">JAWA BARAT</option><option value="33">JAWA TENGAH</option><option value="34">DI YOGYAKARTA</option><option value="35">JAWA TIMUR</option><option value="36">BANTEN</option><option value="51">BALI</option><option value="52">NUSA TENGGARA BARAT</option><option value="53">NUSA TENGGARA TIMUR</option><option value="61">KALIMANTAN BARAT</option><option value="62">KALIMANTAN TENGAH</option><option value="63">KALIMANTAN SELATAN</option><option value="64">KALIMANTAN TIMUR</option><option value="65">KALIMANTAN UTARA</option><option value="71">SULAWESI UTARA</option><option value="72">SULAWESI TENGAH</option><option value="73">SULAWESI SELATAN</option><option value="74">SULAWESI TENGGARA</option><option value="75">GORONTALO</option><option value="76">SULAWESI BARAT</option><option value="81">MALUKU</option><option value="82">MALUKU UTARA</option><option value="91">PAPUA BARAT</option><option value="94">PAPUA</option><option value="95">PAPUA TENGAH</option></select>
                    <label>Provinsi</label>
                </div>
                <div class="input-select">

                    <select class="form-select" id="kota" name="kota">
                        <option value="0" selected="">-- Pilih Kota --</option>
                    </select>
                    <label>Kota</label>
                    <input type="text" class="input-field" name="hdnkota" id="kotahidden" hidden="">
                </div>
                <div class="input-select">
                    <select class="form-select" id="kecamatan" name="kecamatan">
                        <option value="0" selected="">-- Pilih Kecamatan --</option>
                    </select>
                    <label>Kecamatan</label>
                    <input type="text" class="input-field" name="hdnkecamatan" id="kecamatanhidden" hidden="">
                </div>
                <div class="input-select">
                    <select class="form-select" id="kelurahan" name="kelurahan">
                        <option value="0" selected="">-- Pilih Kelurahan --</option>
                    </select>
                    <label>Kelurahan</label>
                    <input type="text" class="input-field" name="hdnkelurahan" id="kelurahanhidden" hidden="">
                </div>

            </div>
            <div class="col-md-6 p-2 mt-1">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Kelengkapan </b></h6>
                <div class="input mt-4">
                    <input type="text" class="input-field" name="wa" id="wa_baru" placeholder="08xxx" required="">
                    <label class="input-label">Nomor Whatsapp</label>
                </div>
                <div class="input mb-3">
                    <input type="text" class="input-field" name="email" required="">
                    <label class="input-label">E-mail</label>
                </div>
                <!-- <h5>Upload Kartu Identitas</h5>

                <input type="file" name="ktp" class="form-control w-100" id="ktp" accept="image/*" />
                <br>
                <h5>Upload Foto Diri</h5>

                <input type="file" name="fotodiri" class="form-control" id="foto" accept="image/*" /> -->
            </div>
        </div>
        <button type="button" id="kirimpendaftaran" class="btn btn-success btn-kirim w-100">Kirim</button>
        <div class="row">
            <div class="col-md-12 mb-2">
                <hr style="color:black;">
                <center>
                    <span style="font-size:14px;"><input class="form-check-input" type="checkbox" value="" id="checkpersetujuan"> Ya saya setuju, dengan melakukan pendaftaran saya sudah menyetujui <a href="#" style="text-decoration:none;" data-bs-toggle="modal" data-bs-target="#staticBackdrop">peraturan dan persetujuan</a> dari Rumah Sakit St.
                        Elisabeth Semarang.</span>
                </center>
            </div>
        </div>
    </form>
    <form method="post" id="regonline" style="display: block;">

        <div class="row mt-2  p-1">
            <div class="col-md-12 p-1 mb-2">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Pembayaran </b></h6>
                <div class="mb-3">
                    <select class="form-select" name="carabayar" id="carabayar">
                        <option value="0">-- Pilih Jenis Pembayaran --</option>
                        <option value="PERSONAL">Pribadi</option>
                        <option value="ASURANSI">Asuransi</option>
                        <option value="BPJS">BPJS Kesehatan</option>
                    </select>
                </div>
                <div class="mb-3">
                    <label class=" text-secondary mb-2">Tanggal Periksa</label>
                    <input type="text" class="form-control datepicker" name="tglperiksa" id="tglperiksa" readonly="">
                    <span style="color:red;font-size:12px;">Pastikan tanggal anda bukan tanggal libur nasional!</span>
                </div>

            </div>
        </div>
        <div class="row p-1">
            <div class="col-md-12 p-1 mb-2">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Data Diri </b></h6>
                <div class="mb-3">
                    <label class="text-secondary mb-2">Tanggal Lahir</label>
                    <input type="text" class="form-control" name="dob" id="dobsearch" placeholder="hhbbtttt">
                    <span style="color:red;font-size:12px;">gunakan format tanggal bulan tahun (31011995)</span>
                </div>
                <br>
                <span style="color:red;font-size:12px;">Silahkan pilih salah satu</span>
                <div>
                    <div class="row mb-3 pt-1">
                        <div class="input">
                            <input type="text" class="input-field" name="cari_nik" id="cari_nik" placeholder="NIK / KIA" maxlength="16" disabled="">

                        </div>
                    </div>
                    <div class="row mb-3 mx-auto"> Atau
                    </div>
                    <div class="row mb-3" id="rm-input">
                        <label class=" text-secondary mb-2">No Rekam Medis</label>
                        <div class="col">
                            <input type="number" name="rm1" id="rm1" class="form-control rminput" placeholder=" - - " maxlength="2" disabled="">
                        </div>
                        <div class="col">
                            <input type="number" name="rm2" id="rm2" class="form-control rminput" placeholder=" - - " maxlength="2" disabled="">
                        </div>
                        <div class="col">
                            <input type="number" name="rm3" id="rm3" class="form-control rminput" placeholder=" - - " maxlength="2" disabled="">
                        </div>
                        <div class="col">
                            <input type="number" name="rm4" id="rm4" class="form-control rminput" placeholder=" - - - - " maxlength="4" disabled="">
                        </div>
                        <span style="color:red;font-size:12px;">Untuk format no RM pasien lama, 2 digit belakang
                            ditambah 20 di depannya, contoh : 012345-78 menjadi 012345-2078.</span>
                    </div>
                </div>

                <div id="alertrm">
                </div>
                <div class="row mb-3 pt-2">
                    <div class="input">
                        <input type="text" class="input-field" name="wa_janji" id="wa_janji" placeholder="No Whatsapp 08xxxxx" required="">

                        <span style="color:red;font-size:12px;">Pastikan nomor yang anda masukkan valid. Untuk keperluan
                            informasi dan verifikasi.</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="row p-1">
            <div class="col-md-12 p-1 mb-1">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Pilih Pemeriksaan </b></h6>
                <div class="mb-3">
                    <label class=" text-secondary mb-2">Poli</label>
                    <select class="form-select" id="poli" name="poli">
                        <option value="0" selected="">-- Pilih Poli --</option>
                    </select>
                </div>
                <div class="mb-3">
                    <label class=" text-secondary mb-2">Dokter</label>
                    <select class="form-select" id="dokter" name="dokter">
                        <option value="0" selected="">-- Pilih Dokter --</option>
                    </select>
                </div>
            </div>
            <div class="col-md-12 p-1 mb-2" id="alertkuota">
            </div>
        </div>
        <button class="btn btn-success btn-kirim w-100" id="kirimjanji">Daftar</button>
    </form>
    <form method="post" id="frmcheckin" style="display: none;">
        <div class="row mt-2 p-1">
            <div class="col-md-12 p-1 mb-2">
                <h6 class="text-info"><span style="color:red;">◈</span><b> Status Antrian </b></h6>
                <div class="input">
                    <input type="text" class="input-field" name="noantrian" id="cariantrian" required="">
                    <label class="input-label">Kode Booking</label>
                </div>
            </div>
            <div class="col-md-12 p-1 mb-2" id="statusantrian">

            </div>
            <button class="btn btn-success btn-kirim w-100" id="kirimcekantrian">Cek Status Antrian</button>
        </div>
    </form>
</div>
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header" style="background-color: #008ED6;color:#fff;">
                <h5 class="modal-title" id="staticBackdropLabel">Peraturan dan Persetujuan</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body" style="text-align: justify;text-justify: inter-word;">
                <p>1. Saya menyetujui proes pelayanan kesehatan di Rumah Sakit ST. Elisabeth sebagai pasien rawat jalan.
                </p>
                <p>2. Saya mengerti dan memahami tentang hak hak dan kewajiban saya sebagai pasien seperti yang telah
                    diinformasikan oleh petugas.</p>
                <p>3. Saya menyetujui proses pelayanan kesehatan di Rumah Sakit ST. Elisabeth sebagai pasien rawat jalan
                    sesuai kebutuhan medis. Pelayanan kesehatan dapat meliputi pemeriksaan fisik,pemeriksaan penunjan
                    seperti radiologi, laboratorium,patologi,atau pemeriksaan penunjang lainnya serta tindakan dan
                    pemasangan alat medis yang diperlukan.</p>
                <p>4. Saya memahami Rumah Sakit ST. Elisabeth akan menjamin kerahasiaan informasi yang ada di dalam diri
                    saya termasuk diagnosis, hasil laboratorium,dan hasil tes diagnostik yang akan digunakan untuk
                    pengobatan.
                    Saya memberi wewenang kepada Rumah Sakit ST. Elisabeth untuk memberikan informasi tentang
                    diagnosis,hasil pelayanan,dan pengobatan bila diperlukan untuk memproses klaim
                    asuransi/perusahaan/BPJS atau keluarga atas persetujuan saya.</p>
                <p>5. Saya memahami dan meyetujui Rumah Sakit ST. Elisabeth tidak bertanggung jawab terhadap
                    kehilangan,kerusakan atau pencurian barang berharga.</p>
                <p>6. Saya memahami, menyetujui, dan akan membayar seluruh biaya pengobatan rawat jalan. Saya memahami
                    dan menyetujui apabila ada biaya pemeriksaan/tindakan/perawatan yang tidak ditanggung atau hanya
                    ditanggung sebagian oleh penjamin, maka saya bersedia membayar seluruh atau selisih biaya yang
                    timbul.</p>
                    
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modalbatalappointment" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header" style="background-color: #F51300;color:#fff;">
                <h5 class="modal-title" id="staticBackdropLabel">Batal Periksa</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="mb-3">
                    <label for="exampleInputEmail1" class="form-label">Kode Booking</label>
                    <input type="text" class="form-control" id="kdbatal" name="kdbatal">
                </div>
                <div class="mb-3">
                    <label for="exampleInputEmail1" class="form-label">Nomor Rekam Medis</label>
                    <input type="text" class="form-control" id="rmbatal" name="rmbatal" placeholder="Format 00-00-00-00">
                </div>
                <div class="mb-3" id="alertcekbatal">
</div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-danger" id="btnProsesBatalApp">Batal Appointment</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="alertmessage" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-body" style="text-align: justify;text-justify: inter-word;" id="messagealert">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" id="btnPrint">Cetak</button>
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<center>
    <div class="mb-1">
        <span><b>Elisa Softworks © | 2022</b></span>
    </div>
</center>
<script>
    $(document).ready(function () {
    function formatDate() {
    // Get the input element
    var inputElement = document.getElementById("dobsearch");

    // Get the input value
    var inputValue = inputElement.value;

    // Remove non-numeric characters
    var numericValue = inputValue.replace(/\D/g, '');

    // Truncate to the first 8 characters
    numericValue = numericValue.substring(0, 8);

    // Format the date as dd-mm-yyyy
    var formattedDate = numericValue.replace(/(\d{2})(\d{2})(\d{4})/, '$1-$2-$3');

    // Update the input value with the formatted date
    inputElement.value = formattedDate;
    }
    $('#dobsearch').keyup(function () {
            formatDate();
        });
        // $('#imageModal').modal('show');
                    document.getElementById("fullweb").style.display = "block";
            document.getElementById("partialweb").style.display = "none"; 
                    $('#penjamin').selectpicker();
        $('#cari_nik').prop('disabled', true);
        $('#rm1').prop('disabled', true);
        $('#rm2').prop('disabled', true);
        $('#rm3').prop('disabled', true);
        $('#rm4').prop('disabled', true);
        var today = new Date();
        var hariini = today.getDate() + 7;
        today.setDate(today.getDate() + 7);
        var maxdd = '+6d';
        $(".datepicker").datepicker({
            format: "yyyy-mm-dd",
            autoclose: true,
            todayHighlight: true,
            endDate: today,
            startDate: new Date(),
        });
        var nik = document.getElementById('nik').value;
        load_nik(nik);
        cariprovinsi();
        document.getElementById("daftarbaru").style.display = "none";
        document.getElementById("BatalDaftar").style.display = "none";
        document.getElementById("regonline").style.display = "block";
        document.getElementById("frmcheckin").style.display = "none";
        $('.rminput').keyup(function () {
            var key = event.keyCode || event.charCode;
            if ($(this).val().length == $(this).attr("maxlength")) {
                var i = $('.rminput').index(this);
                $('.rminput').eq(i + 1).focus();
            }
            if (key == 8 || key == 46) {
                var indexNum = $('.rminput').index(this);
                if (indexNum != 0 && $(this).val().length < 1) {
                    $('.rminput').eq($('.rminput').index(this) - 1).val('').focus();
                }
            }
        });
        


            $('#wa_janji').on('keydown', function (event) {
                // Allow numeric input (0-9) and some special keys (e.g., backspace, arrow keys, delete)
                if (!(event.key === 'Backspace' || event.key === 'ArrowLeft' || event.key === 'ArrowRight' || event.key === 'Delete' || (event.key >= '0' && event.key <= '9'))) {
                    event.preventDefault();
                }
            });

            $('#wa_baru').on('keydown', function (event) {
                // Allow numeric input (0-9) and some special keys (e.g., backspace, arrow keys, delete)
                if (!(event.key === 'Backspace' || event.key === 'ArrowLeft' || event.key === 'ArrowRight' || event.key === 'Delete' || (event.key >= '0' && event.key <= '9'))) {
                    event.preventDefault();
                }
            });

        $('#nik').keyup(function () {
            var nik = document.getElementById('nik').value;
            if (nik != '') {
                load_nik(nik);
            } else {
                load_nik();
            }
        });

        function cariprovinsi() {
            $.ajax({
                url: "process/searchprovinsi.php",
                data: {
                    search: 1
                },
                success: function (data) {
                    $('#prov').html(data);
                }
            });
        }
        $('#prov').change(function () {
            $('#kota')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kota --</option>');
            $('#kecamatan')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kecamatan --</option>');
            $('#kelurahan')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kelurahan --</option>');
            var prov = document.getElementById('prov').value;
            $.ajax({
                url: "process/searchkota.php",
                method: "POST",
                data: {
                    prov: prov
                },
                success: function (data) {
                    $('#kota').html(data);
                }
            });
        });

        $('#kota').change(function () {
            $('#kecamatan')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kecamatan --</option>');
            $('#kelurahan')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kelurahan --</option>');
            var kota = document.getElementById('kota').value;
            $.ajax({
                url: "process/searchkecamatan.php",
                method: "POST",
                data: {
                    kota: kota
                },
                success: function (data) {
                    $('#kecamatan').html(data);
                    document.getElementById('kotahidden').value = $('#kota :selected')
                    .text();
                }
            });
        });

        $('#kecamatan').change(function () {
            $('#kelurahan')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Kelurahan --</option>');
            var kota = document.getElementById('kota').value;
            var kecamatan = document.getElementById('kecamatan').value;
            $.ajax({
                url: "process/searchkelurahan.php",
                method: "POST",
                data: {
                    kecamatan: kecamatan
                },
                success: function (data) {
                    $('#kelurahan').html(data);
                    document.getElementById('kecamatanhidden').value = $(
                        '#kecamatan :selected').text();
                }
            });
        });
        $('#kelurahan').change(function () {
        if($('#kelurahan :selected').value = 0){
            document.getElementById('kelurahanhidden').value = '';
        }else{
            document.getElementById('kelurahanhidden').value = $('#kelurahan :selected').text();
        }
            
        });


        $('#rm4').keyup(function () {
            var rm1 = document.getElementById('rm1').value;
            var rm2 = document.getElementById('rm2').value;
            var rm3 = document.getElementById('rm3').value;
            var rm4 = document.getElementById('rm4').value;
            var dob = document.getElementById('dobsearch').value;
            var search = ""
            if (rm4.length < 4) {
                search = rm1 + "-" + rm2 + "-" + rm3 + "-" + rm4;
            } else if (rm4.length = 4) {
                search = rm1 + "" + rm2 + "" + rm3 + "-" + rm4;
            }
            if (search != '') {
                loadrm(search,dob);
            }else{
                loadrm();
            }
        });

        $('#tglperiksa').change(function () {
            $('#dokter')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Dokter --</option>');
            $('#jadwal')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Jadwal --</option>');
            $('#poli')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Poli --</option>');
            $("#alertkuota").html("");
            var tgl = document.getElementById('tglperiksa').value;
            carijadwal(tgl);
        });

        $('#poli').change(function () {
            $('#dokter')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Dokter --</option>');
            $('#jadwal')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Jadwal --</option>');
            $("#alertkuota").html("");
            var tgl = document.getElementById('tglperiksa').value;
            var poli = document.getElementById('poli').value;
            var cb = document.getElementById('carabayar').value;
            if (poli == 'PL-16') {
                $("#messagealert").html(
                    "Bagi pasien yang hendak konsultasi ke klinik psikolog silahkan menghubungi Whatsapp Appointment Rumah Sakit St. Elisabeth <strong>082138927232</strong> untuk mendapatkan jadwal konsultasi.Terima Kasih"
                    );
                $("#alertmessage").modal('show');
            } else {
                $.ajax({
                    url: "process/searchdokter.php",
                    method: "POST",
                    data: {
                        tgl: tgl,
                        poli: poli,
                        cb:cb
                    },
                    success: function (data) {
                        $('#dokter').html(data);
                    }
                });
            }
        });

        $('#dokter').change(function () {
            $('#jadwal')
                .empty()
                .append('<option value= "0" selected="selected">-- Pilih Jadwal --</option>');
            $("#alertkuota").html("");
            var tgl = document.getElementById('tglperiksa').value;
            var poli = document.getElementById('poli').value;
            var dokter = document.getElementById('dokter').value;
            $.ajax({
                url: "process/searchjam.php",
                method: "POST",
                data: {
                    tgl: tgl,
                    poli: poli,
                    dokter: dokter
                },
                success: function (data) {
                    // $('#jadwal').html(data);
                }
            });
        });


        $('#penjamin').change(function () {
            var p = document.getElementById('penjamin').value;
            $.ajax({
                url: "process/getContractNo.php",
                method: "POST",
                data: {
                    penjamin: p
                },
                success: function (data) {
                    $('#contract').html(data);
                }
            });
        });
        var debounceTimeout;
        $(document).on("click", "#kirimjanji", function () {
            var me = $(this);
            if (me.data('requestRunning')) {
                return;
            }else{
                me.prop('disabled', true);
                me.data('requestRunning', true);
                if (debounceTimeout) {
            clearTimeout(debounceTimeout);
        }
        debounceTimeout = setTimeout(function () {
            document.getElementById("kirimjanji").style.display = "none";
            var ippasien = document.getElementById('ip_pasien').value;
            var poli = document.getElementById('poli').value;
            var npoli = $("#poli").find(':selected').attr('data-poli');
            var cb = document.getElementById('carabayar').value;
            var tgl = document.getElementById('tglperiksa').value;
            var dokter = document.getElementById('dokter').value;
            var sid = $("#dokter").find(':selected').attr('data-id');
            var otc = $("#dokter").find(':selected').attr('data-otc');
            var nd = $("#dokter").find(':selected').attr('data-doctor');
            var jp = $("#dokter").find(':selected').attr('data-jp');
            var sesi = $("#dokter").find(':selected').attr('data-sesi');
            var rm = document.getElementById('rm_pasien').value;
            var wajanji = document.getElementById('wa_janji').value;
            var nama_pasien = document.getElementById('nama_pasien').value;
            $.ajax({
                data: {
                    sesi: sesi,
                    poli: poli,
                    sid: sid,
                    otc: otc,
                    rm: rm,
                    tglperiksa: tgl,
                    carabayar: cb,
                    dokter: dokter,
                    namadokter: nd,
                    jp: jp,
                    namapoli: npoli,
                    nd: nd,
                    wa: wajanji,
                    nama: nama_pasien,
                    ip: ippasien
                },
                type: 'post',
                url: 'process/appointment.php',
                success: function (data) {
                    $("#regonline")[0].reset();
                    $("#messagealert").html(data);
                    document.getElementById("btnPrint").style.display = "block";
                    $("#alertmessage").modal('show');
                    $('#dokter')
                        .empty()
                        .append(
                            '<option value= "0" selected="selected">-- Pilih Dokter --</option>'
                            );
                    $('#poli')
                        .empty()
                        .append(
                            '<option value= "0" selected="selected">-- Pilih Poli --</option>'
                            );
                    $('#alertrm').html('');
                },
                complete: function () {
                    me.prop('disabled', false);
                    setTimeout(function () {
                        me.data('requestRunning', false);
                    document.getElementById("kirimjanji").style.display =
                            "block";
                    }, 1500);
                    
                }
            });
        }, 1000);
            return false;
            }
            
        });

        $(document).on("click", "#kirimpendaftaran", function () {
            if (document.getElementById('checkpersetujuan').checked) {
                var form = $('#daftarbaru')[0];
                var formData = new FormData(form);
                $.ajax({
                    data: formData,
                    type: 'post',
                    url: 'process/daftar.php',
                    processData: false,
                    contentType: false,
                    success: function (data) {
                        if (data == "Success") {
                            $("#messagealert").html(
                                "Pendaftaran Berhasil, Mohon tunggu maksimal 30 menit, operator kami akan segera menghubungi anda. Terima Kasih"
                                );
                            $("#alertmessage").modal('show');
                            $("#daftarbaru")[0].reset();
                            $('#kota')
                                .empty()
                                .append(
                                    '<option value= "0" selected="selected">-- Pilih Kota/Kabupaten --</option>'
                                    );
                            $('#kecamatan')
                                .empty()
                                .append(
                                    '<option value= "0" selected="selected">-- Pilih Kecamatan --</option>'
                                    );
                            $('#kelurahan')
                                .empty()
                                .append(
                                    '<option value= "0" selected="selected">-- Pilih Kelurahan --</option>'
                                    );
                        } else if (data == "Error Image") {
                            $("#messagealert").html("Cek kembali Foto dan KTP anda");
                            $("#alertmessage").modal('show');
                        } else if (data == "Error") {
                            $("#messagealert").html(
                                "Mohon cek kembali data yang anda kirim.");
                            $("#alertmessage").modal('show');
                        }
                    }
                });
                return false;
            } else {
                $("#messagealert").html(
                    "Mohon lakukan persetujuan atas peraturan dan persetujuan kami, sebelum melakukan pendaftaran"
                    );
                $("#alertmessage").modal('show');
            }
        });

        $(document).on("click", "#kirimcekantrian", function () {
            $.ajax({
                data: $('#frmcheckin').serialize(),
                type: 'post',
                url: 'process/checkin.php',
                success: function (data) {
                    $("#messagealert").html(data);
                    $("#alertmessage").modal('show');
                    $("#frmcheckin")[0].reset();

                }
            });
            return false;
        });


        function carijadwal(query) {
            $.ajax({
                url: "process/searchpoli.php",
                method: "POST",
                data: {
                    tgl: query
                },
                success: function (data) {
                    $('#poli').html(data);
                }
            });
        }

        function load_nik(query) {
            $.ajax({
                url: "process/searchnik.php",
                method: "POST",
                data: {
                    nik: query
                },
                success: function (data) {
                    $('#ceknikalert').html(data);
                }
            });
        }

        function loadrm(query,dob) {
            $.ajax({
                url: "process/searchrmnew.php",
                method: "POST",
                data: {
                    rm: query,
                    dob:dob
                },
                success: function (data) {
                    $('#alertrm').html(data);
                }
            });
        }

        function readktp(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function (e) {
                    var htmlPreview =
                        '<img width="200" src="' +
                        e.target.result +
                        '" />' +
                        "<p>" +
                        input.files[0].name +
                        "</p>";
                    var wrapperZone = $(input).parent();
                    var previewZone = $(input)
                        .parent()
                        .parent()
                        .find(".view-ktp");
                    var boxZone = $(input)
                        .parent()
                        .parent()
                        .find(".view-ktp")
                        .find(".box")
                        .find(".box-body");

                    wrapperZone.removeClass("dragover");
                    previewZone.removeClass("hidden");
                    boxZone.empty();
                    boxZone.append(htmlPreview);
                };

                reader.readAsDataURL(input.files[0]);
            }
        }

        function readfoto(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function (e) {
                    var htmlPreview =
                        '<img width="200" src="' +
                        e.target.result +
                        '" />' +
                        "<p>" +
                        input.files[0].name +
                        "</p>";
                    var wrapperZone = $(input).parent();
                    var previewZone = $(input)
                        .parent()
                        .parent()
                        .find(".view-foto");
                    var boxZone = $(input)
                        .parent()
                        .parent()
                        .find(".view-foto")
                        .find(".box")
                        .find(".box-body");

                    wrapperZone.removeClass("dragover");
                    previewZone.removeClass("hidden");
                    boxZone.empty();
                    boxZone.append(htmlPreview);
                };
                reader.readAsDataURL(input.files[0]);
            }
        }
        $("#ktp").change(function () {
            readktp(this);
        });
        $("#foto").change(function () {
            readfoto(this);
        });
        $(".dropzone-wrapper").on("dragover", function (e) {
            e.preventDefault();
            e.stopPropagation();
            $(this).addClass("dragover");
        });

        $(".dropzone-wrapper").on("dragleave", function (e) {
            e.preventDefault();
            e.stopPropagation();
            $(this).removeClass("dragover");
        });

        $(document).on("click", "#linkDaftarBaru", function () {
            document.getElementById("daftarbaru").style.display = "block";
            document.getElementById("BatalDaftar").style.display = "block";
            document.getElementById("regonline").style.display = "none";
            document.getElementById("notifikasiBar").style.display = "none";
        });

        $(document).on("click", "#linkBatalDaftar", function () {
            document.getElementById("daftarbaru").style.display = "none";
            document.getElementById("BatalDaftar").style.display = "none";
            document.getElementById("regonline").style.display = "block";
            document.getElementById("notifikasiBar").style.display = "block";
        });

        $('input[type=radio][name=rdo]').change(function () {
            if ($(this).val() === '1') {
                document.getElementById("daftarbaru").style.display = "block";
                document.getElementById("regonline").style.display = "none";
                document.getElementById("frmcheckin").style.display = "none";
            } else if ($(this).val() === '2') {
                document.getElementById("daftarbaru").style.display = "none";
                document.getElementById("regonline").style.display = "block";
                document.getElementById("frmcheckin").style.display = "none";

            } else if ($(this).val() === '3') {
                document.getElementById("daftarbaru").style.display = "none";
                document.getElementById("regonline").style.display = "none";
                document.getElementById("frmcheckin").style.display = "block";
            }
        });

        $('#cari_nik').keyup(function () {
            var nik = document.getElementById('cari_nik').value;
            var dob = document.getElementById('dobsearch').value;
            if (nik != '') {
                load_rm_by_nik(nik,dob);
        $('#rm1').prop('disabled', true);
        $('#rm2').prop('disabled', true);
        $('#rm3').prop('disabled', true);
        $('#rm4').prop('disabled', true);
            }else{
                $('#rm1').prop('disabled', false);
        $('#rm2').prop('disabled', false);
        $('#rm3').prop('disabled', false);
        $('#rm4').prop('disabled', false);
            }
        });

        $('#dobsearch').keyup(function () {
            var dobValue = $(this).val();
    var dobRegex = /^\d{1,2}-\d{1,2}-\d{4}$/;
    if (dobRegex.test(dobValue)) {
        $('#cari_nik').prop('disabled', false);
        $('#rm1').prop('disabled', false);
        $('#rm2').prop('disabled', false);
        $('#rm3').prop('disabled', false);
        $('#rm4').prop('disabled', false);
    } else {
        $('#cari_nik').prop('disabled', true);
        $('#rm1').prop('disabled', true);
        $('#rm2').prop('disabled', true);
        $('#rm3').prop('disabled', true);
        $('#rm4').prop('disabled', true);
    }
        });

        function load_rm_by_nik(query,dob) {
            
            $.ajax({
                url: "process/searchrmbyniknew.php",
                method: "POST",
                data: {
                    nik: query,
                    dob:dob
                },
                success: function (data) {
                    $('#alertrm').html(data);
                }
            });
        }

        $(document).on("click", "#btnPrint", function () {
            printElement(document.getElementById("messagealert"));
        });

        function printElement(elem) {
            var domClone = elem.cloneNode(true);

            var $printSection = document.getElementById("printSection");

            if (!$printSection) {
                var $printSection = document.createElement("div");
                $printSection.id = "printSection";
                document.body.appendChild($printSection);
            }

            $printSection.innerHTML = "";
            $printSection.appendChild(domClone);
            window.print();
        }

        $(document).on("click", "#btnBatalAppointment", function () {
                    $("#modalbatalappointment").modal('show');
        });

        $(document).on("click", "#btnProsesBatalApp", function() {
        var id = document.getElementById('kdbatal').value;
        var rm = document.getElementById('rmbatal').value;
        if (confirm("Batalkan Pendaftaran " + id +"?") == true) {
            $.ajax({
                url: "process/batalperiksa.php",
                method: "POST",
                data: {
                    id: id,
                    rm:rm
                },
                success: function(data) {
                    $("#messagealert").html(data);
                        $("#alertmessage").modal('show');
                        document.getElementById('kdbatal').value = "";
                        document.getElementById('rmbatal').value="";
                }
            });
        }
        });


    });
</script>
</body></html>