diff --git a/module/Application/src/Controller/AdminController.php b/module/Application/src/Controller/AdminController.php index 2ed1e26ede2b727d9edd560b85924af67a510a1b..8ebd4cbe49fe4b337419d3708d61e7325a90839d 100644 --- a/module/Application/src/Controller/AdminController.php +++ b/module/Application/src/Controller/AdminController.php @@ -103,6 +103,22 @@ class AdminController extends \Application\Master\GlobalActionController $this->layout("layout/layoutAdmin"); 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() diff --git a/module/Application/src/Controller/ApiController.php b/module/Application/src/Controller/ApiController.php index 566318fdca010a0b559d7e46909aa2ea6ee8e813..e5b0cc9176905b69fa43e70f5df11e91e35fc4fd 100644 --- a/module/Application/src/Controller/ApiController.php +++ b/module/Application/src/Controller/ApiController.php @@ -218,7 +218,6 @@ class ApiController extends \Application\Master\GlobalActionController { $dataArrayAntrianPasien = array ( 'id_pasien' => $id, - 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'nama' => $nama, 'tempat_lahir' => $tempat_lahir, 'tanggal_lahir' => $tanggal_lahir, @@ -284,11 +283,9 @@ class ApiController extends \Application\Master\GlobalActionController { $poli = $post->ipoli; $dokter = $post->idokter; $antrian_all = $post->iantrian_all; - $antrian_awal = $post->iantrian_awal; - $antrian_akhir = $post->iantrian_akhir; $waktu_antrian = $post->iwaktu_antrian; $jam_mulai = $post->ijam_mulai; - +// print_r($antrian_all); die; $array = array(); @@ -301,8 +298,6 @@ class ApiController extends \Application\Master\GlobalActionController { 'id_poli' => $poli, 'id_dokter' => $dokter, 'antrian_all' => $antrian_all, - 'antrian_awal' => $antrian_awal, - 'antrian_akhir' => $antrian_akhir, 'waktu_antrian' => $waktu_antrian, 'id_condition' =>1, 'jam_mulai' => $jam_mulai, @@ -313,8 +308,6 @@ class ApiController extends \Application\Master\GlobalActionController { $dataArrayRegisterAntrian= array ( 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'antrian_all' => $antrian_all, - 'antrian_awal' => $antrian_awal, - 'antrian_akhir' => $antrian_akhir, 'waktu_antrian' => $waktu_antrian, 'jam_mulai' => $jam_mulai, ); @@ -362,46 +355,14 @@ class ApiController extends \Application\Master\GlobalActionController { $seqBefore2 = $param->getLastSeqPostgree($tb_antrian_pasien,'id_antrian'); //untuk load data id register di table antrian register lalu menambahkan pada table pasien - for ($no_web=1; $no_web <= $antrian_all;){ - - if($no_web == $antrian_awal){ - for ($no_mob=$antrian_awal; $no_mob <= $antrian_akhir;){ - - $dataArrayAntrianPasien = array ( - 'id_register' => $seqAfter1->data['total'], - 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), - 'no_antrian' => $no_mob, - 'id_poli' => $poli, - 'kode_antrian' => 2, - 'id_dokter' => $dokter, - 'id_ruang' => $ruang, - - - ); - - - $dataArrayAntrian = array ( - 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), - 'no_antrian' => $no_mob, - 'kode_antrian' => 2, - - ); - - - - $param->saveGlobal($dataArrayAntrianPasien, $tb_antrian_pasien); - $param->saveGlobal($dataArrayAntrian, $tb_antrian); - $no_mob++; - } - $no_web=$antrian_akhir; - }else{ + for ($noantrian=1; $noantrian <= $antrian_all;){ $dataArrayAntrianPasien = array ( 'id_register' => $seqAfter1->data['total'], 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), - 'no_antrian' => $no_web, + 'no_antrian' => $noantrian, 'id_poli' => $poli, - 'kode_antrian' => 1, + 'id_dokter' => $dokter, 'id_ruang' => $ruang, @@ -409,17 +370,23 @@ class ApiController extends \Application\Master\GlobalActionController { $dataArrayAntrian = array ( 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), - 'no_antrian' => $no_web, - 'kode_antrian' => 1, + 'no_antrian' => $noantrian, + ); - + $param->saveGlobal($dataArrayAntrianPasien, $tb_antrian_pasien); $param->saveGlobal($dataArrayAntrian, $tb_antrian); - } - $no_web++; + $noantrian++; + } + + + + + + - } + $seqAfter2 = $param->getLastSeqPostgree($tb_antrian_pasien, 'id_antrian'); @@ -483,8 +450,33 @@ class ApiController extends \Application\Master\GlobalActionController { $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $test = new \Application\Model\Param($storage); - $load = $test->loadRegister($post->id); + $load = $test->loadantrianregister($post->id); + // print_r($load);die; + + if($load->code == 0){ + $result->code = $result::CODE_SUCCESS; + $result->info = $result::INFO_SUCCESS; + $result->data = $load->data; + }else{ + $result->code = 1; + $result->info = 'Not Found'; + } + + return $this->getOutput($result->toJson()); + } + + public function loadantrianregisterallAction(){ + $result = new Result(); + $request = $this->getRequest(); + $post = $request->getPost(); + //$name = $this->isFieldMandatory(@$data['name'], 'name'); + + $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); + $test = new \Application\Model\Param($storage); + + $load = $test->loadantrianregisterall($post->id); + // print_r($load);die; if($load->code == 0){ $result->code = $result::CODE_SUCCESS; @@ -497,6 +489,8 @@ class ApiController extends \Application\Master\GlobalActionController { return $this->getOutput($result->toJson()); } + + public function editdataregisterAction(){ if($this->isLoggedIn()){ @@ -516,20 +510,15 @@ class ApiController extends \Application\Master\GlobalActionController { try{ $id_register = $post->id; - $antrian_all = $post->iantrial_all; - $antrian_awal = $post->iantrian_awal; - $antrian_akhir = $post->iantrian_akhir; $waktu_antrian = $post->iwaktu_antrian; $jam_mulai = $post->ijam_mulai; - + $dataArrayRegister = array ( 'antrian_all' =>$antrian_all, - 'antrian_awal' =>$antrian_awal, - 'antrian_akhir' =>$antrian_akhir, 'waktu_antrian' =>$waktu_antrian, 'jam_mulai' =>$jam_mulai, @@ -566,8 +555,8 @@ class ApiController extends \Application\Master\GlobalActionController { // } - $load = $param->loadRegister($post->id); - // print_r($dataArrayRegister);die; + $load = $param->loadantrianregister($post->id); + $table_register= 'register_dokter'; $where = 'id_register='.$id_register; // print_r ($where);die; @@ -599,7 +588,9 @@ class ApiController extends \Application\Master\GlobalActionController { $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $test = new \Application\Model\Param($storage); - + $tabel = 'antrian_pasien'; + $where = 'id_register='.$post->id; + $res = $test->deleteGlobal($tabel, $where); $tabel = 'register_dokter'; $where = 'id_register='.$post->id; $res = $test->deleteGlobal($tabel, $where); @@ -726,8 +717,8 @@ class ApiController extends \Application\Master\GlobalActionController { try{ $fileupload = $_FILES['fileupload']['tmp_name']; + $id_poli = $post->id_poli; - $nama_poli = $post->inama_poli; $kode_poli = $post->ikode_poli; $deskripsi_poli = $post->ideskripsi_poli; @@ -747,7 +738,7 @@ class ApiController extends \Application\Master\GlobalActionController { if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){ /* jika upload berhasil ke folder sever */ - $dataArrayPoli = array ( + $dataArrayPoli = array( 'nama_poli' => $nama_poli, 'image_poli' => $ImageName, @@ -764,7 +755,7 @@ class ApiController extends \Application\Master\GlobalActionController { $result->code = 0; $result->info = 'ok'; - $result->data = $load->data; + }else{ @@ -774,7 +765,16 @@ class ApiController extends \Application\Master\GlobalActionController { }else{ - $result->info = 'File tidak boleh kosong'; + $dataArrayPoli = array( + + 'nama_poli' => $nama_poli, + 'deskripsi_poli' => $deskripsi_poli, + 'kode_poli' => $kode_poli, + ); + + $table_poli = 'poli'; + $where = 'id_poli='.$id_poli; + $param->updateGlobal($table_poli, $dataArrayPoli, $where); } @@ -952,11 +952,11 @@ class ApiController extends \Application\Master\GlobalActionController { $fileupload = $_FILES['fileupload']['tmp_name']; $id_dokter = $post->id_dokter; - // print_r($id_dokter);die; + $nama_dokter = $post->inama_dokter; $kode_dokter = $post->ikode_dokter; $poli = $post->ipoli; - $condition = $post->icondition; + if (!empty($fileupload)){ $ImageName = $_FILES['fileupload']['name']; @@ -979,12 +979,13 @@ class ApiController extends \Application\Master\GlobalActionController { 'nama_dokter' => $nama_dokter, 'kode_dokter' =>$kode_dokter, 'id_poli' =>$poli, - 'id_condition' =>$condition, + 'image_dokter' => $ImageName, ); + $Dokter = array ( @@ -998,13 +999,11 @@ class ApiController extends \Application\Master\GlobalActionController { $table_dokter_to_poli= 'dokter_to_poli'; $where = 'id_dokter='.$id_dokter; - $param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where); - + $table_dokter= 'dokter'; $where = 'id_dokter='.$id_dokter; - $param->updateGlobal($table_dokter, $Dokter, $where); $result->code = 0; @@ -1018,7 +1017,33 @@ class ApiController extends \Application\Master\GlobalActionController { }else{ - $result->info = 'File tidak boleh kosong'; + $DokterPoli = array ( + + 'nama_dokter' => $nama_dokter, + 'kode_dokter' =>$kode_dokter, + 'id_poli' =>$poli, + ); + + $Dokter = array ( + + 'nama_dokter' => $nama_dokter, + 'kode_dokter' =>$kode_dokter, + + ); + + $load = $param->loadkeloladokter($post->id); + + $table_dokter_to_poli= 'dokter_to_poli'; + $where = 'id_dokter='.$id_dokter; + $param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where); + + + $table_dokter= 'dokter'; + $where = 'id_dokter='.$id_dokter; + $param->updateGlobal($table_dokter, $Dokter, $where); + + $result->code = 0; + $result->info = 'ok'; } @@ -1033,6 +1058,7 @@ class ApiController extends \Application\Master\GlobalActionController { return $this->getOutput($result->toJson()); } + public function deletekeloladokterAction(){ $result = new Result(); $request = $this->getRequest(); @@ -1153,7 +1179,7 @@ class ApiController extends \Application\Master\GlobalActionController { $nama_ruang = $post->inama_ruang; $poli = $post->ipoli; $lantai = $post->ilantai; - $condition = $post->icondition; + @@ -1162,8 +1188,6 @@ class ApiController extends \Application\Master\GlobalActionController { 'nama_ruang' =>$nama_ruang, 'id_poli' =>$poli, 'lantai' =>$lantai, - 'id_condition' =>$condition, - ); $load = $param->loadkelolaruang($post->id); @@ -1319,10 +1343,7 @@ class ApiController extends \Application\Master\GlobalActionController { 'tanggal_lahir' =>$tanggal_lahir, 'tempat_lahir' =>$tempat_lahir, 'alamat' =>$alamat, - 'no_hp' =>$no_hp, - - - + 'no_hp' =>$no_hp, ); @@ -1376,6 +1397,108 @@ class ApiController extends \Application\Master\GlobalActionController { return $this->getOutput($result->toJson()); } + public function updateconditiondokAction(){ + if($this->isLoggedIn()){ + $result = new Result(); + $request = $this->getRequest(); + $post = $request->getPost(); + + if ($request->isPost()) { + + + $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); + $param = new \Application\Model\Param($storage); + + try{ + $id_dokter = $post->id_dokter; + $id_condition = $post->id_condition; + + // print_r( $id_dokter);die; + // print_r( $id_condition);die; + + if($id_condition == 1){ + $datacondition = array ( + 'id_condition' => 2, + ); + + }else{ + $datacondition = array ( + 'id_condition' => 1, + ); + } + + + + // print_r($post->id);die; + $tabledok= 'dokter_to_poli'; + $where = 'id_dokter='.$id_dokter; + + $param->updateGlobal($tabledok, $datacondition, $where); + + $result->code = 0; + $result->info = 'ok'; + + + }catch (\Exception $exc) { + $result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString()); + } + }else{ + $result = new Result(0,401,'Silahkan masuk untuk melanjutkan'); + } + } + return $this->getOutput($result->toJson()); + } + + public function updateconditionruangAction(){ + if($this->isLoggedIn()){ + $result = new Result(); + $request = $this->getRequest(); + $post = $request->getPost(); + + if ($request->isPost()) { + + + $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); + $param = new \Application\Model\Param($storage); + + try{ + $id_ruang = $post->id_ruang; + $id_condition = $post->id_condition; + + // print_r( $id_dokter);die; + // print_r( $id_condition);die; + + if($id_condition == 1){ + $datacondition = array ( + 'id_condition' => 2, + ); + + }else{ + $datacondition = array ( + 'id_condition' => 1, + ); + } + + // print_r($post->id);die; + $tableruang= 'ruang'; + $where = 'id_ruang='.$id_ruang; + + $param->updateGlobal($tableruang, $datacondition, $where); + + $result->code = 0; + $result->info = 'ok'; + + + }catch (\Exception $exc) { + $result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString()); + } + }else{ + $result = new Result(0,401,'Silahkan masuk untuk melanjutkan'); + } + } + return $this->getOutput($result->toJson()); + } + public function loadpasienAction(){ $result = new Result(); @@ -1526,6 +1649,7 @@ class ApiController extends \Application\Master\GlobalActionController { // $id = $this->_getParam($test->loadAntrian($post->id_poli)); $load = $test->loadAntrian($post->id_poli); + // print_r($post->id_poli);die; if($load->code == 0){ $result->code = $result::CODE_SUCCESS; @@ -1576,7 +1700,7 @@ class ApiController extends \Application\Master\GlobalActionController { $load = $poli->loadPoli($post->$id_poli); - +// print_r($post->$id_poli);die; if($load->code == 0){ @@ -1626,8 +1750,10 @@ class ApiController extends \Application\Master\GlobalActionController { $iddokter = $post->iddok; - - $load = $dokter->loadPilihAntrian($iddokter); + $id_poli = $post->id_poli; + + // print_r($id_pasien);die; + $load = $dokter->loadPilihAntrian($iddokter, $id_poli); $listdata = array(); @@ -1648,6 +1774,34 @@ class ApiController extends \Application\Master\GlobalActionController { return $this->getOutput($result->toJson()); } + public function valpilihAntrianAction(){ + $result = new Result(); + $request = $this->getRequest(); + $post = $request->getPost(); + + $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); + $dokter = new \Application\Model\Param($storage); + + + + + $id_pasien = $post->id_pasien; + // print_r($id_pasien);die; + $load = $dokter->valpilihAntrian($id_pasien); + + + // print_r($listdata);die; + if($load->code == 0){ + $result->code = $result::CODE_SUCCESS; + $result->info = $result::INFO_SUCCESS; + $result->data = $load->data; + }else{ + $result->code = 1; + $result->info = 'Not Found'; + } + + return $this->getOutput($result->toJson()); + } public function LoadAntrianAdminAction(){ $result = new Result(); @@ -1808,7 +1962,6 @@ class ApiController extends \Application\Master\GlobalActionController { $dataarray = array( 'id_pasien' => null, - 'create_date' => null, 'nama' => null, 'tempat_lahir' => null, 'tanggal_lahir' => null, diff --git a/module/Application/src/Controller/UmumController.php b/module/Application/src/Controller/UmumController.php index 0c2be5df3fb420959ae1088f85b867233afefe88..d12ff85d6334757df97ff035ce709642cdd36d5c 100644 --- a/module/Application/src/Controller/UmumController.php +++ b/module/Application/src/Controller/UmumController.php @@ -58,7 +58,7 @@ class UmumController extends \Application\Master\GlobalActionController $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $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"); return $view; diff --git a/module/Application/src/Model/Param.php b/module/Application/src/Model/Param.php index e44be9b59165fc1eb91c4a8262750cd0873143f5..3f3f06c8c1d0365403b92fe634fc36f75f6390bc 100644 --- a/module/Application/src/Model/Param.php +++ b/module/Application/src/Model/Param.php @@ -102,10 +102,15 @@ class Param extends Mapper { return $data; } - public function loadRegister($id = null){ - $data = $this->_storage->loadRegisterAntrianData($id); + public function loadantrianregister($id = null){ + $data = $this->_storage->loadantrianregister($id); return $data; } + public function loadantrianregisterall($id = null){ + $data = $this->_storage->loadantrianregisterall($id); + return $data; + } + public function loadkelolapoli($id = null){ $data = $this->_storage->loadkelolapoli($id); return $data; @@ -138,8 +143,12 @@ class Param extends Mapper { $data = $this->_storage->loadantrianunregis($id); return $data; } - public function loadPilihAntrian($iddok = null){ - $data = $this->_storage->loadPilihAntrian($iddok); + public function loadPilihAntrian($iddok = null , $id_poli= null ){ + $data = $this->_storage->loadPilihAntrian($iddok, $id_poli); + return $data; + } + public function valpilihAntrian($id_pasien = null ){ + $data = $this->_storage->valpilihAntrian($id_pasien); return $data; } public function loadDokter($id = null){ diff --git a/module/Application/src/Model/Param/Storage/Mysql.php b/module/Application/src/Model/Param/Storage/Mysql.php index 3421b0a302124efe85bf02ffe5f083f7ff69e72b..67932365daefed43815ddc748f6ec0316f355105 100644 --- a/module/Application/src/Model/Param/Storage/Mysql.php +++ b/module/Application/src/Model/Param/Storage/Mysql.php @@ -322,13 +322,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter,antrian_pasien.id_pasien, dokter_to_poli.id_dokter,antrian_pasien.sisa_antrian + $sql = " SELECT antrian_pasien.id_pasien, antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter, dokter_to_poli.id_dokter,antrian_pasien.sisa_antrian, antrian_pasien.create_date FROM antrian_pasien INNER JOIN dokter_to_poli ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter INNER JOIN poli ON antrian_pasien.id_poli = poli.id_poli - WHERE antrian_pasien.id_antrian = $id + WHERE antrian_pasien.id_antrian = $id + "; $stmt = $this->_db->query($sql); @@ -448,7 +449,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $sql = " SELECT COUNT(id_pasien) FROM antrian_pasien - WHERE id_pasien is not null AND + WHERE id_pasien is not null AND create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' AND id_dokter =$id AND (status_code <> 50 and status_code <> 60) and no_antrian < $no"; @@ -563,9 +564,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { try { $sql = " SELECT dp.id_dokter, dp.nama_dokter,ap.id_dokter, count (ap.id_dokter) as total from antrian_pasien ap, dokter_to_poli dp - WHERE ap.id_poli = $id and dp.id_dokter = ap.id_dokter - - GROUP BY dp.id_dokter, ap.id_dokter "; + WHERE ap.id_poli = $id and dp.id_dokter = ap.id_dokter AND ap.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' + + GROUP BY dp.id_dokter, ap.id_dokter "; // print_r($sql);die; @@ -602,7 +603,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT count(id_pasien) FROM antrian_pasien "; + $sql = " SELECT count(id_pasien) FROM antrian_pasien WHERE create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' "; // print_r($sql);die; @@ -639,7 +640,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT count(status_code) FROM antrian_pasien WHERE status_code= 60 "; + $sql = " SELECT count(status_code) FROM antrian_pasien WHERE status_code= 60 AND create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' "; // print_r($sql);die; @@ -676,8 +677,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT count(status_code) FROM antrian_pasien - WHERE status_code = 50 "; + $sql = " SELECT count(status_code) FROM antrian_pasien WHERE status_code = 50 and create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' "; // print_r($sql);die; @@ -714,7 +714,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT id_antrian, id_dokter, no_antrian FROM antrian_pasien WHERE $where "; + $sql = "SELECT id_antrian, id_dokter, no_antrian, create_date FROM antrian_pasien WHERE create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' AND $where "; // print_r($sql);die; $stmt = $this->_db->query($sql); @@ -752,11 +752,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT p.id_pasien, ap.no_rekam_medis, ap.status_code,ap.no_antrian ,ap.no_antrian, ap.id_antrian, ap.nama FROM pasien p - LEFT JOIN antrian_pasien ap - ON ap.id_pasien = p.id_pasien + $sql = " SELECT id_pasien, no_rekam_medis FROM pasien - WHERE p.no_rekam_medis = '$no_rekam_medis' "; + WHERE no_rekam_medis = '$no_rekam_medis' "; // print_r($sql);die; $stmt = $this->_db->query($sql); @@ -841,7 +839,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT * FROM poli"; + $sql = " SELECT * FROM poli + ORDER BY nama_poli ASC"; + @@ -995,12 +995,65 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { } return $result; } - - public function loadRegisterAntrianData($id = null){ - $result = new Result(); + + public function loadantrianregister($id = null){ + $result = new Result(); + try { + + $sql = " SELECT register_dokter.id_register, dokter_to_poli.nama_dokter, poli.nama_poli, ruang.nama_ruang,register_dokter.antrian_all,register_dokter.waktu_antrian, register_dokter.jam_mulai, register_dokter.create_date + FROM register_dokter + INNER JOIN poli + ON register_dokter.id_poli = poli.id_poli + INNER JOIN dokter_to_poli + ON register_dokter.id_dokter = dokter_to_poli.id_dokter + INNER JOIN ruang + ON register_dokter.id_ruang = ruang.id_ruang + Where register_dokter.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' + "; + + if($id){ + $sql .= " AND register_dokter.id_register= $id AND register_dokter.id_register IS NOT NULL" ; + } + + $sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date"; + + + + // print_r($sql);die; + $stmt = $this->_db->query($sql); + $resdata = $stmt->execute(); + + $listdata = array(); + foreach($resdata as $val){ + + // print_r($val);die; + array_push($listdata, $val); + + } + + if ($listdata) { + $result->code = 0; + $result->info = 'OK'; + $result->data = $listdata; + }else{ + $result->code = 1; + $result->info = 'nok'; + } + + }catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) { + $result->code = 3; + $result->info = 'ERROR : ' . $ex->getMessage(); + }catch (\Exception $ex) { + $result->code = 4; + $result->info = 'ERROR : ' . $ex->getMessage(); + } + return $result; + } + public function loadantrianregisterall($id = null){ + $result = new Result(); try { - $sql = " SELECT register_dokter.id_register, dokter_to_poli.nama_dokter, poli.nama_poli, ruang.nama_ruang,register_dokter.antrian_all,register_dokter.antrian_awal,register_dokter.antrian_akhir,register_dokter.waktu_antrian, register_dokter.create_date,register_dokter.jam_mulai + $sql = " SELECT register_dokter.id_register, dokter_to_poli.nama_dokter, poli.nama_poli, ruang.nama_ruang,register_dokter.antrian_all,register_dokter.waktu_antrian, register_dokter.jam_mulai, register_dokter.create_date FROM register_dokter INNER JOIN poli ON register_dokter.id_poli = poli.id_poli @@ -1008,14 +1061,17 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ON register_dokter.id_dokter = dokter_to_poli.id_dokter INNER JOIN ruang ON register_dokter.id_ruang = ruang.id_ruang - "; + + "; if($id){ - $sql .= "WHERE register_dokter.id_register= $id AND register_dokter.id_register IS NOT NULL" ; + $sql .= " Where register_dokter.id_register= $id AND register_dokter.id_register IS NOT NULL" ; } $sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date"; + + // print_r($sql);die; $stmt = $this->_db->query($sql); $resdata = $stmt->execute(); @@ -1046,6 +1102,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { } return $result; } + public function loadkelolapasien($id = null){ $result = new Result(); try { @@ -1235,7 +1292,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT antrian_pasien.no_antrian,antrian_pasien.id_pasien, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli ,counter_status.status_code, counter_status.status_name + $sql = "SELECT antrian_pasien.no_antrian,antrian_pasien.id_pasien,antrian_pasien.create_date, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli ,counter_status.status_code, counter_status.status_name FROM antrian_pasien INNER JOIN poli ON poli.id_poli = antrian_pasien.id_poli @@ -1243,7 +1300,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter INNER JOIN counter_status ON counter_status.status_code = antrian_pasien.status_code - WHERE antrian_pasien.id_pasien IS NOT NULL AND antrian_pasien.status_code=60 + WHERE antrian_pasien.id_pasien IS NOT NULL AND antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'AND antrian_pasien.status_code=60 "; @@ -1285,13 +1342,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT antrian_pasien.id_pasien, antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.ktp,antrian_pasien.no_rekam_medis,poli.nama_poli,dokter_to_poli.nama_dokter,dokter_to_poli.id_dokter FROM antrian_pasien + $sql = "SELECT antrian_pasien.id_pasien, antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.ktp,antrian_pasien.no_rekam_medis,poli.nama_poli,dokter_to_poli.nama_dokter,dokter_to_poli.id_dokter, antrian_pasien.create_date + FROM antrian_pasien INNER JOIN poli on poli.id_poli = antrian_pasien.id_poli INNER JOIN dokter_to_poli on dokter_to_poli.id_dokter = antrian_pasien.id_dokter - WHERE id_pasien IS NOT NULL + WHERE id_pasien IS NOT NULL AND antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' ORDER BY poli.nama_poli asc "; @@ -1333,7 +1391,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT antrian_pasien.no_antrian,antrian_pasien.id_pasien, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli , counter_status.status_name + $sql = "SELECT antrian_pasien.no_antrian,antrian_pasien.id_pasien, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli , counter_status.status_name, antrian_pasien.create_date FROM antrian_pasien INNER JOIN poli ON poli.id_poli = antrian_pasien.id_poli @@ -1341,7 +1399,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter INNER JOIN counter_status ON counter_status.status_code = antrian_pasien.status_code - WHERE antrian_pasien.id_dokter=$iddok and antrian_pasien.id_pasien=$idpasien " + WHERE antrian_pasien.id_dokter=$iddok and antrian_pasien.id_pasien=$idpasien AND antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'"; ; @@ -1383,23 +1441,23 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = " SELECT poli.id_poli, poli.nama_poli - FROM antrian_pasien - INNER JOIN poli - ON antrian_pasien.id_poli = poli.id_poli "; + $sql = " SELECT poli.id_poli, poli.nama_poli, antrian_pasien.create_date + FROM antrian_pasien + INNER JOIN poli + ON antrian_pasien.id_poli = poli.id_poli + WHERE antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' + GROUP BY poli.id_poli, antrian_pasien.create_date"; - if($id){ - $sql .=" WHERE poli.id_poli=$id"; - } + - $sql .= " GROUP BY poli.id_poli"; + - //print_r($sql);die; + // print_r($sql);die; $stmt = $this->_db->query($sql); $resdata = $stmt->execute(); @@ -1612,26 +1670,26 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { return $result; } - public function loadPilihAntrian($iddok ){ + public function loadPilihAntrian($iddok, $id_poli){ $result = new Result(); try { - $sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.id_pasien, register_dokter.waktu_antrian , register_dokter.jam_mulai, antrian_pasien.status_code - FROM antrian_pasien - INNER JOIN - register_dokter - on antrian_pasien.id_dokter = register_dokter.id_dokter - - WHERE antrian_pasien.id_dokter= $iddok ORDER BY no_antrian ASC" ; - - + $sql = "SELECT DISTINCT on (idd.no_antrian) idd.no_antrian,idd.no_antrian, idd.id_pasien , idd.create_date,rd.waktu_antrian, rd.jam_mulai, idd.status_code,rd.id_register,idd.id_poli,idd.id_dokter,idd.id_antrian,idd.nama + FROM antrian_pasien idd + LEFT JOIN register_dokter rd + on idd.id_register = rd.id_register + WHERE idd.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' and idd.id_dokter =$iddok AND idd.id_poli= $id_poli ORDER BY no_antrian ASC" ; + + + // print_r($sql);die; + $stmt = $this->_db->query($sql); $resdata = $stmt->execute(); $listdata = array(); foreach($resdata as $val){ - // print_r($val);die; + array_push($listdata, $val); } @@ -1646,6 +1704,50 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result->info = 'nok'; } + }catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) { + $result->code = 3; + $result->info = 'ERROR : ' . $ex->getMessage(); + }catch (\Exception $ex) { + $result->code = 4; + $result->info = 'ERROR : ' . $ex->getMessage(); + } + return $result; + } + + public function valpilihAntrian($id_pasien = null){ + $result = new Result(); + try { + + $sql = "SELECT DISTINCT on (idd.no_antrian) idd.no_antrian,idd.no_antrian, idd.id_pasien , idd.create_date,rd.waktu_antrian, rd.jam_mulai, idd.status_code,rd.id_register,idd.id_poli,idd.id_dokter,idd.id_antrian,idd.nama + FROM antrian_pasien idd + LEFT JOIN register_dokter rd + on idd.id_register = rd.id_register + WHERE idd.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' AND idd.id_pasien = $id_pasien"; + + + + + // print_r($sql);die; + $stmt = $this->_db->query($sql); + $resdata = $stmt->execute(); + + $listdata = array(); + foreach($resdata as $val){ + + // print_r($val);die; + array_push($listdata, $val); + + } + + if ($listdata) { + $result->code = 0; + $result->info = 'OK'; + $result->data = $listdata; + }else{ + $result->code = 1; + $result->info = 'nok'; + } + }catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) { $result->code = 3; $result->info = 'ERROR : ' . $ex->getMessage(); @@ -1660,20 +1762,22 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli , counter_status.status_name, ruang.nama_ruang - FROM antrian_pasien - INNER JOIN poli - ON poli.id_poli = antrian_pasien.id_poli - INNER JOIN dokter_to_poli - ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter - INNER JOIN counter_status - ON counter_status.status_code = antrian_pasien.status_code - INNER JOIN ruang - on ruang.id_ruang = antrian_pasien.id_ruang + $sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.nama, dokter_to_poli.kode_dokter , dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter,poli.kode_poli, poli.nama_poli , counter_status.status_name, ruang.nama_ruang, antrian_pasien.create_date + FROM antrian_pasien + INNER JOIN poli + ON poli.id_poli = antrian_pasien.id_poli + INNER JOIN dokter_to_poli + ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter + INNER JOIN counter_status + ON counter_status.status_code = antrian_pasien.status_code + INNER JOIN ruang + on ruang.id_ruang = antrian_pasien.id_ruang + WHERE antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' + " ; if ($id){ - $sql .= "WHERE antrian_pasien.id_pasien IS NOT NULL AND dokter_to_poli.id_dokter = $id AND antrian_pasien.status_code=10 ORDER BY no_antrian ASC "; + $sql .= " AND antrian_pasien.id_pasien IS NOT NULL AND dokter_to_poli.id_dokter = $id AND antrian_pasien.status_code=10 ORDER BY no_antrian ASC"; } @@ -1714,27 +1818,26 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { public function loadAntrian($id_poli){ $result = new Result(); try { - $sql=" - SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang ,idd.status_code,idd.id_poli - FROM antrian_pasien idd - - LEFT JOIN dokter_to_poli dok - on idd.id_dokter = dok.id_dokter - LEFT JOIN poli pol - on idd.id_poli = pol.id_poli - LEFT JOIN ruang rur - on idd.id_ruang = rur.id_ruang - LEFT JOIN counter_status cs - on cs.status_code = idd.status_code - - WHERE idd.id_pasien is not null + $sql="SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang ,idd.status_code,idd.id_poli , idd.create_date + FROM antrian_pasien idd + + LEFT JOIN dokter_to_poli dok + on idd.id_dokter = dok.id_dokter + LEFT JOIN poli pol + on idd.id_poli = pol.id_poli + LEFT JOIN ruang rur + on idd.id_ruang = rur.id_ruang + LEFT JOIN counter_status cs + on cs.status_code = idd.status_code + + WHERE idd.id_pasien is not null AND idd.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' and (cs.status_code=30 or cs.status_code =40) and idd.id_poli=$id_poli "; - + // print_r($sql);die; $stmt = $this->_db->query($sql); $resdata = $stmt->execute(); @@ -1742,7 +1845,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $listdata = array(); foreach($resdata as $val){ - // print_r($val);die; + array_push($listdata, $val); } @@ -1771,7 +1874,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { $result = new Result(); try { - $sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.id_dokter, dokter_to_poli.kode_dokter, counter_status.status_name,counter_status.status_code, ruang.nama_ruang + $sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.id_dokter, dokter_to_poli.kode_dokter, counter_status.status_name,counter_status.status_code, ruang.nama_ruang,antrian_pasien.create_date FROM antrian_pasien INNER JOIN counter_status ON counter_status.status_code = antrian_pasien.status_code @@ -1779,9 +1882,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter INNER JOIN ruang ON ruang.id_ruang = antrian_pasien.id_ruang - " ; + WHERE antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'" ; if ($id){ - $sql .= "WHERE antrian_pasien.id_pasien IS NOT NULL AND dokter_to_poli.id_dokter = $id AND antrian_pasien.status_code=10 or dokter_to_poli.id_dokter = $id and antrian_pasien.status_code=30 or dokter_to_poli.id_dokter = $id and antrian_pasien.status_code=40 ORDER BY no_antrian ASC"; + $sql .= " AND antrian_pasien.id_pasien IS NOT NULL AND dokter_to_poli.id_dokter = $id AND antrian_pasien.status_code=10 or dokter_to_poli.id_dokter = $id and antrian_pasien.status_code=30 or dokter_to_poli.id_dokter = $id and antrian_pasien.status_code=40 ORDER BY no_antrian ASC"; } $stmt = $this->_db->query($sql); diff --git a/module/Application/view/application/admin/antrianadmin.phtml b/module/Application/view/application/admin/antrianadmin.phtml index 8e4c1c02e0c688fad77cf6af98ed416016f75e9d..edda2c140cdb06a834cc00cbf5db308c9dbb478a 100644 --- a/module/Application/view/application/admin/antrianadmin.phtml +++ b/module/Application/view/application/admin/antrianadmin.phtml @@ -18,14 +18,14 @@ <div><span style="visibility:hidden" id="nama_ruang"></span></div> <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-header"> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> </div> <div class="text-center content-group"> <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><input type="hidden" value="no_antrian" id="no_antrian" /></div> @@ -33,7 +33,7 @@ </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-header"> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> @@ -87,7 +87,7 @@ <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> </div> - <table class="table table-bordered"> + <table class="table table-bordered" > <thead class="bgHeader" style="border-top: 2px solid #ccc;"> <tr> <th style="width: 70px">NO</th> diff --git a/module/Application/view/application/admin/keloladokter.phtml b/module/Application/view/application/admin/keloladokter.phtml index de14dc7adaa675c22dd7e064ddf29b3e9949e330..42bbd603c27ec7fcb5a2a50c7d79a8d5c0469eaf 100644 --- a/module/Application/view/application/admin/keloladokter.phtml +++ b/module/Application/view/application/admin/keloladokter.phtml @@ -19,8 +19,8 @@ <th colspan="" class=" thLeftText">Nama Poli</th> <th colspan="" class=" thLeftText">Nama 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">Kondisi Dokter</th> <th colspan="" class=" thLeftText">Action</th> </tr> </thead> @@ -111,12 +111,7 @@ <label>Kode Dokter</label> <input type="input" id="kode_dokteredt" name="kode_dokter" class="form-control" required /></input> </div> - <div class="form-group"> - <label>Kondisi</label> - <select name="condition" id="condition" class="form-control" > - - </select> - </div> + <div class="form-group " > <label>Gambar Dokter</label> diff --git a/module/Application/view/application/admin/kelolapasien.phtml b/module/Application/view/application/admin/kelolapasien.phtml index 5de66834ebe98f29506791732efbb75d49bd14d1..2a159e902d1939cca7f3135b6e955691123a2ffb 100644 --- a/module/Application/view/application/admin/kelolapasien.phtml +++ b/module/Application/view/application/admin/kelolapasien.phtml @@ -35,7 +35,7 @@ <!-- Modal content--> <div class="modal-content"> <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">×</button> </div> <div class="modal-body"> diff --git a/module/Application/view/application/admin/kelolaruangan.phtml b/module/Application/view/application/admin/kelolaruangan.phtml index 0138286e31a8c78e5f7c1fdaea77c6b32d3cfe22..bbb434f53febf4e5006fd0c70266e99bfffcc86a 100644 --- a/module/Application/view/application/admin/kelolaruangan.phtml +++ b/module/Application/view/application/admin/kelolaruangan.phtml @@ -109,12 +109,7 @@ <label>Ruangan</label> <input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input> </div> - <div class="form-group"> - <label>Kondisi</label> - <select name="condition" id="condition" class="form-control" > - - </select> - </div> + <div class="modal-footer"> <button button type="button" class="btn btn-primary" id="edit">Edit</button> <button button type="button" class="btn btn-danger" onclick="reset()">Reset</button> diff --git a/module/Application/view/application/admin/registrasidokter.phtml b/module/Application/view/application/admin/registrasidokter.phtml index 245be1c90672f6a389ca46f062d0feade7196d13..6a97b8eb6325b94906a6a1240476c0d21c612dd7 100644 --- a/module/Application/view/application/admin/registrasidokter.phtml +++ b/module/Application/view/application/admin/registrasidokter.phtml @@ -4,24 +4,23 @@ <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-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> + <a type="button" class="btn btn-dark fa btn-lg" href="<?php echo $this->basePath('admin/registrasialldok') ?>"> Lihat Seluruh Antrian</a> <br> <br> <table class="table table-bordered" id="dataTable"> <thead> <tr class="table-infos"> <th style="">NO</th> - <th colspan="" class=" thLeftText">Nama Poli</th> - <th colspan="" class=" thLeftText">Nama Dokter</th> - <th colspan="" class=" thLeftText">Ruangan</th> - <th colspan="" class=" thLeftText">Antrian Seluruh</th> - <th colspan="" class=" thLeftText">Antrian Awal (mobile)</th> - <th colspan="" class=" thLeftText">Antrian Akhir (mobile)</th> - <th colspan="" class=" thLeftText">Jam Mulai</th> - <th colspan="" class=" thLeftText">Waktu Antrian</th> - <th colspan="" class=" thLeftText">Tanggal Antrian</th> - <th colspan="" class=" thLeftText">Action</th> + <th >Nama Poli</th> + <th >Nama Dokter</th> + <th>Ruangan</th> + <th >Antrian Seluruh</th> + <th>Jam Mulai</th> + <th >Waktu Antrian</th> + <th >Tanggal Antrian</th> + <th >Action</th> </tr> </thead> <tbody id="tableregisterdokter" > @@ -42,7 +41,7 @@ <!-- Modal content--> <div class="modal-content"> <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">×</button> </div> @@ -75,19 +74,6 @@ <input type="number" id="antrian_all" name="antrian_all" class="form-control" required /></input> </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="form-group"> <label>Waktu Mulai Antrian</label> @@ -125,13 +111,13 @@ <!-- Modal content--> <div class="modal-content"> <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">×</button> </div> <div class="modal-body"> <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"> <label>Nama Poli</label> @@ -162,19 +148,7 @@ <input type="number" id="antrian_alledt" name="antrian_all" class="form-control" required /></input> </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="form-group"> <label>Waktu Mulai Antrian</label> diff --git a/module/Application/view/application/queue/cekdatapasien.phtml b/module/Application/view/application/queue/cekdatapasien.phtml index 9acb3e740c1dedd58be0dfb721bc06a6ef6fbaf7..06111125f5282cc94fb8c0d73e235344d3556bc3 100644 --- a/module/Application/view/application/queue/cekdatapasien.phtml +++ b/module/Application/view/application/queue/cekdatapasien.phtml @@ -40,15 +40,12 @@ input::-webkit-inner-spin-button { <form id="myForm"> <input type="hidden" id="iInput" class="form-control" /></input> + <div class="form-group"> - <label> <h5>No Rekam Medis</h5></label><br> - <input type="text" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" ></input> + <label> <h5>No Rekam Medis</h5></label><br> + <input type="text" id="no_rekam_medis" class="form-control" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8"></input> </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> <a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a> </form> diff --git a/module/Application/view/application/queue/datapasien.phtml b/module/Application/view/application/queue/datapasien.phtml index 072268f05fd036f488130955a779326d6eed33b0..3b90b71b33308fcfb4d8b532b38386fe1d29fb79 100644 --- a/module/Application/view/application/queue/datapasien.phtml +++ b/module/Application/view/application/queue/datapasien.phtml @@ -223,69 +223,75 @@ input[type="done"] + label { <!-- Modal --> <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--> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="-close" data-dismiss="modal">×</button> - <h4 class="modal-title">Daftar Antrian</h4> - </div> - <div class="modal-body"> - <div class="row col-lg-12 antrian" id="seat"> - </div> - <div class="modal-footer"> - <div class="container" > - <div class="row col-lg-12"> - <div class="col-sm-3"> - <h6>Antrian Belum Dipilih</h6> - </div> - <div class="col-sm-1"> - <h6>:</h6> - </div> - <div> - <table class="table1"><tr><th></th></tr></table> - </div> - </div> - <div class="row col-lg-12"> - <div class="col-sm-3"> - <h6>Antrian Yang Dipilih</h6> - </div> - <div class="col-sm-1"> - <h6>:</h6> - </div> - <div> - <table class="table2"><tr><th></th></tr></table> - </div> - </div> - <div class="row col-lg-12"> - <div class="col-sm-3"> - <h6>Antrian Telah Diisi</h6> - </div> - <div class="col-sm-1"> - <h6>:</h6> - </div> - <div> - <table class="table3"><tr><th></th></tr></table> - </div> - </div> - <div class="row col-lg-12"> - <div class="col-sm-3"> - <h6>Antrian Telah Selesai</h6> - </div> - <div class="col-sm-1"> - <h6>:</h6> - </div> - <div> - <table class="table4"><tr><th></th></tr></table> - </div> + <div class="modal-content"> + + <div class="modal-header"> + <button type="button" class="-close" data-dismiss="modal">×</button> + <h4 class="modal-title">Daftar Antrian</h4> + </div> + <div class="modal-body"> + + <div class="row col-lg-12 antrian" id="seat"> + + + </div> + <div class="modal-footer"> + <div class="container" > + <div class="row col-lg-12"> + <div class="col-sm-3"> + <h6>Antrian Belum Dipilih</h6> + </div> + <div class="col-sm-1"> + <h6>:</h6> + </div> + <div> + <table class="table1"><tr><th></th></tr></table> + </div> + </div> + <div class="row col-lg-12"> + <div class="col-sm-3"> + <h6>Antrian Yang Dipilih</h6> + </div> + <div class="col-sm-1"> + <h6>:</h6> + </div> + <div> + <table class="table2"><tr><th></th></tr></table> + </div> + </div> + <div class="row col-lg-12"> + <div class="col-sm-3"> + <h6>Antrian Telah Diisi</h6> + </div> + <div class="col-sm-1"> + <h6>:</h6> + </div> + <div> + <table class="table3"><tr><th></th></tr></table> + </div> + </div> + <div class="row col-lg-12"> + <div class="col-sm-3"> + <h6>Antrian Telah Selesai</h6> + </div> + <div class="col-sm-1"> + <h6>:</h6> + </div> + <div> + <table class="table4"><tr><th></th></tr></table> + </div> + </div> + </div> + <button button type="button" class="btn btn-primary" id="tambah">Selesai</button> + <button type="button" id="close" class="btn btn-default" data-dismiss="modal">Close</button> + </div> </div> - <button button type="button" class="btn btn-primary" id="tambah">Selesai</button> - <button type="button" id="close" class="btn btn-default" data-dismiss="modal">Close</button> - - </div> - </div> - </div> + </div> </div> +</div> diff --git a/module/Application/view/layout/layoutAdmin.phtml b/module/Application/view/layout/layoutAdmin.phtml index aa60ae67d0f20c792e1a9ab1a12078b5e8fda930..fb82d4dd40191750ab8151a22456d03ad3477bf2 100644 --- a/module/Application/view/layout/layoutAdmin.phtml +++ b/module/Application/view/layout/layoutAdmin.phtml @@ -99,16 +99,16 @@ <span href="">Antrian</span> </a> </li> - <li class="nav-item"> + <!-- <li class="nav-item"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/tampilanumum') ?>"> <i class="fas fa-fw fa-folder"></i> <span href="">Tampilan Umum</span> </a> - </li> + </li> --> <li class="nav-item"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/registrasidokter') ?>"> <i class="fas fa-fw fa-cog"></i> - <span href="">Registrasi Dokter</span> + <span href="">Kelola Jadwal Dokter</span> </a> </li> diff --git a/module/Application/view/layout/layoutQueue.phtml b/module/Application/view/layout/layoutQueue.phtml index 6b48e0bbfee65f5b2d93f1e5745c635adcf1f98e..f46a9f930fc5bc3b413404a70bd96e641c52c172 100644 --- a/module/Application/view/layout/layoutQueue.phtml +++ b/module/Application/view/layout/layoutQueue.phtml @@ -20,11 +20,13 @@ ->prependStylesheet($this->basePath('/tamplate/css/flaticon.css')) ->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.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/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/demo.css')) ->prependStylesheet($this->basePath('/tamplate/css/intlTelInput.css')) + ?> </head> @@ -168,7 +170,7 @@ <script src="<?php echo $this->basePath();?>/tamplate/js/jquery.validate.min.js"></script> <script src="<?php echo $this->basePath();?>/tamplate/js/mail-script.js"></script> <script src="<?php $this->basePath();?>/tamplateadmin/assets/js/plugins/notifications/sweet_alert.min.js"></script> - + <!-- <script src="<?php echo $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script> --> <!-- <script src="<?php echo $this->basePath();?>/tamplate/js/custom.js"></script> --> diff --git a/public/action-js/antrian-js/action-admin.js b/public/action-js/antrian-js/action-admin.js index 769a31a29d0a9e761d2bdd2874b53776a56ea1d3..187123207a639d858db28a2fb86aedc5f3ca1a30 100644 --- a/public/action-js/antrian-js/action-admin.js +++ b/public/action-js/antrian-js/action-admin.js @@ -25,9 +25,9 @@ function textToAudioRuang() { let ruang = document.getElementById("nama_ruang").innerHTML; var res = ruang.replace(".", " "); document.getElementById("nama_ruang").innerHTML = res; - + let voice = "silahkan menuju ke ruang " + res; - + console.log(voice) let speech = new SpeechSynthesisUtterance(); speech.lang = "id"; @@ -64,33 +64,20 @@ $('#poli').on('change', function () { $("select#dokter").removeAttr('disabled'); $("select#dokter").html(optionseg); } else { - bootbox.dialog({ - 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'); - } - } - } - }); + bootbox.alert({ message: 'Data Dokter Kosong', centerVertical: true }); } } }); }); -$( '#dokter' ).on( "change", function() { - $id_dokter =$('#dokter').val(); - window.location.href = ("/admin/antrianadmin/" +$id_dokter); +$('#dokter').on("change", function () { + $id_dokter = $('#dokter').val(); + window.location.href = ("/admin/antrianadmin/" + $id_dokter); }); -if(window.location.pathname == "/admin/antrianadmin/" +id){ - $( window ).on( "load", function() { +if (window.location.pathname == "/admin/antrianadmin/" + id) { + $(window).on("load", function () { tampilangka(id) loadantrian(id) }); @@ -114,20 +101,7 @@ function loadpoli() { $("select#poli").html(optionseg); } else { - bootbox.dialog({ - 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'); - } - } - } - }); + bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); } } }); @@ -135,7 +109,7 @@ function loadpoli() { function loadantrian(id) { - $iddok= $('#dokter').val(); + $iddok = $('#dokter').val(); $.ajax({ type: 'POST', dataType: 'json', @@ -146,7 +120,7 @@ function loadantrian(id) { }, success: function (result) { - // console.log(result.data); + console.log(result.data); $('table.table-bordered > tbody').empty(); // console.log(result); @@ -154,7 +128,7 @@ function loadantrian(id) { if (result.code == 0) { let data = result.data; - console.log(data); + // console.log(data); let counter = 1; for (x in data) { @@ -172,9 +146,10 @@ function loadantrian(id) { $("#antrianadmin").append(newRow); counter++; + // $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>'); } - + // console.log(data); } else { bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true }); } @@ -192,7 +167,7 @@ function loadantrian(id) { $('#no_antrian').html('-'); function tampilangka(id) { - + $.ajax({ type: 'POST', dataType: 'json', @@ -270,27 +245,27 @@ function tampilangka(id) { $('#btnNext').on('click', function () { - - actionqueue(noantrian + 1, 20,id); - loadantrian() + + actionqueue(noantrian + 1, 20, id); + loadantrian(id) }); $('#btnCall').on('click', function () { - actionqueue(noantrian, 30,id); - + actionqueue(noantrian, 30, id); + }); $('#btnDone').on('click', function () { - actionqueue(noantrian, 50,id); - + actionqueue(noantrian, 50, id); + }); $('#btnMissed').on('click', function () { - actionqueue(noantrian, 60,id); - + actionqueue(noantrian, 60, id); + }); $('#btnServed').on('click', function () { - actionqueue(noantrian, 40,id); - + actionqueue(noantrian, 40, id); + }); @@ -317,7 +292,7 @@ function actionqueue(antrianno, status, iddok) { html: true, type: "warning" }); - + return false; } @@ -345,18 +320,20 @@ function actionqueue(antrianno, status, iddok) { var flush = new Audio('../../data/tone/a1.mp3'); - - setTimeout(function() { - flush.play(); }, ) - - flush.onended = function() { - textToAudio() - - setTimeout(function() { - textToAudioRuang() }, 3000) - }; - - swal({ + + setTimeout(function () { + flush.play(); + }) + + flush.onended = function () { + textToAudio() + + setTimeout(function () { + textToAudioRuang() + }, 3000) + }; + + swal({ title: "Call!", text: "Sedang Melakukan Panggilan", type: "success", diff --git a/public/action-js/antrian-js/action-cekdatapasien.js b/public/action-js/antrian-js/action-cekdatapasien.js index 67b39c1f0cb55b7954794108a0c3af62b8ed7428..35e237d1ea26bf509281d6c8d60016c75990a0c9 100644 --- a/public/action-js/antrian-js/action-cekdatapasien.js +++ b/public/action-js/antrian-js/action-cekdatapasien.js @@ -38,53 +38,14 @@ function cekpasien(no_rekam_medis) { console.log(result); 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) { 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 $encodedId = btoa($id); - 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 }); + let $id = result.data['datapasien'][0]['id_pasien']; + let $encodedId = btoa($id); + window.location.href = ("datapasien/" + $encodedId); } }, @@ -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; - }); -}) + diff --git a/public/action-js/antrian-js/action-datapasien.js b/public/action-js/antrian-js/action-datapasien.js index 0dce72a0694d2550fbccad5f6e9d39e2f2e79fdb..22556ffa1ac7a66ddfdb9a3d971321824ed979b5 100644 --- a/public/action-js/antrian-js/action-datapasien.js +++ b/public/action-js/antrian-js/action-datapasien.js @@ -44,15 +44,15 @@ function loadsisaantrian() { let dokter = $('#dokter option:selected').attr("value"); let no_antrian = $("input[name=antrian]:checked").val(); var sisa_antrian; - - console.log(dokter); - console.log(no_antrian); + + // console.log(dokter); + // console.log(no_antrian); $.ajax({ type: 'POST', dataType: 'json', url: baseURL + '/api/loadsisaantrian', - async: false, - data: { + async: false, + data: { id: dokter, no: no_antrian, }, @@ -64,11 +64,11 @@ function loadsisaantrian() { if (result.code == 0) { let data = result.data; - - console.log(data[0].count); + + // console.log(data[0].count); sisa_antrian = data[0].count; // $('#sisa_antrian').val(data[0].count); - + } else { alert(result.info); @@ -121,7 +121,7 @@ function savedataaja() { ipoli: poli, idokter: dokter, ino_antrian: no_antrian, - isisa_antrian :sisa_antrian, + isisa_antrian: sisa_antrian, }, success: function (response) { @@ -155,7 +155,7 @@ function savedataaja() { loadpoli(); $('#poli').on('change', function () { var idpoli = $('#poli').val(); - console.log(idpoli); + // console.log(idpoli); $.ajax({ type: 'POST', dataType: 'json', @@ -176,20 +176,7 @@ $('#poli').on('change', function () { $("select#dokter").removeAttr('disabled'); $("select#dokter").html(optionseg); } else { - bootbox.dialog({ - 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'); - } - } - } - }); + bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); } } }); @@ -214,190 +201,250 @@ function loadpoli() { $("select#poli").html(optionseg); } else { - bootbox.dialog({ - 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'); - } + bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); + } + } + }); +} +// 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 () { - pilihAntrian() +$('#pilihno').on('click', function (e) { + 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({ type: 'POST', dataType: 'json', url: baseURL + '/api/loadPilihAntrian', data: { - iddok: $dokter, + iddok: dokter, + id_poli: id_poli, + }, success: function (response) { - // console.log(response.data); + var $antrian = (response.data); - // console.log($antrian); - // console.log(response); - if ($antrian) { - var hour = 0; + // console.log(validasipasien(id_poli, dokter, id_pasien) == 1); + + 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) { + var hour = 0; - var splithour = []; - splithour[0] = $antrian[0]['jam_mulai'].split(':'); + var splithour = []; + splithour[0] = $antrian[0]['jam_mulai'].split(':'); - hour += parseInt(splithour[0][0]); - minute = parseInt(splithour[0][1]); + hour += parseInt(splithour[0][0]); + minute = parseInt(splithour[0][1]); - $('.antrian').empty(); + $('.antrian').empty(); - for (var i = 0; i < $antrian.length; i++) { - if ($antrian[i]['id_pasien'] === null) {//jika masih kosong - let y = ''; + for (var i = 0; i < $antrian.length; i++) { + var A = Date.now(); + if ($antrian[i]['id_pasien'] === null) {//jika masih kosong + let y = ' '; - var splittime = []; - splittime[i] = $antrian[i]['waktu_antrian'].split(':'); + var splittime = []; + splittime[i] = $antrian[i]['waktu_antrian'].split(':'); - if (minute >= 60) { - hour += Math.floor(minute / 60); - minute = minute % 60; - } - if(hour >=24){ - hour=0; - } + if (minute >= 60) { + hour += Math.floor(minute / 60); + minute = minute % 60; + } + if (hour >= 24) { + hour = 0; + } - if (minute.toString().length === 1) { - y += `<div class="col-lg-1"> + if (minute.toString().length === 1) { + y += `<div class="col-lg-1"> <div class="buttons" > <input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> <label style="display: block;text-align: center; line-height: 150%;"` + i + `">` + hour + ':' + '0' + minute + `</label> </div> </div > `; - $('.antrian').append(y); - } else { - y += `<div class="col-lg-1"> + $('.antrian').append(y); + } else { + y += `<div class="col-lg-1"> <div class="buttons" > <input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> <label style="display: block;text-align: center; line-height: 150%;"` + i + `">` + hour + ':' + minute + `</label> </div> </div > `; - $('.antrian').append(y); - } + $('.antrian').append(y); + } - minute += parseInt(splittime[i][1]); + minute += parseInt(splittime[i][1]); - } else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) {//jika antrian sudah terisi - var splittime = []; - splittime[i] = $antrian[i]['waktu_antrian'].split(':'); - let y = ''; + } else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) {//jika antrian sudah terisi + var splittime = []; + splittime[i] = $antrian[i]['waktu_antrian'].split(':'); + let y = ''; - if (minute >= 60) { - - hour += Math.floor(minute / 60); - minute = minute % 60; + if (minute >= 60) { + hour += Math.floor(minute / 60); + minute = minute % 60; - } - if(hour >=24){ - hour=0; - } + } - if (minute.toString().length === 1) { - y += `<div class="col-lg-1"> + if (hour >= 24) { + hour = 0; + } + + if (minute.toString().length === 1) { + y += `<div class="col-lg-1"> <div class="buttons" > <input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> <label style="display: block;text-align: center; line-height: 150%;" for="antrian` + i + `">` + hour + ':' + '0' + minute + `</label> </div> </div > `; - $('.antrian').append(y); - } else { - y += `<div class="col-lg-1"> + $('.antrian').append(y); + } else { + y += `<div class="col-lg-1"> <div class="buttons" > <input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> <label style="display: block;text-align: center; line-height: 150%;" for="antrian` + i + `">` + hour + ':' + minute + `</label> </div> </div > `; - $('.antrian').append(y); - } + $('.antrian').append(y); + } - minute += parseInt(splittime[i][1]); - } - else if ($antrian[i]['status_code'] == 60) { + minute += parseInt(splittime[i][1]); + } + else if ($antrian[i]['status_code'] == 60) { - let y = ''; - y += `<div class="col-lg-1"> + let y = ''; + y += `<div class="col-lg-1"> <div class="buttons" > <input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> </div> </div > `; - $('.antrian').append(y); - } else if ($antrian[i]['status_code'] == 50) { + $('.antrian').append(y); + } else if ($antrian[i]['status_code'] == 50) { - var splittime = []; - splittime[i] = $antrian[i]['waktu_antrian'].split(':'); + var splittime = []; + splittime[i] = $antrian[i]['waktu_antrian'].split(':'); - if (minute >= 60) { - hour += Math.floor(minute / 60); - minute = minute % 60; - - } - if(hour >=24){ - hour=0; - } + if (minute >= 60) { + hour += Math.floor(minute / 60); + minute = minute % 60; - let y = ''; - y += `<div class="col-lg-1"> + } + if (hour >= 24) { + hour = 0; + } + + let y = ''; + y += `<div class="col-lg-1"> <div class="buttons" > <input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" /> <label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label> </div> </div > `; - $('.antrian').append(y); + $('.antrian').append(y); - minute += parseInt(splittime[i][1]); - } + minute += parseInt(splittime[i][1]); + } - } - } else { + } + } else { + } } + + + + }, error: function (xhr) { diff --git a/public/action-js/antrian-js/action-kelolaantrianunreg.js b/public/action-js/antrian-js/action-kelolaantrianunreg.js index 8f7a23b9013e5e64aba27ea2688d0479a6077ada..f47aa2b14e437a7715100e4e7cb76dd92dcce871 100644 --- a/public/action-js/antrian-js/action-kelolaantrianunreg.js +++ b/public/action-js/antrian-js/action-kelolaantrianunreg.js @@ -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_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); newRow.append(cols); @@ -89,7 +89,7 @@ function unregister(id_pasien) { if (result.code == 0) { swal({ title: "", - text: "Data Berhasil Diupdate!", + text: "Data Berhasil Direset!", icon: "succes", button: "ok", }, function () { @@ -99,7 +99,7 @@ function unregister(id_pasien) { } else { swal({ title: "", - text: "Data Gagal Diupdate!", + text: "Data Gagal Direset!", icon: "succes", button: "ok", }); diff --git a/public/action-js/antrian-js/action-keloladokter.js b/public/action-js/antrian-js/action-keloladokter.js index 29e6e4eef0fee90b2927b496f5e92c0cbe7efbfa..260ba002bc149181c51c16b4fd1148dbdf6fd733 100644 --- a/public/action-js/antrian-js/action-keloladokter.js +++ b/public/action-js/antrian-js/action-keloladokter.js @@ -24,20 +24,7 @@ function loadpoli() { $("select#poli").html(optionseg); } else { - bootbox.dialog({ - 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'); - } - } - } - }); + bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); } } }); @@ -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_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 "> <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); $("#tabledokter").append(newRow); @@ -98,11 +86,12 @@ function Loaddokter() { paging: true, columnDefs: [ { width: 30, targets: 0 }, - { width: 155, targets: 1 }, - { width: 155, targets: 2 }, - { width: 155, targets: 3 }, - { width: 155, targets: 4 }, + { width: 120, targets: 1 }, + { width: 120, targets: 2 }, + { width: 120, targets: 3 }, + { width: 120, targets: 4 }, { width: 90, targets: 5 }, + { width: 90, targets: 6 }, ], }); @@ -211,8 +200,8 @@ function validasigambar() { $('#tambahmodal').on('click', function () { loadpoli() - }) + $('#tambah').on('click', function () { let nama_dokter = $('#nama_dokter').val(); let kode_dokter = $('#kode_dokter').val(); @@ -249,7 +238,7 @@ $('#tambah').on('click', function () { } else if (validasigambar() == 1) { - bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); + bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true }); } else { savedokter() } @@ -325,7 +314,7 @@ $('#edit').on('click', function () { let nama_dokter = $('#nama_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val(); 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 == "") { @@ -340,19 +329,20 @@ $('#edit').on('click', function () { bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true }); return false; } - else if (fileupload == null) { - bootbox.alert({ message: 'Gambar dokter tidak boleh kosong', centerVertical: true }); - return false; - } - else if (validasidokter(poli, nama_dokter, kode_dokter) == 3) { + + else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) { 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 }); - } - else if (validasigambar() == 2) { - bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); + + } else if (validasigambar() == 2) { + if (fileupload == null || fileupload == '') { + editdatadokter(id_dokter); + } else { + bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true }); + } } else { editdatadokter(id_dokter) } @@ -362,7 +352,7 @@ $('#edit').on('click', function () { }) function editdatadokter(id_dokter) { let poli = $("#poliedt option:selected").attr("value"); - let condition = $("#condition option:selected").attr("value"); + let nama_dokter = $('#nama_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val(); const fileupload = $('#gambar_dokteredt').prop('files')[0]; @@ -373,7 +363,7 @@ function editdatadokter(id_dokter) { formData.append('inama_dokter', nama_dokter); formData.append('ikode_dokter', kode_dokter); formData.append('ipoli', poli); - formData.append('icondition', condition); + formData.append('fileupload', fileupload); // set file ke tipe data binary @@ -468,14 +458,6 @@ function loadedit(id_dokter) { $("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(); - }); @@ -560,4 +542,36 @@ 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 diff --git a/public/action-js/antrian-js/action-kelolapasien.js b/public/action-js/antrian-js/action-kelolapasien.js index 90cd07d12badf7399fbe810f716ac72b44889379..1a6d81a50fa5f53d5d32505fc8b5ea5cf8b84891 100644 --- a/public/action-js/antrian-js/action-kelolapasien.js +++ b/public/action-js/antrian-js/action-kelolapasien.js @@ -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].no_hp + '</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); newRow.append(cols); diff --git a/public/action-js/antrian-js/action-kelolapoli.js b/public/action-js/antrian-js/action-kelolapoli.js index 1e55881f1c59bce6f07f11bdcb8bea72cba543c7..ca948cd257ea003f9563b0a846464cd2ea0827c8 100644 --- a/public/action-js/antrian-js/action-kelolapoli.js +++ b/public/action-js/antrian-js/action-kelolapoli.js @@ -26,7 +26,6 @@ function Loadpoli() { let data = result.data; let counter = 1; - for (x in data) { // console.log(data); @@ -39,7 +38,7 @@ function Loadpoli() { 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].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>' //newRow.append(cols); $("#tablepoli").append(cols); @@ -114,7 +113,7 @@ $('#tambah').on('click', function (e) { bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true }); } else if (validasigambar() == 1) { - bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); + bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true }); } else { savedatapoli(); } @@ -217,7 +216,10 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { var data = result.data; console.log(data) - var counter = 0; + var counternama = 0; + var counterkode = 0; + var counterdesk = 0; + var counterimage = 0; for (x in data) { @@ -235,27 +237,27 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { exist = 4; } if (nama_poli == data[x]['nama_poli']) { - counter += 1; - if (counter > 1) { + counternama += 1; + if (counternama > 1) { exist = 5; } } if (kode_poli == data[x]['kode_poli']) { - counter += 1; - if (counter > 1) { + counterkode += 1; + if (counterkode > 1) { exist = 6; } } if (deskripsi_poli == data[x]['deskripsi_poli']) { - counter += 1; - if (counter > 1) { + counterdesk += 1; + if (counterdesk > 1) { exist = 7; } } if (fileupload == data[x]['image_poli']) { - counter += 1; - if (counter > 1) { + counterimage += 1; + if (counterimage > 1) { exist = 8; } } @@ -281,6 +283,7 @@ $('#edit').on('click', function () { let kode_poli = $('#kode_poliEdt').val(); let deskripsi_poli = $('#deskripsi_poliEdt').val(); const fileupload = $('#gambar_poliedt').prop('files')[0]; + console.log(fileupload); if (nama_poli == null || nama_poli == "") { bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true }); @@ -294,10 +297,7 @@ $('#edit').on('click', function () { bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true }); return false; } - else if (fileupload == null) { - bootbox.alert({ message: ' Gambar tidak boleh kosong', centerVertical: true }); - return false; - } + else if (kode_poli.toString().length > 5) { bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true }); return false; @@ -311,11 +311,15 @@ $('#edit').on('click', function () { else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) { 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 }); } 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 { editdatapoli(id_poli) diff --git a/public/action-js/antrian-js/action-kelolaruang.js b/public/action-js/antrian-js/action-kelolaruang.js index 84ff7a93caf29449e0c19cebd196b27799acec34..a1e0769638baed53647821f345a4af0e00e0407b 100644 --- a/public/action-js/antrian-js/action-kelolaruang.js +++ b/public/action-js/antrian-js/action-kelolaruang.js @@ -82,7 +82,7 @@ function Loadruang() { 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); $("#tableruang").append(newRow); @@ -288,7 +288,7 @@ function editdataruang(id_ruang) { let poli = $("#poliedt option:selected").attr("value"); let nama_ruang = $('#nama_ruangedt').val(); let lantai = $('#lantaiedt').val(); - let condition = $("#condition option:selected").attr("value"); + $.ajax({ type: 'POST', @@ -299,7 +299,6 @@ function editdataruang(id_ruang) { inama_ruang: nama_ruang, ipoli: poli, ilantai: lantai, - icondition: condition, }, @@ -389,15 +388,6 @@ function loadedit(id_ruang) { $("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) { success: function (result) { // console.log(result); let nama_ruang = result.data[0].nama_ruang; + let lantai = result.data[0].lantai; swal({ - title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ", + title: "Apakah yakin mengahapus ruang '" + nama_ruang + " ' lantai '" + lantai + "'? ", type: "error", confirmButtonClass: "btn-danger", confirmButtonText: "Yes!", @@ -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 diff --git a/public/action-js/antrian-js/action-registrasidokter.js b/public/action-js/antrian-js/action-registrasidokter.js index 00c4a63fb3a27152c778a89db52b2cf95bb4461e..9b65d547613e82930b0d797635cb550b65ea48f8 100644 --- a/public/action-js/antrian-js/action-registrasidokter.js +++ b/public/action-js/antrian-js/action-registrasidokter.js @@ -154,19 +154,17 @@ function reset() { } LoadDadta(); -function LoadDadta(id) { +function LoadDadta() { /* save data */ $.ajax({ type: 'POST', dataType: 'json', url: baseURL + '/api/loadantrianregister', - data: { - id: id, - }, + success: function (result) { - // console.log(result); + console.log(result); $('table.table-bordered > tbody').empty(); // console.log(result); @@ -188,12 +186,12 @@ function LoadDadta(id) { cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_all + '</td>'; - cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_awal + '</td>'; - cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_akhir + '</td>'; + cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].jam_mulai + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].waktu_antrian + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>'; - cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="width:80px;height:30;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_register + ')">Edit</span><span style="width:80px;height:30;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_register + ')">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_register + ')">Edit</span> <span style="padding: 7px;" class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_register + ')">Hapus</span></div></td>'; cols += '</tr>' @@ -216,13 +214,12 @@ function LoadDadta(id) { { width: 20, targets: 0 }, { width: 100, targets: 1 }, { width: 100, targets: 2 }, - { width: 80, targets: 3 }, - { width: 30, targets: 4 }, - { width: 30, targets: 5 }, - { width: 30, targets: 6 }, - { width: 30, targets: 7 }, - { width: 90, targets: 8 }, - { width: 90, targets: 9 }, + { width: 50, targets: 3 }, + { width: 50, targets: 4 }, + { width: 50, targets: 5 }, + { width: 50, targets: 6 }, + { width: 50, targets: 7 }, + { width: 100, targets: 8 }, ], }); @@ -252,10 +249,10 @@ function SaveDataRegister(param) { let poli = $('#poli option:selected').attr("value"); let dokter = $('#dokter option:selected').attr("value"); let antrian_all = $('#antrian_all').val(); - let antrian_awal = $('#antrian_awal').val(); - let antrian_akhir = $('#antrian_akhir').val(); let waktu_antrian = $('#waktu_antrian').val(); let jam_mulai = $('#jam_mulai').val(); + + if (ruang == null || ruang == "") { swal({ title: "", @@ -273,22 +270,8 @@ function SaveDataRegister(param) { button: "ok", }); return false; - } else if (antrian_awal == null || antrian_awal == "") { - swal({ - title: "", - text: "Field antrian awal is empty!", - icon: "error", - button: "ok", - }); - return false; - } else if (antrian_akhir == null || antrian_akhir == "") { - swal({ - title: "", - text: "Field antrian akhir is empty!", - icon: "error", - button: "ok", - }); - return false; + + } else if (waktu_antrian == null || waktu_antrian == "") { swal({ title: "", @@ -315,40 +298,7 @@ function SaveDataRegister(param) { button: "ok", }); return false; - } else if (parseInt(antrian_akhir) < parseInt(antrian_awal)) { - if (parseInt(antrian_akhir) < parseInt(antrian_awal)) { - swal({ - title: "", - text: "antrian awal tidak boleh lebih besar dari antrian akhir!", - icon: "error", - button: "ok", - }); - return false; - } else if (parseInt(antrian_akhir) > parseInt(antrian_all)) { - swal({ - title: "", - text: "antrian akhir tidak boleh lebih besar dari antrian seluruh!", - icon: "error", - button: "ok", - }); - return false; - } - } else if (parseInt(antrian_akhir) > parseInt(antrian_all)) { - swal({ - title: "", - text: "antrian akhir tidak boleh lebih besar dari antrian all!", - icon: "error", - button: "ok", - }); - return false; - } else if (parseInt(antrian_awal) == parseInt(antrian_akhir)) { - swal({ - title: "", - text: "antrian akhir tidak boleh sama dengan antrian awal!", - icon: "error", - button: "ok", - }); - return false; + } else if (parseInt(antrian_all) > 30) { swal({ @@ -367,15 +317,6 @@ function SaveDataRegister(param) { }); return false; } - else if (parseInt(antrian_awal) < 5) { - swal({ - title: "", - text: "antrian mobile dimulai dari 5! ", - icon: "error", - button: "ok", - }); - return false; - } /* save data */ $.ajax({ @@ -386,8 +327,6 @@ function SaveDataRegister(param) { iruang: ruang, id: param, iantrian_all: antrian_all,//variable json diisi oleh variable yang menyimpan data inputan - iantrian_awal: antrian_awal, - iantrian_akhir: antrian_akhir, iwaktu_antrian: waktu_antrian, ipoli: poli, idokter: dokter, @@ -408,7 +347,6 @@ function SaveDataRegister(param) { html: true, type: "success" }, function () { - location.reload(); }); // loadpoli(); @@ -421,7 +359,7 @@ function SaveDataRegister(param) { icon: "succes", button: "ok", }); - bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); + // bootbox.alert({ message: 'Gagal', centerVertical: true }); } }, @@ -455,21 +393,10 @@ function editregister(id_register) { let poli = $('#poli option:selected').attr("value"); let dokter = $('#dokter option:selected').attr("value"); let antrian_all = $('#antrian_alledt').val(); - let antrian_awal = $('#antrian_awaledt').val(); - let antrian_akhir = $('#antrian_akhiredt').val(); let waktu_antrian = $('#waktu_antrianedt').val(); let jam_mulai = $('#jam_mulaiedt').val(); - // if (ruang == null || ruang == "") { - // swal({ - // title: "", - // text: "Field ruang is empty!", - // icon: "error", - // button: "ok", - // }); - // return false; - // } if (antrian_all == null || antrian_all == "") { swal({ title: "", @@ -478,22 +405,8 @@ function editregister(id_register) { button: "ok", }); return false; - } else if (antrian_awal == null || antrian_awal == "") { - swal({ - title: "", - text: "Field antrian awal is empty!", - icon: "error", - button: "ok", - }); - return false; - } else if (antrian_akhir == null || antrian_akhir == "") { - swal({ - title: "", - text: "Field antrian akhir is empty!", - icon: "error", - button: "ok", - }); - return false; + + } else if (waktu_antrian == null || waktu_antrian == "") { swal({ title: "", @@ -503,59 +416,9 @@ function editregister(id_register) { }); return false; } - // else if (poli == null || poli == "") { - // swal({ - // title: "", - // text: "Field poli is empty!", - // icon: "error", - // button: "ok", - // }); - // return false; - // } - // else if (dokter == null || dokter == "") { - // swal({ - // title: "", - // text: "Field dokter is empty!", - // icon: "error", - // button: "ok", - // }); - // return false; - // } - else if (parseInt(antrian_akhir) < parseInt(antrian_awal)) { - if (parseInt(antrian_akhir) < parseInt(antrian_awal)) { - swal({ - title: "", - text: "antrian awal tidak boleh lebih besar dari antrian akhir!", - icon: "error", - button: "ok", - }); - return false; - } else if (parseInt(antrian_akhir) > parseInt(antrian_all)) { - swal({ - title: "", - text: "antrian akhir tidak boleh lebih besar dari antrian seluruh!", - icon: "error", - button: "ok", - }); - return false; - } - } else if (parseInt(antrian_akhir) > parseInt(antrian_all)) { - swal({ - title: "", - text: "antrian akhir tidak boleh lebih besar dari antrian all!", - icon: "error", - button: "ok", - }); - return false; - } else if (parseInt(antrian_awal) == parseInt(antrian_akhir)) { - swal({ - title: "", - text: "antrian akhir tidak boleh sama dengan antrian awal!", - icon: "error", - button: "ok", - }); - return false; - } + + + else if (parseInt(antrian_all) > 30) { swal({ title: "", @@ -573,16 +436,6 @@ function editregister(id_register) { }); return false; } - else if (parseInt(antrian_awal) < 5) { - swal({ - title: "", - text: "antrian mobile dimulai dari 5! ", - icon: "error", - button: "ok", - }); - return false; - } - $.ajax({ type: 'POST', @@ -595,8 +448,7 @@ function editregister(id_register) { idokter: dokter, iruang: ruang, iantrial_all: antrian_all, - iantrian_awal: antrian_awal, - iantrian_akhir: antrian_akhir, + iwaktu_antrian: waktu_antrian, ijam_mulai: jam_mulai, }, @@ -643,8 +495,8 @@ function editregister(id_register) { }); } - -function loadedit(param) { +loadedit() +function loadedit(id_register) { /* save data */ $.ajax({ @@ -652,10 +504,10 @@ function loadedit(param) { dataType: 'json', url: baseURL + '/api/loadantrianregister', data: { - id: param, + id: id_register, }, success: function (result) { - // console.log(result); + // console.log(result.code); // $('.loaddata').empty(); // console.log(result); @@ -667,24 +519,23 @@ function loadedit(param) { optdok = `<p class="card-text">` + data[0].nama_dokter + `</p>` optpol = `<p class="card-text">` + data[0].nama_poli + `</p>` optrua = `<p class="card-text">` + data[0].nama_ruang + `</p>` - + // console.log(data[0].nama_poli); $('#id_register').val(data[0].id_register); $('#poliedt').html(optpol); $('#dokteredt').html(optdok); $('#ruangedt').html(optrua); - // console.log(data[0].id_dokter); + $('#antrian_alledt').val(data[0].antrian_all); - $('#antrian_awaledt').val(data[0].antrian_awal); - $('#antrian_akhiredt').val(data[0].antrian_akhir); + $('#jam_mulaiedt').val(data[0].jam_mulai); $('#waktu_antrianedt').val(data[0].waktu_antrian); } else { - bootbox.alert({ message: 'Data Kosong', centerVertical: true }); + // bootbox.alert({ message: 'Data Kosong', centerVertical: true }); } }, diff --git a/public/tamplateadmin/js/demo/chart-pie-demo.js b/public/tamplateadmin/js/demo/chart-pie-demo.js index c22cf704f79feddb98852ac6351edfd4a4d9c052..0f3ecc091fa394ad990ae00df14e7a772ef5f052 100644 --- a/public/tamplateadmin/js/demo/chart-pie-demo.js +++ b/public/tamplateadmin/js/demo/chart-pie-demo.js @@ -10,7 +10,7 @@ function loadpoli() { $.ajax({ type: 'POST', dataType: 'json', - url: baseURL + '/api/loadRegisterPoli', + url: baseURL + '/api/loadPoli', success: function (result) { @@ -29,17 +29,17 @@ function loadpoli() { $("#poli").append(y); } else { - alert(result.info); + // alert(result.info); } }, - error: function (xhr) { - alert(xhr.status + '-' + xhr.statusText); - } + // error: function (xhr) { + // alert(xhr.status + '-' + xhr.statusText); + // } }); } $(document).ready(function () { - loadChart(9) + loadChart(12) }); function loadChart(id) { @@ -120,7 +120,7 @@ function loadChart(id) { }); - bootbox.alert({ message: 'Data Kosong', centerVertical: true }); + // bootbox.alert({ message: 'Data Kosong', centerVertical: true }); } },