Commit 05cf2def authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

baru dra v1.6

parent da8aceac
...@@ -103,6 +103,22 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -103,6 +103,22 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; return $view;
} }
public function registrasialldokAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-registrasialldok.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianterlewatAction() public function antrianterlewatAction()
......
...@@ -58,7 +58,7 @@ class UmumController extends \Application\Master\GlobalActionController ...@@ -58,7 +58,7 @@ class UmumController extends \Application\Master\GlobalActionController
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id_poli = "' . $decodeid . '"'); $this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js'); $this->headScript->appendFile('/action-js/tampilanantiran-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum"); $this->layout("layout/layoutUmum");
return $view; return $view;
......
...@@ -102,10 +102,15 @@ class Param extends Mapper { ...@@ -102,10 +102,15 @@ class Param extends Mapper {
return $data; return $data;
} }
public function loadRegister($id = null){ public function loadantrianregister($id = null){
$data = $this->_storage->loadRegisterAntrianData($id); $data = $this->_storage->loadantrianregister($id);
return $data; return $data;
} }
public function loadantrianregisterall($id = null){
$data = $this->_storage->loadantrianregisterall($id);
return $data;
}
public function loadkelolapoli($id = null){ public function loadkelolapoli($id = null){
$data = $this->_storage->loadkelolapoli($id); $data = $this->_storage->loadkelolapoli($id);
return $data; return $data;
...@@ -138,8 +143,12 @@ class Param extends Mapper { ...@@ -138,8 +143,12 @@ class Param extends Mapper {
$data = $this->_storage->loadantrianunregis($id); $data = $this->_storage->loadantrianunregis($id);
return $data; return $data;
} }
public function loadPilihAntrian($iddok = null){ public function loadPilihAntrian($iddok = null , $id_poli= null ){
$data = $this->_storage->loadPilihAntrian($iddok); $data = $this->_storage->loadPilihAntrian($iddok, $id_poli);
return $data;
}
public function valpilihAntrian($id_pasien = null ){
$data = $this->_storage->valpilihAntrian($id_pasien);
return $data; return $data;
} }
public function loadDokter($id = null){ public function loadDokter($id = null){
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
<div><span style="visibility:hidden" id="nama_ruang"></span></div> <div><span style="visibility:hidden" id="nama_ruang"></span></div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="col-lg-6 "> <div class="col-lg-7 ">
<div class="card 0-hidden border-0 shadow-lg my-3"> <div class="card 0-hidden border-0 shadow-lg my-3">
<div class="card-header"> <div class="card-header">
<h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6>
</div> </div>
<div class="text-center content-group"> <div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div> <div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<h1 class="error-title" style=" font-weight: bold;font-size:250px;font-family: Times New Roman, Times, serif;color: #808080"><span id="no_antrian"></span></h1> <h1 class="error-title" style="padding-top: 48px; padding-bottom:47px; font-weight: bold;font-size:170px;font-family: Times New Roman, Times, serif;color: #808080"><span id="no_antrian"></span></h1>
</div> </div>
<div><input type="hidden" value="no_antrian" id="no_antrian" /></div> <div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<div class="col-lg-6 "> <div class="col-lg-5 ">
<div class="card 1-hidden border-1 shadow-lg my-3"> <div class="card 1-hidden border-1 shadow-lg my-3">
<div class="card-header"> <div class="card-header">
<h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<div class="card-header"> <div class="card-header">
<h1 class="panel-title " style="font-family: Times New Roman, Times, serif;text-align:center">Daftar Antrian Hari ini<a class="heading-elements-toggle"></a></h1> <h1 class="panel-title " style="font-family: Times New Roman, Times, serif;text-align:center">Daftar Antrian Hari ini<a class="heading-elements-toggle"></a></h1>
</div> </div>
<table class="table table-bordered"> <table class="table table-bordered" >
<thead class="bgHeader" style="border-top: 2px solid #ccc;"> <thead class="bgHeader" style="border-top: 2px solid #ccc;">
<tr> <tr>
<th style="width: 70px">NO</th> <th style="width: 70px">NO</th>
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
<th colspan="" class=" thLeftText">Nama Poli</th> <th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Kode Dokter</th> <th colspan="" class=" thLeftText">Kode Dokter</th>
<th colspan="" class=" thLeftText">Kondisi Dokter</th>
<th colspan="" class=" thLeftText">Gambar Dokter</th> <th colspan="" class=" thLeftText">Gambar Dokter</th>
<th colspan="" class=" thLeftText">Kondisi Dokter</th>
<th colspan="" class=" thLeftText">Action</th> <th colspan="" class=" thLeftText">Action</th>
</tr> </tr>
</thead> </thead>
...@@ -111,12 +111,7 @@ ...@@ -111,12 +111,7 @@
<label>Kode Dokter</label> <label>Kode Dokter</label>
<input type="input" id="kode_dokteredt" name="kode_dokter" class="form-control" required /></input> <input type="input" id="kode_dokteredt" name="kode_dokter" class="form-control" required /></input>
</div> </div>
<div class="form-group">
<label>Kondisi</label>
<select name="condition" id="condition" class="form-control" >
</select>
</div>
<div class="form-group " > <div class="form-group " >
<label>Gambar Dokter</label> <label>Gambar Dokter</label>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Edit Data Dokter</h4> <h4 class="modal-title">Edit Data Pasien</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
......
...@@ -109,12 +109,7 @@ ...@@ -109,12 +109,7 @@
<label>Ruangan</label> <label>Ruangan</label>
<input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input> <input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
</div> </div>
<div class="form-group">
<label>Kondisi</label>
<select name="condition" id="condition" class="form-control" >
</select>
</div>
<div class="modal-footer"> <div class="modal-footer">
<button button type="button" class="btn btn-primary" id="edit">Edit</button> <button button type="button" class="btn btn-primary" id="edit">Edit</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button> <button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
......
...@@ -4,24 +4,23 @@ ...@@ -4,24 +4,23 @@
<div class="col-xl-12 col-lg-12 col-md-12"> <div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5"> <div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body "> <div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Register Dokter</h1> <h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Jadwal Dokter</h1>
<button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button> <button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button>
<a type="button" class="btn btn-dark fa btn-lg" href="<?php echo $this->basePath('admin/registrasialldok') ?>"> Lihat Seluruh Antrian</a>
<br> <br>
<br> <br>
<table class="table table-bordered" id="dataTable"> <table class="table table-bordered" id="dataTable">
<thead> <thead>
<tr class="table-infos"> <tr class="table-infos">
<th style="">NO</th> <th style="">NO</th>
<th colspan="" class=" thLeftText">Nama Poli</th> <th >Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th >Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruangan</th> <th>Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th> <th >Antrian Seluruh</th>
<th colspan="" class=" thLeftText">Antrian Awal (mobile)</th> <th>Jam Mulai</th>
<th colspan="" class=" thLeftText">Antrian Akhir (mobile)</th> <th >Waktu Antrian</th>
<th colspan="" class=" thLeftText">Jam Mulai</th> <th >Tanggal Antrian</th>
<th colspan="" class=" thLeftText">Waktu Antrian</th> <th >Action</th>
<th colspan="" class=" thLeftText">Tanggal Antrian</th>
<th colspan="" class=" thLeftText">Action</th>
</tr> </tr>
</thead> </thead>
<tbody id="tableregisterdokter" > <tbody id="tableregisterdokter" >
...@@ -42,7 +41,7 @@ ...@@ -42,7 +41,7 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Tambah Data Register Dokter</h4> <h4 class="modal-title">Tambah Jadwal Dokter</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
...@@ -75,19 +74,6 @@ ...@@ -75,19 +74,6 @@
<input type="number" id="antrian_all" name="antrian_all" class="form-control" required /></input> <input type="number" id="antrian_all" name="antrian_all" class="form-control" required /></input>
</div> </div>
<div class="row col-lg-12">
<div class="form-group">
<label>Antrian Awal(mobile)</label>
<input style="width: 221px;" type="number" id="antrian_awal" name="antrian_awal" class="form-control" required /></input>
</div>
<div class="col-lg-6 sm-7">
<div class="form-group">
<label>Antrian Akhir(mobile)</label>
<input style="width: 230px;" type="number" id="antrian_akhir" name="antrian_akhir" class="form-control" required /></input>
</div>
</div>
</div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="form-group"> <div class="form-group">
<label>Waktu Mulai Antrian</label> <label>Waktu Mulai Antrian</label>
...@@ -125,13 +111,13 @@ ...@@ -125,13 +111,13 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Edit Data Register Dokter</h4> <h4 class="modal-title">Edit Jadwal Dokter</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form id="myForm" > <form id="myForm" >
<input type="input" id="id_register" class="form-control" /></input> <input type="hidden" id="id_register" class="form-control" /></input>
<div class="form-group"> <div class="form-group">
<label>Nama Poli</label> <label>Nama Poli</label>
...@@ -162,19 +148,7 @@ ...@@ -162,19 +148,7 @@
<input type="number" id="antrian_alledt" name="antrian_all" class="form-control" required /></input> <input type="number" id="antrian_alledt" name="antrian_all" class="form-control" required /></input>
</div> </div>
<div class="row col-lg-12">
<div class="form-group">
<label>Antrian Awal(mobile)</label>
<input style="width: 221px;" type="number" id="antrian_awaledt" name="antrian_awal" class="form-control" required /></input>
</div>
<div class="col-lg-6 sm-7">
<div class="form-group">
<label>Antrian Akhir(mobile)</label>
<input style="width: 230px;" type="number" id="antrian_akhiredt" name="antrian_akhir" class="form-control" required /></input>
</div>
</div>
</div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="form-group"> <div class="form-group">
<label>Waktu Mulai Antrian</label> <label>Waktu Mulai Antrian</label>
......
...@@ -40,15 +40,12 @@ input::-webkit-inner-spin-button { ...@@ -40,15 +40,12 @@ input::-webkit-inner-spin-button {
<form id="myForm"> <form id="myForm">
<input type="hidden" id="iInput" class="form-control" /></input> <input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group"> <div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br> <label> <h5>No Rekam Medis</h5></label><br>
<input type="text" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" ></input> <input type="text" id="no_rekam_medis" class="form-control" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8"></input>
</div> </div>
<!-- <div class="form-group">
<label> <h5>No Induk Kependudukan (NIK)</h5></label><br>
<input type="number" id="ktp" placeholder="No Induk Kependudukan (NIK)" class="form-control"max="9999999999999999" maxlength="16" ></input>
</div> -->
<p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p> <p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p>
<a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a> <a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a>
</form> </form>
......
...@@ -223,16 +223,21 @@ input[type="done"] + label { ...@@ -223,16 +223,21 @@ input[type="done"] + label {
<!-- Modal --> <!-- Modal -->
<div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl"> <div class="modal-dialog modal-xl">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="-close" data-dismiss="modal">&times;</button> <button type="button" class="-close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Daftar Antrian</h4> <h4 class="modal-title">Daftar Antrian</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row col-lg-12 antrian" id="seat"> <div class="row col-lg-12 antrian" id="seat">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="container" > <div class="container" >
...@@ -288,4 +293,5 @@ input[type="done"] + label { ...@@ -288,4 +293,5 @@ input[type="done"] + label {
</div> </div>
</div> </div>
</div> </div>
</div>
...@@ -99,16 +99,16 @@ ...@@ -99,16 +99,16 @@
<span href="">Antrian</span> <span href="">Antrian</span>
</a> </a>
</li> </li>
<li class="nav-item"> <!-- <li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/tampilanumum') ?>"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/tampilanumum') ?>">
<i class="fas fa-fw fa-folder"></i> <i class="fas fa-fw fa-folder"></i>
<span href="">Tampilan Umum</span> <span href="">Tampilan Umum</span>
</a> </a>
</li> </li> -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/registrasidokter') ?>"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/registrasidokter') ?>">
<i class="fas fa-fw fa-cog"></i> <i class="fas fa-fw fa-cog"></i>
<span href="">Registrasi Dokter</span> <span href="">Kelola Jadwal Dokter</span>
</a> </a>
</li> </li>
......
...@@ -20,11 +20,13 @@ ...@@ -20,11 +20,13 @@
->prependStylesheet($this->basePath('/tamplate/css/flaticon.css')) ->prependStylesheet($this->basePath('/tamplate/css/flaticon.css'))
->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css')) ->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css'))
->prependStylesheet($this->basePath('/tamplateadmin/css/swich-alert.css')) ->prependStylesheet($this->basePath('/tamplateadmin/css/swich-alert.css'))
->prependStylesheet($this->basePath('/tamplateadmin/assets/css/icons/icomoon/styles.css'))
->prependStylesheet($this->basePath('/tamplate/css/nice-select.css')) ->prependStylesheet($this->basePath('/tamplate/css/nice-select.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/demo.css')) ->prependStylesheet($this->basePath('/tamplate/css/demo.css'))
->prependStylesheet($this->basePath('/tamplate/css/intlTelInput.css')) ->prependStylesheet($this->basePath('/tamplate/css/intlTelInput.css'))
?> ?>
</head> </head>
......
...@@ -64,33 +64,20 @@ $('#poli').on('change', function () { ...@@ -64,33 +64,20 @@ $('#poli').on('change', function () {
$("select#dokter").removeAttr('disabled'); $("select#dokter").removeAttr('disabled');
$("select#dokter").html(optionseg); $("select#dokter").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Dokter Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
}); });
$( '#dokter' ).on( "change", function() { $('#dokter').on("change", function () {
$id_dokter =$('#dokter').val(); $id_dokter = $('#dokter').val();
window.location.href = ("/admin/antrianadmin/" +$id_dokter); window.location.href = ("/admin/antrianadmin/" + $id_dokter);
}); });
if(window.location.pathname == "/admin/antrianadmin/" +id){ if (window.location.pathname == "/admin/antrianadmin/" + id) {
$( window ).on( "load", function() { $(window).on("load", function () {
tampilangka(id) tampilangka(id)
loadantrian(id) loadantrian(id)
}); });
...@@ -114,20 +101,7 @@ function loadpoli() { ...@@ -114,20 +101,7 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -135,7 +109,7 @@ function loadpoli() { ...@@ -135,7 +109,7 @@ function loadpoli() {
function loadantrian(id) { function loadantrian(id) {
$iddok= $('#dokter').val(); $iddok = $('#dokter').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -146,7 +120,7 @@ function loadantrian(id) { ...@@ -146,7 +120,7 @@ function loadantrian(id) {
}, },
success: function (result) { success: function (result) {
// console.log(result.data); console.log(result.data);
$('table.table-bordered > tbody').empty(); $('table.table-bordered > tbody').empty();
// console.log(result); // console.log(result);
...@@ -154,7 +128,7 @@ function loadantrian(id) { ...@@ -154,7 +128,7 @@ function loadantrian(id) {
if (result.code == 0) { if (result.code == 0) {
let data = result.data; let data = result.data;
console.log(data); // console.log(data);
let counter = 1; let counter = 1;
for (x in data) { for (x in data) {
...@@ -172,9 +146,10 @@ function loadantrian(id) { ...@@ -172,9 +146,10 @@ function loadantrian(id) {
$("#antrianadmin").append(newRow); $("#antrianadmin").append(newRow);
counter++; counter++;
// $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>'); // $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>');
} }
// console.log(data);
} else { } else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true }); bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
} }
...@@ -271,25 +246,25 @@ function tampilangka(id) { ...@@ -271,25 +246,25 @@ function tampilangka(id) {
$('#btnNext').on('click', function () { $('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20,id); actionqueue(noantrian + 1, 20, id);
loadantrian() loadantrian(id)
}); });
$('#btnCall').on('click', function () { $('#btnCall').on('click', function () {
actionqueue(noantrian, 30,id); actionqueue(noantrian, 30, id);
}); });
$('#btnDone').on('click', function () { $('#btnDone').on('click', function () {
actionqueue(noantrian, 50,id); actionqueue(noantrian, 50, id);
}); });
$('#btnMissed').on('click', function () { $('#btnMissed').on('click', function () {
actionqueue(noantrian, 60,id); actionqueue(noantrian, 60, id);
}); });
$('#btnServed').on('click', function () { $('#btnServed').on('click', function () {
actionqueue(noantrian, 40,id); actionqueue(noantrian, 40, id);
...@@ -346,14 +321,16 @@ function actionqueue(antrianno, status, iddok) { ...@@ -346,14 +321,16 @@ function actionqueue(antrianno, status, iddok) {
var flush = new Audio('../../data/tone/a1.mp3'); var flush = new Audio('../../data/tone/a1.mp3');
setTimeout(function() { setTimeout(function () {
flush.play(); }, ) flush.play();
})
flush.onended = function() { flush.onended = function () {
textToAudio() textToAudio()
setTimeout(function() { setTimeout(function () {
textToAudioRuang() }, 3000) textToAudioRuang()
}, 3000)
}; };
swal({ swal({
......
...@@ -38,53 +38,14 @@ function cekpasien(no_rekam_medis) { ...@@ -38,53 +38,14 @@ function cekpasien(no_rekam_medis) {
console.log(result); console.log(result);
if (result.code != 0) { if (result.code != 0) {
bootbox.alert({ message: "No rekam medis atau NIK tidak sesuai!", centerVertical: true }); bootbox.alert({ message: "No rekam medis tidak sesuai!", centerVertical: true });
} }
else if (result.code == 0) { else if (result.code == 0) {
console.log(result.data['datapasien'][0]['no_rekam_medis']); console.log(result.data['datapasien'][0]['no_rekam_medis']);
// alert('berhasil');
if (result.data['datapasien'][0]['no_rekam_medis'] == null) {
let $id = result.data['datapasien'][0]['id_pasien']; let $id = result.data['datapasien'][0]['id_pasien'];
let $encodedId = btoa($id); let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId); window.location.href = ("datapasien/" + $encodedId);
}
if (result.data['datapasien'][0]['no_rekam_medis'] != null && (result.data['datapasien'][0]['status_code'] == 10)) {
let $idantrian = result.data['datapasien'][0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let no_rekam_medis = result.data['datapasien'][0]['no_rekam_medis'];
let nama = result.data['datapasien'][0]['nama'];
swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else if (result.data['datapasien'][0]['status_code'] == 20) {
bootbox.alert({ message: "Pasien Sedang Dalam Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 30) {
bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 40) {
bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 50) {
bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 60) {
bootbox.alert({ message: "Pasien Sedang Telah Terlewat Silahkan Hubungi Petugas", centerVertical: true });
}
// } else if (result.data['validasiinput'] == 1) {
// bootbox.alert({ message: "No Induk Kependudukan tidak sesuai", centerVertical: true });
} else {
// bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
} }
}, },
...@@ -132,49 +93,4 @@ function validasidokter(no_rekam_medis, ktp) { ...@@ -132,49 +93,4 @@ function validasidokter(no_rekam_medis, ktp) {
} }
var inputQuantity = [];
$(function () {
$("#ktp").each(function (i) {
inputQuantity[i] = this.defaultValue;
$(this).data("idx", i); // save this field's index to access later
});
$("#ktp").on("keyup", function (e) {
var $field = $(this),
val = this.value,
$thisIndex = parseInt($field.data("idx"), 10); // retrieve the index
// window.console && console.log($field.is(":invalid"));
// $field.is(":invalid") is for Safari, it must be the last to not error in IE8
if (this.validity && this.validity.badInput || isNaN(val) || $field.is(":invalid")) {
this.value = inputQuantity[$thisIndex];
return;
}
if (val.length > Number($field.attr("maxlength"))) {
val = val.slice(0, 16);
$field.val(val);
}
inputQuantity[$thisIndex] = val;
});
})
var inputQuantity = [];
$(function () {
$("#no_rekam_medis").each(function (i) {
inputQuantity[i] = this.defaultValue;
$(this).data("idx", i); // save this field's index to access later
});
$("#no_rekam_medis").on("keyup", function (e) {
var $field = $(this),
val = this.value,
$thisIndex = parseInt($field.data("idx"), 10); // retrieve the index
// window.console && console.log($field.is(":invalid"));
// $field.is(":invalid") is for Safari, it must be the last to not error in IE8
if (this.validity && this.validity.badInput || isNaN(val) || $field.is(":invalid")) {
this.value = inputQuantity[$thisIndex];
return;
}
if (val.length > Number($field.attr("maxlength"))) {
val = val.slice(0, 8);
$field.val(val);
}
inputQuantity[$thisIndex] = val;
});
})
...@@ -45,8 +45,8 @@ function loadsisaantrian() { ...@@ -45,8 +45,8 @@ function loadsisaantrian() {
let no_antrian = $("input[name=antrian]:checked").val(); let no_antrian = $("input[name=antrian]:checked").val();
var sisa_antrian; var sisa_antrian;
console.log(dokter); // console.log(dokter);
console.log(no_antrian); // console.log(no_antrian);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -65,7 +65,7 @@ function loadsisaantrian() { ...@@ -65,7 +65,7 @@ function loadsisaantrian() {
let data = result.data; let data = result.data;
console.log(data[0].count); // console.log(data[0].count);
sisa_antrian = data[0].count; sisa_antrian = data[0].count;
// $('#sisa_antrian').val(data[0].count); // $('#sisa_antrian').val(data[0].count);
...@@ -121,7 +121,7 @@ function savedataaja() { ...@@ -121,7 +121,7 @@ function savedataaja() {
ipoli: poli, ipoli: poli,
idokter: dokter, idokter: dokter,
ino_antrian: no_antrian, ino_antrian: no_antrian,
isisa_antrian :sisa_antrian, isisa_antrian: sisa_antrian,
}, },
success: function (response) { success: function (response) {
...@@ -155,7 +155,7 @@ function savedataaja() { ...@@ -155,7 +155,7 @@ function savedataaja() {
loadpoli(); loadpoli();
$('#poli').on('change', function () { $('#poli').on('change', function () {
var idpoli = $('#poli').val(); var idpoli = $('#poli').val();
console.log(idpoli); // console.log(idpoli);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -176,20 +176,7 @@ $('#poli').on('change', function () { ...@@ -176,20 +176,7 @@ $('#poli').on('change', function () {
$("select#dokter").removeAttr('disabled'); $("select#dokter").removeAttr('disabled');
$("select#dokter").html(optionseg); $("select#dokter").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -214,46 +201,100 @@ function loadpoli() { ...@@ -214,46 +201,100 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
} }
} }
}); });
}
// validasipasien()
function validasipasien(id_poli, dokter, id_pasien) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/valpilihAntrian',
async: false,
data: {
id_pasien: id_pasien
},
success: function (result) {
console.log(dokter)
var data = result.data;
for (x in data) {
if (id_pasien == data[x]['id_pasien']) {
if (id_poli == data[x]['id_poli']) {
if (dokter == data[x]['id_dokter']) {
exist = 1;
}
} }
} }
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
}); });
return exist;
} }
$('#pilihno').on('click', function () { $('#pilihno').on('click', function (e) {
pilihAntrian() e.preventDefault();
var id_pasien = $('#id_pasien').val();
var id_poli = $('#poli option:selected').attr("value");
var dokter = $('#dokter option:selected').attr("value");
pilihAntrian(id_poli)
// console.log(id_poli)
}); });
function pilihAntrian() {
var $dokter = $('#dokter option:selected').attr("value"); function pilihAntrian(id_poli) {
var dokter = $('#dokter option:selected').attr("value");
var id_pasien = $('#id_pasien').val();
// console.log(id_pasien);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadPilihAntrian', url: baseURL + '/api/loadPilihAntrian',
data: { data: {
iddok: $dokter, iddok: dokter,
id_poli: id_poli,
}, },
success: function (response) { success: function (response) {
// console.log(response.data);
var $antrian = (response.data); var $antrian = (response.data);
// console.log($antrian); // console.log(validasipasien(id_poli, dokter, id_pasien) == 1);
// console.log(response);
if (validasipasien(id_poli, dokter, id_pasien) == 1) {
let $idantrian = response.data[0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let nama = response.data[0]['nama'];
swal({
title: "Pasien dengan nama'" + nama + "' telah melakukan pendaftaran di poli dan dokter ini! \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else {
if ($antrian) { if ($antrian) {
var hour = 0; var hour = 0;
...@@ -269,8 +310,9 @@ function pilihAntrian() { ...@@ -269,8 +310,9 @@ function pilihAntrian() {
$('.antrian').empty(); $('.antrian').empty();
for (var i = 0; i < $antrian.length; i++) { for (var i = 0; i < $antrian.length; i++) {
var A = Date.now();
if ($antrian[i]['id_pasien'] === null) {//jika masih kosong if ($antrian[i]['id_pasien'] === null) {//jika masih kosong
let y = ''; let y = ' ';
var splittime = []; var splittime = [];
...@@ -282,8 +324,8 @@ function pilihAntrian() { ...@@ -282,8 +324,8 @@ function pilihAntrian() {
hour += Math.floor(minute / 60); hour += Math.floor(minute / 60);
minute = minute % 60; minute = minute % 60;
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
...@@ -325,8 +367,8 @@ function pilihAntrian() { ...@@ -325,8 +367,8 @@ function pilihAntrian() {
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
...@@ -376,8 +418,8 @@ function pilihAntrian() { ...@@ -376,8 +418,8 @@ function pilihAntrian() {
minute = minute % 60; minute = minute % 60;
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
let y = ''; let y = '';
...@@ -398,6 +440,11 @@ function pilihAntrian() { ...@@ -398,6 +440,11 @@ function pilihAntrian() {
} else { } else {
} }
}
}, },
error: function (xhr) { error: function (xhr) {
......
...@@ -36,7 +36,7 @@ function Loadunregister() { ...@@ -36,7 +36,7 @@ function Loadunregister() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-danger btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>';
// console.log(data[x].id_pasien); // console.log(data[x].id_pasien);
newRow.append(cols); newRow.append(cols);
...@@ -89,7 +89,7 @@ function unregister(id_pasien) { ...@@ -89,7 +89,7 @@ function unregister(id_pasien) {
if (result.code == 0) { if (result.code == 0) {
swal({ swal({
title: "", title: "",
text: "Data Berhasil Diupdate!", text: "Data Berhasil Direset!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}, function () { }, function () {
...@@ -99,7 +99,7 @@ function unregister(id_pasien) { ...@@ -99,7 +99,7 @@ function unregister(id_pasien) {
} else { } else {
swal({ swal({
title: "", title: "",
text: "Data Gagal Diupdate!", text: "Data Gagal Direset!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}); });
......
...@@ -24,20 +24,7 @@ function loadpoli() { ...@@ -24,20 +24,7 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -75,9 +62,10 @@ function Loaddokter() { ...@@ -75,9 +62,10 @@ function Loaddokter() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].kode_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].kode_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_dokter + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_dokter + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_dokter + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_dokter + ')">Hapus</span> <span style="padding: 7px;margin-top:10px; font-size: 14px;"class="btn btn-info btn-xs" onclick="Update(' + data[x].id_dokter + "," + data[x].id_condition + ')">Update Kondisi</span></div></td>';
newRow.append(cols); newRow.append(cols);
$("#tabledokter").append(newRow); $("#tabledokter").append(newRow);
...@@ -98,11 +86,12 @@ function Loaddokter() { ...@@ -98,11 +86,12 @@ function Loaddokter() {
paging: true, paging: true,
columnDefs: [ columnDefs: [
{ width: 30, targets: 0 }, { width: 30, targets: 0 },
{ width: 155, targets: 1 }, { width: 120, targets: 1 },
{ width: 155, targets: 2 }, { width: 120, targets: 2 },
{ width: 155, targets: 3 }, { width: 120, targets: 3 },
{ width: 155, targets: 4 }, { width: 120, targets: 4 },
{ width: 90, targets: 5 }, { width: 90, targets: 5 },
{ width: 90, targets: 6 },
], ],
}); });
...@@ -211,8 +200,8 @@ function validasigambar() { ...@@ -211,8 +200,8 @@ function validasigambar() {
$('#tambahmodal').on('click', function () { $('#tambahmodal').on('click', function () {
loadpoli() loadpoli()
}) })
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
let nama_dokter = $('#nama_dokter').val(); let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val(); let kode_dokter = $('#kode_dokter').val();
...@@ -249,7 +238,7 @@ $('#tambah').on('click', function () { ...@@ -249,7 +238,7 @@ $('#tambah').on('click', function () {
} }
else if (validasigambar() == 1) { else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} else { } else {
savedokter() savedokter()
} }
...@@ -325,7 +314,7 @@ $('#edit').on('click', function () { ...@@ -325,7 +314,7 @@ $('#edit').on('click', function () {
let nama_dokter = $('#nama_dokteredt').val(); let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val();
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
const fileupload = $('#gambar_dokter').prop('files')[0]; const fileupload = $('#gambar_dokteredt').prop('files')[0];
if (nama_dokter == null || nama_dokter == "") { if (nama_dokter == null || nama_dokter == "") {
...@@ -340,19 +329,20 @@ $('#edit').on('click', function () { ...@@ -340,19 +329,20 @@ $('#edit').on('click', function () {
bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
return false; return false;
} }
else if (fileupload == null) {
bootbox.alert({ message: 'Gambar dokter tidak boleh kosong', centerVertical: true }); else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) {
return false;
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 3) {
bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true });
} }
else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) { else if (validasidokter(poli, nama_dokter, kode_dokter) == 5) {
bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true });
} else if (validasigambar() == 2) {
if (fileupload == null || fileupload == '') {
editdatadokter(id_dokter);
} else {
bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} }
else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
} else { } else {
editdatadokter(id_dokter) editdatadokter(id_dokter)
} }
...@@ -362,7 +352,7 @@ $('#edit').on('click', function () { ...@@ -362,7 +352,7 @@ $('#edit').on('click', function () {
}) })
function editdatadokter(id_dokter) { function editdatadokter(id_dokter) {
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
let condition = $("#condition option:selected").attr("value");
let nama_dokter = $('#nama_dokteredt').val(); let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val();
const fileupload = $('#gambar_dokteredt').prop('files')[0]; const fileupload = $('#gambar_dokteredt').prop('files')[0];
...@@ -373,7 +363,7 @@ function editdatadokter(id_dokter) { ...@@ -373,7 +363,7 @@ function editdatadokter(id_dokter) {
formData.append('inama_dokter', nama_dokter); formData.append('inama_dokter', nama_dokter);
formData.append('ikode_dokter', kode_dokter); formData.append('ikode_dokter', kode_dokter);
formData.append('ipoli', poli); formData.append('ipoli', poli);
formData.append('icondition', condition);
formData.append('fileupload', fileupload); // set file ke tipe data binary formData.append('fileupload', fileupload); // set file ke tipe data binary
...@@ -468,14 +458,6 @@ function loadedit(id_dokter) { ...@@ -468,14 +458,6 @@ function loadedit(id_dokter) {
$("select#poliedt").val(data[0].id_poli).change(); $("select#poliedt").val(data[0].id_poli).change();
}); });
for (var i = 0; i < res.condition.length; i++) {//Condition
optionsegc += '<option value="' + res.condition[i].id_condition + '">' + res.condition[i].condition + '</option>';
}
$("select#condition").html(optionsegc);
$(document).ready(function () {
$("select#condition").val(data[0].id_condition).change();
});
...@@ -561,3 +543,35 @@ function Delete(param) { ...@@ -561,3 +543,35 @@ function Delete(param) {
}); });
} }
function Update(id_dokter, id_condition) {
// console.log(id_dokter)
// console.log(id_condition)
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateconditiondok',
data: {
id_dokter: id_dokter,
id_condition: id_condition,
},
success: function (result) {
console.log(result);
// console.log(result)
if (result.code == 0) {
location.reload();
} else {
bootbox.alert({ message: 'Gagal ', centerVertical: true });
}
},
error: function () {
bootbox.alert({ message: 'Data dokter masih terdaftar dalam poli ', centerVertical: true });
}
});
}
\ No newline at end of file
...@@ -34,7 +34,7 @@ function Loadpasien() { ...@@ -34,7 +34,7 @@ function Loadpasien() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_hp + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_hp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_pasien + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_pasien + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_pasien + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_pasien + ')">Hapus</span></div></td>';
// console.log(data[x].id_pasien); // console.log(data[x].id_pasien);
newRow.append(cols); newRow.append(cols);
......
...@@ -27,7 +27,6 @@ function Loadpoli() { ...@@ -27,7 +27,6 @@ function Loadpoli() {
let data = result.data; let data = result.data;
let counter = 1; let counter = 1;
for (x in data) { for (x in data) {
// console.log(data); // console.log(data);
// var newRow = $("<tr>"); // var newRow = $("<tr>");
...@@ -39,7 +38,7 @@ function Loadpoli() { ...@@ -39,7 +38,7 @@ function Loadpoli() {
cols += '<td class="tdCenterText bgtd1 ">' + data[x].kode_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].kode_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 ">' + data[x].deskripsi_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].deskripsi_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 ">' + data[x].image_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].image_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_poli + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_poli + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_poli + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_poli + ')">Hapus</span></div></td>';
cols += '</tr>' cols += '</tr>'
//newRow.append(cols); //newRow.append(cols);
$("#tablepoli").append(cols); $("#tablepoli").append(cols);
...@@ -114,7 +113,7 @@ $('#tambah').on('click', function (e) { ...@@ -114,7 +113,7 @@ $('#tambah').on('click', function (e) {
bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true }); bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true });
} }
else if (validasigambar() == 1) { else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} else { } else {
savedatapoli(); savedatapoli();
} }
...@@ -217,7 +216,10 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { ...@@ -217,7 +216,10 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
var data = result.data; var data = result.data;
console.log(data) console.log(data)
var counter = 0; var counternama = 0;
var counterkode = 0;
var counterdesk = 0;
var counterimage = 0;
for (x in data) { for (x in data) {
...@@ -235,27 +237,27 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { ...@@ -235,27 +237,27 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
exist = 4; exist = 4;
} }
if (nama_poli == data[x]['nama_poli']) { if (nama_poli == data[x]['nama_poli']) {
counter += 1; counternama += 1;
if (counter > 1) { if (counternama > 1) {
exist = 5; exist = 5;
} }
} }
if (kode_poli == data[x]['kode_poli']) { if (kode_poli == data[x]['kode_poli']) {
counter += 1; counterkode += 1;
if (counter > 1) { if (counterkode > 1) {
exist = 6; exist = 6;
} }
} }
if (deskripsi_poli == data[x]['deskripsi_poli']) { if (deskripsi_poli == data[x]['deskripsi_poli']) {
counter += 1; counterdesk += 1;
if (counter > 1) { if (counterdesk > 1) {
exist = 7; exist = 7;
} }
} }
if (fileupload == data[x]['image_poli']) { if (fileupload == data[x]['image_poli']) {
counter += 1; counterimage += 1;
if (counter > 1) { if (counterimage > 1) {
exist = 8; exist = 8;
} }
} }
...@@ -281,6 +283,7 @@ $('#edit').on('click', function () { ...@@ -281,6 +283,7 @@ $('#edit').on('click', function () {
let kode_poli = $('#kode_poliEdt').val(); let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val(); let deskripsi_poli = $('#deskripsi_poliEdt').val();
const fileupload = $('#gambar_poliedt').prop('files')[0]; const fileupload = $('#gambar_poliedt').prop('files')[0];
console.log(fileupload);
if (nama_poli == null || nama_poli == "") { if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
...@@ -294,10 +297,7 @@ $('#edit').on('click', function () { ...@@ -294,10 +297,7 @@ $('#edit').on('click', function () {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false; return false;
} }
else if (fileupload == null) {
bootbox.alert({ message: ' Gambar tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli.toString().length > 5) { else if (kode_poli.toString().length > 5) {
bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true }); bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true });
return false; return false;
...@@ -311,11 +311,15 @@ $('#edit').on('click', function () { ...@@ -311,11 +311,15 @@ $('#edit').on('click', function () {
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) { else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) {
bootbox.alert({ message: 'Deskripsi Poli harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Deskripsi Poli harus berbeda!', centerVertical: true });
} }
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload.name) == 8) { else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 8) {
bootbox.alert({ message: 'Gambar Poli harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Gambar Poli harus berbeda!', centerVertical: true });
} }
else if (validasigambar() == 2) { else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); if (fileupload == null || fileupload == '') {
editdatapoli(id_poli)
} else {
bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
}
} else { } else {
editdatapoli(id_poli) editdatapoli(id_poli)
......
...@@ -82,7 +82,7 @@ function Loadruang() { ...@@ -82,7 +82,7 @@ function Loadruang() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_ruang + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_ruang + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_ruang + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_ruang + ')">Hapus</span><span style="padding: 7px;margin-top:10px; font-size: 14px;"class="btn btn-info btn-xs" onclick="Update(' + data[x].id_ruang + "," + data[x].id_condition + ')">Update Kondisi</span></div></td>';
newRow.append(cols); newRow.append(cols);
$("#tableruang").append(newRow); $("#tableruang").append(newRow);
...@@ -288,7 +288,7 @@ function editdataruang(id_ruang) { ...@@ -288,7 +288,7 @@ function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val(); let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val(); let lantai = $('#lantaiedt').val();
let condition = $("#condition option:selected").attr("value");
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -299,7 +299,6 @@ function editdataruang(id_ruang) { ...@@ -299,7 +299,6 @@ function editdataruang(id_ruang) {
inama_ruang: nama_ruang, inama_ruang: nama_ruang,
ipoli: poli, ipoli: poli,
ilantai: lantai, ilantai: lantai,
icondition: condition,
}, },
...@@ -389,15 +388,6 @@ function loadedit(id_ruang) { ...@@ -389,15 +388,6 @@ function loadedit(id_ruang) {
$("select#poliedt").val(data[0].id_poli).change(); $("select#poliedt").val(data[0].id_poli).change();
}); });
for (var i = 0; i < res.condition.length; i++) {//Condition
optionsegc += '<option value="' + res.condition[i].id_condition + '">' + res.condition[i].condition + '</option>';
}
$("select#condition").html(optionsegc);
$(document).ready(function () {
$("select#condition").val(data[0].id_condition).change();
});
} }
...@@ -431,8 +421,9 @@ function Delete(param) { ...@@ -431,8 +421,9 @@ function Delete(param) {
success: function (result) { success: function (result) {
// console.log(result); // console.log(result);
let nama_ruang = result.data[0].nama_ruang; let nama_ruang = result.data[0].nama_ruang;
let lantai = result.data[0].lantai;
swal({ swal({
title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ", title: "Apakah yakin mengahapus ruang '" + nama_ruang + " ' lantai '" + lantai + "'? ",
type: "error", type: "error",
confirmButtonClass: "btn-danger", confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!", confirmButtonText: "Yes!",
...@@ -479,3 +470,35 @@ function Delete(param) { ...@@ -479,3 +470,35 @@ function Delete(param) {
}); });
} }
function Update(id_ruang, id_condition) {
// console.log(id_dokter)
// console.log(id_condition)
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateconditionruang',
data: {
id_ruang: id_ruang,
id_condition: id_condition,
},
success: function (result) {
console.log(result);
// console.log(result)
if (result.code == 0) {
location.reload();
} else {
bootbox.alert({ message: 'Gagal ', centerVertical: true });
}
},
error: function () {
bootbox.alert({ message: 'Data dokter masih terdaftar dalam poli ', centerVertical: true });
}
});
}
\ No newline at end of file
...@@ -10,7 +10,7 @@ function loadpoli() { ...@@ -10,7 +10,7 @@ function loadpoli() {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadRegisterPoli', url: baseURL + '/api/loadPoli',
success: function (result) { success: function (result) {
...@@ -29,17 +29,17 @@ function loadpoli() { ...@@ -29,17 +29,17 @@ function loadpoli() {
$("#poli").append(y); $("#poli").append(y);
} else { } else {
alert(result.info); // alert(result.info);
} }
}, },
error: function (xhr) { // error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText); // alert(xhr.status + '-' + xhr.statusText);
} // }
}); });
} }
$(document).ready(function () { $(document).ready(function () {
loadChart(9) loadChart(12)
}); });
function loadChart(id) { function loadChart(id) {
...@@ -120,7 +120,7 @@ function loadChart(id) { ...@@ -120,7 +120,7 @@ function loadChart(id) {
}); });
bootbox.alert({ message: 'Data Kosong', centerVertical: true }); // bootbox.alert({ message: 'Data Kosong', centerVertical: true });
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment