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

baru dra v1.6

parent da8aceac
...@@ -103,6 +103,22 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -103,6 +103,22 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; return $view;
} }
public function registrasialldokAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-registrasialldok.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianterlewatAction() public function antrianterlewatAction()
......
...@@ -218,7 +218,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -218,7 +218,6 @@ class ApiController extends \Application\Master\GlobalActionController {
$dataArrayAntrianPasien = array ( $dataArrayAntrianPasien = array (
'id_pasien' => $id, 'id_pasien' => $id,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama, 'nama' => $nama,
'tempat_lahir' => $tempat_lahir, 'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir, 'tanggal_lahir' => $tanggal_lahir,
...@@ -284,11 +283,9 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -284,11 +283,9 @@ class ApiController extends \Application\Master\GlobalActionController {
$poli = $post->ipoli; $poli = $post->ipoli;
$dokter = $post->idokter; $dokter = $post->idokter;
$antrian_all = $post->iantrian_all; $antrian_all = $post->iantrian_all;
$antrian_awal = $post->iantrian_awal;
$antrian_akhir = $post->iantrian_akhir;
$waktu_antrian = $post->iwaktu_antrian; $waktu_antrian = $post->iwaktu_antrian;
$jam_mulai = $post->ijam_mulai; $jam_mulai = $post->ijam_mulai;
// print_r($antrian_all); die;
$array = array(); $array = array();
...@@ -301,8 +298,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -301,8 +298,6 @@ class ApiController extends \Application\Master\GlobalActionController {
'id_poli' => $poli, 'id_poli' => $poli,
'id_dokter' => $dokter, 'id_dokter' => $dokter,
'antrian_all' => $antrian_all, 'antrian_all' => $antrian_all,
'antrian_awal' => $antrian_awal,
'antrian_akhir' => $antrian_akhir,
'waktu_antrian' => $waktu_antrian, 'waktu_antrian' => $waktu_antrian,
'id_condition' =>1, 'id_condition' =>1,
'jam_mulai' => $jam_mulai, 'jam_mulai' => $jam_mulai,
...@@ -313,8 +308,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -313,8 +308,6 @@ class ApiController extends \Application\Master\GlobalActionController {
$dataArrayRegisterAntrian= array ( $dataArrayRegisterAntrian= array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'antrian_all' => $antrian_all, 'antrian_all' => $antrian_all,
'antrian_awal' => $antrian_awal,
'antrian_akhir' => $antrian_akhir,
'waktu_antrian' => $waktu_antrian, 'waktu_antrian' => $waktu_antrian,
'jam_mulai' => $jam_mulai, 'jam_mulai' => $jam_mulai,
); );
...@@ -362,64 +355,38 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -362,64 +355,38 @@ class ApiController extends \Application\Master\GlobalActionController {
$seqBefore2 = $param->getLastSeqPostgree($tb_antrian_pasien,'id_antrian'); $seqBefore2 = $param->getLastSeqPostgree($tb_antrian_pasien,'id_antrian');
//untuk load data id register di table antrian register lalu menambahkan pada table pasien //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;){
for ($noantrian=1; $noantrian <= $antrian_all;){
$dataArrayAntrianPasien = array ( $dataArrayAntrianPasien = array (
'id_register' => $seqAfter1->data['total'], 'id_register' => $seqAfter1->data['total'],
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'no_antrian' => $no_mob, 'no_antrian' => $noantrian,
'id_poli' => $poli, 'id_poli' => $poli,
'kode_antrian' => 2,
'id_dokter' => $dokter, 'id_dokter' => $dokter,
'id_ruang' => $ruang, 'id_ruang' => $ruang,
); );
$dataArrayAntrian = array ( $dataArrayAntrian = array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'no_antrian' => $no_mob, 'no_antrian' => $noantrian,
'kode_antrian' => 2,
);
);
$param->saveGlobal($dataArrayAntrianPasien, $tb_antrian_pasien); $param->saveGlobal($dataArrayAntrianPasien, $tb_antrian_pasien);
$param->saveGlobal($dataArrayAntrian, $tb_antrian); $param->saveGlobal($dataArrayAntrian, $tb_antrian);
$no_mob++; $noantrian++;
} }
$no_web=$antrian_akhir;
}else{
$dataArrayAntrianPasien = array (
'id_register' => $seqAfter1->data['total'],
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'no_antrian' => $no_web,
'id_poli' => $poli,
'kode_antrian' => 1,
'id_dokter' => $dokter,
'id_ruang' => $ruang,
);
$dataArrayAntrian = array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'no_antrian' => $no_web,
'kode_antrian' => 1,
);
$param->saveGlobal($dataArrayAntrianPasien, $tb_antrian_pasien);
$param->saveGlobal($dataArrayAntrian, $tb_antrian);
}
$no_web++;
}
$seqAfter2 = $param->getLastSeqPostgree($tb_antrian_pasien, 'id_antrian'); $seqAfter2 = $param->getLastSeqPostgree($tb_antrian_pasien, 'id_antrian');
...@@ -483,8 +450,33 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -483,8 +450,33 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $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){ if($load->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
...@@ -498,6 +490,8 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -498,6 +490,8 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function editdataregisterAction(){ public function editdataregisterAction(){
if($this->isLoggedIn()){ if($this->isLoggedIn()){
$result = new Result(); $result = new Result();
...@@ -516,10 +510,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -516,10 +510,7 @@ class ApiController extends \Application\Master\GlobalActionController {
try{ try{
$id_register = $post->id; $id_register = $post->id;
$antrian_all = $post->iantrial_all; $antrian_all = $post->iantrial_all;
$antrian_awal = $post->iantrian_awal;
$antrian_akhir = $post->iantrian_akhir;
$waktu_antrian = $post->iwaktu_antrian; $waktu_antrian = $post->iwaktu_antrian;
$jam_mulai = $post->ijam_mulai; $jam_mulai = $post->ijam_mulai;
...@@ -528,8 +519,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -528,8 +519,6 @@ class ApiController extends \Application\Master\GlobalActionController {
'antrian_all' =>$antrian_all, 'antrian_all' =>$antrian_all,
'antrian_awal' =>$antrian_awal,
'antrian_akhir' =>$antrian_akhir,
'waktu_antrian' =>$waktu_antrian, 'waktu_antrian' =>$waktu_antrian,
'jam_mulai' =>$jam_mulai, 'jam_mulai' =>$jam_mulai,
...@@ -566,8 +555,8 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -566,8 +555,8 @@ class ApiController extends \Application\Master\GlobalActionController {
// } // }
$load = $param->loadRegister($post->id); $load = $param->loadantrianregister($post->id);
// print_r($dataArrayRegister);die;
$table_register= 'register_dokter'; $table_register= 'register_dokter';
$where = 'id_register='.$id_register; $where = 'id_register='.$id_register;
// print_r ($where);die; // print_r ($where);die;
...@@ -599,7 +588,9 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -599,7 +588,9 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$tabel = 'antrian_pasien';
$where = 'id_register='.$post->id;
$res = $test->deleteGlobal($tabel, $where);
$tabel = 'register_dokter'; $tabel = 'register_dokter';
$where = 'id_register='.$post->id; $where = 'id_register='.$post->id;
$res = $test->deleteGlobal($tabel, $where); $res = $test->deleteGlobal($tabel, $where);
...@@ -726,8 +717,8 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -726,8 +717,8 @@ class ApiController extends \Application\Master\GlobalActionController {
try{ try{
$fileupload = $_FILES['fileupload']['tmp_name']; $fileupload = $_FILES['fileupload']['tmp_name'];
$id_poli = $post->id_poli;
$id_poli = $post->id_poli;
$nama_poli = $post->inama_poli; $nama_poli = $post->inama_poli;
$kode_poli = $post->ikode_poli; $kode_poli = $post->ikode_poli;
$deskripsi_poli = $post->ideskripsi_poli; $deskripsi_poli = $post->ideskripsi_poli;
...@@ -747,7 +738,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -747,7 +738,7 @@ class ApiController extends \Application\Master\GlobalActionController {
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){ if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
/* jika upload berhasil ke folder sever */ /* jika upload berhasil ke folder sever */
$dataArrayPoli = array ( $dataArrayPoli = array(
'nama_poli' => $nama_poli, 'nama_poli' => $nama_poli,
'image_poli' => $ImageName, 'image_poli' => $ImageName,
...@@ -764,7 +755,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -764,7 +755,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = 0; $result->code = 0;
$result->info = 'ok'; $result->info = 'ok';
$result->data = $load->data;
}else{ }else{
...@@ -774,7 +765,16 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -774,7 +765,16 @@ class ApiController extends \Application\Master\GlobalActionController {
}else{ }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 { ...@@ -952,11 +952,11 @@ class ApiController extends \Application\Master\GlobalActionController {
$fileupload = $_FILES['fileupload']['tmp_name']; $fileupload = $_FILES['fileupload']['tmp_name'];
$id_dokter = $post->id_dokter; $id_dokter = $post->id_dokter;
// print_r($id_dokter);die;
$nama_dokter = $post->inama_dokter; $nama_dokter = $post->inama_dokter;
$kode_dokter = $post->ikode_dokter; $kode_dokter = $post->ikode_dokter;
$poli = $post->ipoli; $poli = $post->ipoli;
$condition = $post->icondition;
if (!empty($fileupload)){ if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name']; $ImageName = $_FILES['fileupload']['name'];
...@@ -979,13 +979,14 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -979,13 +979,14 @@ class ApiController extends \Application\Master\GlobalActionController {
'nama_dokter' => $nama_dokter, 'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter, 'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli, 'id_poli' =>$poli,
'id_condition' =>$condition,
'image_dokter' => $ImageName, 'image_dokter' => $ImageName,
); );
$Dokter = array ( $Dokter = array (
'nama_dokter' => $nama_dokter, 'nama_dokter' => $nama_dokter,
...@@ -998,13 +999,11 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -998,13 +999,11 @@ class ApiController extends \Application\Master\GlobalActionController {
$table_dokter_to_poli= 'dokter_to_poli'; $table_dokter_to_poli= 'dokter_to_poli';
$where = 'id_dokter='.$id_dokter; $where = 'id_dokter='.$id_dokter;
$param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where); $param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where);
$table_dokter= 'dokter'; $table_dokter= 'dokter';
$where = 'id_dokter='.$id_dokter; $where = 'id_dokter='.$id_dokter;
$param->updateGlobal($table_dokter, $Dokter, $where); $param->updateGlobal($table_dokter, $Dokter, $where);
$result->code = 0; $result->code = 0;
...@@ -1018,7 +1017,33 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1018,7 +1017,33 @@ class ApiController extends \Application\Master\GlobalActionController {
}else{ }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 { ...@@ -1033,6 +1058,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function deletekeloladokterAction(){ public function deletekeloladokterAction(){
$result = new Result(); $result = new Result();
$request = $this->getRequest(); $request = $this->getRequest();
...@@ -1153,7 +1179,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1153,7 +1179,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$nama_ruang = $post->inama_ruang; $nama_ruang = $post->inama_ruang;
$poli = $post->ipoli; $poli = $post->ipoli;
$lantai = $post->ilantai; $lantai = $post->ilantai;
$condition = $post->icondition;
...@@ -1162,8 +1188,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1162,8 +1188,6 @@ class ApiController extends \Application\Master\GlobalActionController {
'nama_ruang' =>$nama_ruang, 'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli, 'id_poli' =>$poli,
'lantai' =>$lantai, 'lantai' =>$lantai,
'id_condition' =>$condition,
); );
$load = $param->loadkelolaruang($post->id); $load = $param->loadkelolaruang($post->id);
...@@ -1320,9 +1344,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1320,9 +1344,6 @@ class ApiController extends \Application\Master\GlobalActionController {
'tempat_lahir' =>$tempat_lahir, 'tempat_lahir' =>$tempat_lahir,
'alamat' =>$alamat, 'alamat' =>$alamat,
'no_hp' =>$no_hp, 'no_hp' =>$no_hp,
); );
...@@ -1376,6 +1397,108 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1376,6 +1397,108 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); 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(){ public function loadpasienAction(){
$result = new Result(); $result = new Result();
...@@ -1526,6 +1649,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1526,6 +1649,7 @@ class ApiController extends \Application\Master\GlobalActionController {
// $id = $this->_getParam($test->loadAntrian($post->id_poli)); // $id = $this->_getParam($test->loadAntrian($post->id_poli));
$load = $test->loadAntrian($post->id_poli); $load = $test->loadAntrian($post->id_poli);
// print_r($post->id_poli);die;
if($load->code == 0){ if($load->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
...@@ -1576,7 +1700,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1576,7 +1700,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$load = $poli->loadPoli($post->$id_poli); $load = $poli->loadPoli($post->$id_poli);
// print_r($post->$id_poli);die;
if($load->code == 0){ if($load->code == 0){
...@@ -1626,8 +1750,10 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1626,8 +1750,10 @@ class ApiController extends \Application\Master\GlobalActionController {
$iddokter = $post->iddok; $iddokter = $post->iddok;
$id_poli = $post->id_poli;
$load = $dokter->loadPilihAntrian($iddokter); // print_r($id_pasien);die;
$load = $dokter->loadPilihAntrian($iddokter, $id_poli);
$listdata = array(); $listdata = array();
...@@ -1648,6 +1774,34 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1648,6 +1774,34 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); 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(){ public function LoadAntrianAdminAction(){
$result = new Result(); $result = new Result();
...@@ -1808,7 +1962,6 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1808,7 +1962,6 @@ class ApiController extends \Application\Master\GlobalActionController {
$dataarray = array( $dataarray = array(
'id_pasien' => null, 'id_pasien' => null,
'create_date' => null,
'nama' => null, 'nama' => null,
'tempat_lahir' => null, 'tempat_lahir' => null,
'tanggal_lahir' => null, 'tanggal_lahir' => null,
......
...@@ -58,7 +58,7 @@ class UmumController extends \Application\Master\GlobalActionController ...@@ -58,7 +58,7 @@ class UmumController extends \Application\Master\GlobalActionController
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id_poli = "' . $decodeid . '"'); $this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js'); $this->headScript->appendFile('/action-js/tampilanantiran-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum"); $this->layout("layout/layoutUmum");
return $view; return $view;
......
...@@ -102,10 +102,15 @@ class Param extends Mapper { ...@@ -102,10 +102,15 @@ class Param extends Mapper {
return $data; return $data;
} }
public function loadRegister($id = null){ public function loadantrianregister($id = null){
$data = $this->_storage->loadRegisterAntrianData($id); $data = $this->_storage->loadantrianregister($id);
return $data; return $data;
} }
public function loadantrianregisterall($id = null){
$data = $this->_storage->loadantrianregisterall($id);
return $data;
}
public function loadkelolapoli($id = null){ public function loadkelolapoli($id = null){
$data = $this->_storage->loadkelolapoli($id); $data = $this->_storage->loadkelolapoli($id);
return $data; return $data;
...@@ -138,8 +143,12 @@ class Param extends Mapper { ...@@ -138,8 +143,12 @@ class Param extends Mapper {
$data = $this->_storage->loadantrianunregis($id); $data = $this->_storage->loadantrianunregis($id);
return $data; return $data;
} }
public function loadPilihAntrian($iddok = null){ public function loadPilihAntrian($iddok = null , $id_poli= null ){
$data = $this->_storage->loadPilihAntrian($iddok); $data = $this->_storage->loadPilihAntrian($iddok, $id_poli);
return $data;
}
public function valpilihAntrian($id_pasien = null ){
$data = $this->_storage->valpilihAntrian($id_pasien);
return $data; return $data;
} }
public function loadDokter($id = null){ public function loadDokter($id = null){
......
...@@ -322,13 +322,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -322,13 +322,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 FROM antrian_pasien
INNER JOIN dokter_to_poli INNER JOIN dokter_to_poli
ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter
INNER JOIN poli INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_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); $stmt = $this->_db->query($sql);
...@@ -448,7 +449,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -448,7 +449,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql = " SELECT COUNT(id_pasien) $sql = " SELECT COUNT(id_pasien)
FROM antrian_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"; id_dokter =$id AND (status_code <> 50 and status_code <> 60) and no_antrian < $no";
...@@ -563,7 +564,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -563,7 +564,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
try { 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 $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 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 "; GROUP BY dp.id_dokter, ap.id_dokter ";
...@@ -602,7 +603,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -602,7 +603,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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; // print_r($sql);die;
...@@ -639,7 +640,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -639,7 +640,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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; // print_r($sql);die;
...@@ -676,8 +677,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -676,8 +677,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT count(status_code) FROM antrian_pasien $sql = " SELECT count(status_code) FROM antrian_pasien WHERE status_code = 50 and create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR' ";
WHERE status_code = 50 ";
// print_r($sql);die; // print_r($sql);die;
...@@ -714,7 +714,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -714,7 +714,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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; // print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
...@@ -752,11 +752,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -752,11 +752,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 $sql = " SELECT id_pasien, no_rekam_medis FROM pasien
LEFT JOIN antrian_pasien ap
ON ap.id_pasien = p.id_pasien
WHERE p.no_rekam_medis = '$no_rekam_medis' "; WHERE no_rekam_medis = '$no_rekam_medis' ";
// print_r($sql);die; // print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
...@@ -841,7 +839,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -841,7 +839,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT * FROM poli"; $sql = " SELECT * FROM poli
ORDER BY nama_poli ASC";
...@@ -996,11 +996,11 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -996,11 +996,11 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result; return $result;
} }
public function loadRegisterAntrianData($id = null){ public function loadantrianregister($id = null){
$result = new Result(); $result = new Result();
try { 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 FROM register_dokter
INNER JOIN poli INNER JOIN poli
ON register_dokter.id_poli = poli.id_poli ON register_dokter.id_poli = poli.id_poli
...@@ -1008,14 +1008,17 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1008,14 +1008,17 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
ON register_dokter.id_dokter = dokter_to_poli.id_dokter ON register_dokter.id_dokter = dokter_to_poli.id_dokter
INNER JOIN ruang INNER JOIN ruang
ON register_dokter.id_ruang = ruang.id_ruang ON register_dokter.id_ruang = ruang.id_ruang
Where register_dokter.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'
"; ";
if($id){ if($id){
$sql .= "WHERE register_dokter.id_register= $id AND register_dokter.id_register IS NOT NULL" ; $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"; $sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date";
// print_r($sql);die; // print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -1046,6 +1049,60 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1046,6 +1049,60 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; 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.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
";
if($id){
$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();
$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 loadkelolapasien($id = null){ public function loadkelolapasien($id = null){
$result = new Result(); $result = new Result();
try { try {
...@@ -1235,7 +1292,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1235,7 +1292,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON poli.id_poli = antrian_pasien.id_poli ON poli.id_poli = antrian_pasien.id_poli
...@@ -1243,7 +1300,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1243,7 +1300,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter
INNER JOIN counter_status INNER JOIN counter_status
ON counter_status.status_code = antrian_pasien.status_code 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 { ...@@ -1285,13 +1342,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 INNER JOIN poli
on poli.id_poli = antrian_pasien.id_poli on poli.id_poli = antrian_pasien.id_poli
INNER JOIN dokter_to_poli INNER JOIN dokter_to_poli
on dokter_to_poli.id_dokter = antrian_pasien.id_dokter 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 ORDER BY poli.nama_poli asc
"; ";
...@@ -1333,7 +1391,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1333,7 +1391,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON poli.id_poli = antrian_pasien.id_poli ON poli.id_poli = antrian_pasien.id_poli
...@@ -1341,7 +1399,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1341,7 +1399,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter
INNER JOIN counter_status INNER JOIN counter_status
ON counter_status.status_code = antrian_pasien.status_code 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 { ...@@ -1383,23 +1441,23 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT poli.id_poli, poli.nama_poli $sql = " SELECT poli.id_poli, poli.nama_poli, antrian_pasien.create_date
FROM antrian_pasien FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_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); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -1612,18 +1670,18 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1612,18 +1670,18 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result; return $result;
} }
public function loadPilihAntrian($iddok ){ public function loadPilihAntrian($iddok, $id_poli){
$result = new Result(); $result = new Result();
try { try {
$sql = "SELECT antrian_pasien.no_antrian, antrian_pasien.id_pasien, register_dokter.waktu_antrian , register_dokter.jam_mulai, antrian_pasien.status_code $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 FROM antrian_pasien idd
INNER JOIN LEFT JOIN register_dokter rd
register_dokter on idd.id_register = rd.id_register
on antrian_pasien.id_dokter = register_dokter.id_dokter 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" ;
WHERE antrian_pasien.id_dokter= $iddok ORDER BY no_antrian ASC" ;
// print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -1631,7 +1689,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1631,7 +1689,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$listdata = array(); $listdata = array();
foreach($resdata as $val){ foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val); array_push($listdata, $val);
} }
...@@ -1656,11 +1714,55 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1656,11 +1714,55 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result; 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();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function loadAntrianAdmin($id = null){ public function loadAntrianAdmin($id = null){
$result = new Result(); $result = new Result();
try { 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 $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 FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON poli.id_poli = antrian_pasien.id_poli ON poli.id_poli = antrian_pasien.id_poli
...@@ -1670,10 +1772,12 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1670,10 +1772,12 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
ON counter_status.status_code = antrian_pasien.status_code ON counter_status.status_code = antrian_pasien.status_code
INNER JOIN ruang INNER JOIN ruang
on ruang.id_ruang = antrian_pasien.id_ruang on ruang.id_ruang = antrian_pasien.id_ruang
WHERE antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'
" ; " ;
if ($id){ 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,8 +1818,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1714,8 +1818,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
public function loadAntrian($id_poli){ public function loadAntrian($id_poli){
$result = new Result(); $result = new Result();
try { try {
$sql=" $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
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 FROM antrian_pasien idd
LEFT JOIN dokter_to_poli dok LEFT JOIN dokter_to_poli dok
...@@ -1727,14 +1830,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1727,14 +1830,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
LEFT JOIN counter_status cs LEFT JOIN counter_status cs
on cs.status_code = idd.status_code on cs.status_code = idd.status_code
WHERE idd.id_pasien is not null WHERE idd.id_pasien is not null AND idd.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'
and and
(cs.status_code=30 or cs.status_code =40) and (cs.status_code=30 or cs.status_code =40) and
idd.id_poli=$id_poli idd.id_poli=$id_poli
"; ";
// print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -1742,7 +1845,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1742,7 +1845,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$listdata = array(); $listdata = array();
foreach($resdata as $val){ foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val); array_push($listdata, $val);
} }
...@@ -1771,7 +1874,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1771,7 +1874,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { 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 FROM antrian_pasien
INNER JOIN counter_status INNER JOIN counter_status
ON counter_status.status_code = antrian_pasien.status_code ON counter_status.status_code = antrian_pasien.status_code
...@@ -1779,9 +1882,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1779,9 +1882,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter ON dokter_to_poli.id_dokter = antrian_pasien.id_dokter
INNER JOIN ruang INNER JOIN ruang
ON ruang.id_ruang = antrian_pasien.id_ruang ON ruang.id_ruang = antrian_pasien.id_ruang
" ; WHERE antrian_pasien.create_date > CURRENT_TIMESTAMP - INTERVAL '24 HOUR'" ;
if ($id){ 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); $stmt = $this->_db->query($sql);
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
<div><span style="visibility:hidden" id="nama_ruang"></span></div> <div><span style="visibility:hidden" id="nama_ruang"></span></div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="col-lg-6 "> <div class="col-lg-7 ">
<div class="card 0-hidden border-0 shadow-lg my-3"> <div class="card 0-hidden border-0 shadow-lg my-3">
<div class="card-header"> <div class="card-header">
<h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6>
</div> </div>
<div class="text-center content-group"> <div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div> <div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<h1 class="error-title" style=" font-weight: bold;font-size:250px;font-family: Times New Roman, Times, serif;color: #808080"><span id="no_antrian"></span></h1> <h1 class="error-title" style="padding-top: 48px; padding-bottom:47px; font-weight: bold;font-size:170px;font-family: Times New Roman, Times, serif;color: #808080"><span id="no_antrian"></span></h1>
</div> </div>
<div><input type="hidden" value="no_antrian" id="no_antrian" /></div> <div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<div class="col-lg-6 "> <div class="col-lg-5 ">
<div class="card 1-hidden border-1 shadow-lg my-3"> <div class="card 1-hidden border-1 shadow-lg my-3">
<div class="card-header"> <div class="card-header">
<h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6> <h6 class="panel-title"><i class="icon-cog3 position-left"></i> Nomor Antrian</h6>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<div class="card-header"> <div class="card-header">
<h1 class="panel-title " style="font-family: Times New Roman, Times, serif;text-align:center">Daftar Antrian Hari ini<a class="heading-elements-toggle"></a></h1> <h1 class="panel-title " style="font-family: Times New Roman, Times, serif;text-align:center">Daftar Antrian Hari ini<a class="heading-elements-toggle"></a></h1>
</div> </div>
<table class="table table-bordered"> <table class="table table-bordered" >
<thead class="bgHeader" style="border-top: 2px solid #ccc;"> <thead class="bgHeader" style="border-top: 2px solid #ccc;">
<tr> <tr>
<th style="width: 70px">NO</th> <th style="width: 70px">NO</th>
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
<th colspan="" class=" thLeftText">Nama Poli</th> <th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Kode Dokter</th> <th colspan="" class=" thLeftText">Kode Dokter</th>
<th colspan="" class=" thLeftText">Kondisi Dokter</th>
<th colspan="" class=" thLeftText">Gambar Dokter</th> <th colspan="" class=" thLeftText">Gambar Dokter</th>
<th colspan="" class=" thLeftText">Kondisi Dokter</th>
<th colspan="" class=" thLeftText">Action</th> <th colspan="" class=" thLeftText">Action</th>
</tr> </tr>
</thead> </thead>
...@@ -111,12 +111,7 @@ ...@@ -111,12 +111,7 @@
<label>Kode Dokter</label> <label>Kode Dokter</label>
<input type="input" id="kode_dokteredt" name="kode_dokter" class="form-control" required /></input> <input type="input" id="kode_dokteredt" name="kode_dokter" class="form-control" required /></input>
</div> </div>
<div class="form-group">
<label>Kondisi</label>
<select name="condition" id="condition" class="form-control" >
</select>
</div>
<div class="form-group " > <div class="form-group " >
<label>Gambar Dokter</label> <label>Gambar Dokter</label>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Edit Data Dokter</h4> <h4 class="modal-title">Edit Data Pasien</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
......
...@@ -109,12 +109,7 @@ ...@@ -109,12 +109,7 @@
<label>Ruangan</label> <label>Ruangan</label>
<input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input> <input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
</div> </div>
<div class="form-group">
<label>Kondisi</label>
<select name="condition" id="condition" class="form-control" >
</select>
</div>
<div class="modal-footer"> <div class="modal-footer">
<button button type="button" class="btn btn-primary" id="edit">Edit</button> <button button type="button" class="btn btn-primary" id="edit">Edit</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button> <button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
......
...@@ -4,24 +4,23 @@ ...@@ -4,24 +4,23 @@
<div class="col-xl-12 col-lg-12 col-md-12"> <div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5"> <div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body "> <div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Register Dokter</h1> <h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Jadwal Dokter</h1>
<button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button> <button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button>
<a type="button" class="btn btn-dark fa btn-lg" href="<?php echo $this->basePath('admin/registrasialldok') ?>"> Lihat Seluruh Antrian</a>
<br> <br>
<br> <br>
<table class="table table-bordered" id="dataTable"> <table class="table table-bordered" id="dataTable">
<thead> <thead>
<tr class="table-infos"> <tr class="table-infos">
<th style="">NO</th> <th style="">NO</th>
<th colspan="" class=" thLeftText">Nama Poli</th> <th >Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th >Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruangan</th> <th>Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th> <th >Antrian Seluruh</th>
<th colspan="" class=" thLeftText">Antrian Awal (mobile)</th> <th>Jam Mulai</th>
<th colspan="" class=" thLeftText">Antrian Akhir (mobile)</th> <th >Waktu Antrian</th>
<th colspan="" class=" thLeftText">Jam Mulai</th> <th >Tanggal Antrian</th>
<th colspan="" class=" thLeftText">Waktu Antrian</th> <th >Action</th>
<th colspan="" class=" thLeftText">Tanggal Antrian</th>
<th colspan="" class=" thLeftText">Action</th>
</tr> </tr>
</thead> </thead>
<tbody id="tableregisterdokter" > <tbody id="tableregisterdokter" >
...@@ -42,7 +41,7 @@ ...@@ -42,7 +41,7 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Tambah Data Register Dokter</h4> <h4 class="modal-title">Tambah Jadwal Dokter</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
...@@ -75,19 +74,6 @@ ...@@ -75,19 +74,6 @@
<input type="number" id="antrian_all" name="antrian_all" class="form-control" required /></input> <input type="number" id="antrian_all" name="antrian_all" class="form-control" required /></input>
</div> </div>
<div class="row col-lg-12">
<div class="form-group">
<label>Antrian Awal(mobile)</label>
<input style="width: 221px;" type="number" id="antrian_awal" name="antrian_awal" class="form-control" required /></input>
</div>
<div class="col-lg-6 sm-7">
<div class="form-group">
<label>Antrian Akhir(mobile)</label>
<input style="width: 230px;" type="number" id="antrian_akhir" name="antrian_akhir" class="form-control" required /></input>
</div>
</div>
</div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="form-group"> <div class="form-group">
<label>Waktu Mulai Antrian</label> <label>Waktu Mulai Antrian</label>
...@@ -125,13 +111,13 @@ ...@@ -125,13 +111,13 @@
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Edit Data Register Dokter</h4> <h4 class="modal-title">Edit Jadwal Dokter</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form id="myForm" > <form id="myForm" >
<input type="input" id="id_register" class="form-control" /></input> <input type="hidden" id="id_register" class="form-control" /></input>
<div class="form-group"> <div class="form-group">
<label>Nama Poli</label> <label>Nama Poli</label>
...@@ -162,19 +148,7 @@ ...@@ -162,19 +148,7 @@
<input type="number" id="antrian_alledt" name="antrian_all" class="form-control" required /></input> <input type="number" id="antrian_alledt" name="antrian_all" class="form-control" required /></input>
</div> </div>
<div class="row col-lg-12">
<div class="form-group">
<label>Antrian Awal(mobile)</label>
<input style="width: 221px;" type="number" id="antrian_awaledt" name="antrian_awal" class="form-control" required /></input>
</div>
<div class="col-lg-6 sm-7">
<div class="form-group">
<label>Antrian Akhir(mobile)</label>
<input style="width: 230px;" type="number" id="antrian_akhiredt" name="antrian_akhir" class="form-control" required /></input>
</div>
</div>
</div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="form-group"> <div class="form-group">
<label>Waktu Mulai Antrian</label> <label>Waktu Mulai Antrian</label>
......
...@@ -40,15 +40,12 @@ input::-webkit-inner-spin-button { ...@@ -40,15 +40,12 @@ input::-webkit-inner-spin-button {
<form id="myForm"> <form id="myForm">
<input type="hidden" id="iInput" class="form-control" /></input> <input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group"> <div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br> <label> <h5>No Rekam Medis</h5></label><br>
<input type="text" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" ></input> <input type="text" id="no_rekam_medis" class="form-control" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8"></input>
</div> </div>
<!-- <div class="form-group">
<label> <h5>No Induk Kependudukan (NIK)</h5></label><br>
<input type="number" id="ktp" placeholder="No Induk Kependudukan (NIK)" class="form-control"max="9999999999999999" maxlength="16" ></input>
</div> -->
<p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p> <p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p>
<a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a> <a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a>
</form> </form>
......
...@@ -223,16 +223,21 @@ input[type="done"] + label { ...@@ -223,16 +223,21 @@ input[type="done"] + label {
<!-- Modal --> <!-- Modal -->
<div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl"> <div class="modal-dialog modal-xl">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="-close" data-dismiss="modal">&times;</button> <button type="button" class="-close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Daftar Antrian</h4> <h4 class="modal-title">Daftar Antrian</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row col-lg-12 antrian" id="seat"> <div class="row col-lg-12 antrian" id="seat">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="container" > <div class="container" >
...@@ -288,4 +293,5 @@ input[type="done"] + label { ...@@ -288,4 +293,5 @@ input[type="done"] + label {
</div> </div>
</div> </div>
</div> </div>
</div>
...@@ -99,16 +99,16 @@ ...@@ -99,16 +99,16 @@
<span href="">Antrian</span> <span href="">Antrian</span>
</a> </a>
</li> </li>
<li class="nav-item"> <!-- <li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/tampilanumum') ?>"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/tampilanumum') ?>">
<i class="fas fa-fw fa-folder"></i> <i class="fas fa-fw fa-folder"></i>
<span href="">Tampilan Umum</span> <span href="">Tampilan Umum</span>
</a> </a>
</li> </li> -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/registrasidokter') ?>"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/registrasidokter') ?>">
<i class="fas fa-fw fa-cog"></i> <i class="fas fa-fw fa-cog"></i>
<span href="">Registrasi Dokter</span> <span href="">Kelola Jadwal Dokter</span>
</a> </a>
</li> </li>
......
...@@ -20,11 +20,13 @@ ...@@ -20,11 +20,13 @@
->prependStylesheet($this->basePath('/tamplate/css/flaticon.css')) ->prependStylesheet($this->basePath('/tamplate/css/flaticon.css'))
->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css')) ->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css'))
->prependStylesheet($this->basePath('/tamplateadmin/css/swich-alert.css')) ->prependStylesheet($this->basePath('/tamplateadmin/css/swich-alert.css'))
->prependStylesheet($this->basePath('/tamplateadmin/assets/css/icons/icomoon/styles.css'))
->prependStylesheet($this->basePath('/tamplate/css/nice-select.css')) ->prependStylesheet($this->basePath('/tamplate/css/nice-select.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/demo.css')) ->prependStylesheet($this->basePath('/tamplate/css/demo.css'))
->prependStylesheet($this->basePath('/tamplate/css/intlTelInput.css')) ->prependStylesheet($this->basePath('/tamplate/css/intlTelInput.css'))
?> ?>
</head> </head>
......
...@@ -64,33 +64,20 @@ $('#poli').on('change', function () { ...@@ -64,33 +64,20 @@ $('#poli').on('change', function () {
$("select#dokter").removeAttr('disabled'); $("select#dokter").removeAttr('disabled');
$("select#dokter").html(optionseg); $("select#dokter").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Dokter Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
}); });
$( '#dokter' ).on( "change", function() { $('#dokter').on("change", function () {
$id_dokter =$('#dokter').val(); $id_dokter = $('#dokter').val();
window.location.href = ("/admin/antrianadmin/" +$id_dokter); window.location.href = ("/admin/antrianadmin/" + $id_dokter);
}); });
if(window.location.pathname == "/admin/antrianadmin/" +id){ if (window.location.pathname == "/admin/antrianadmin/" + id) {
$( window ).on( "load", function() { $(window).on("load", function () {
tampilangka(id) tampilangka(id)
loadantrian(id) loadantrian(id)
}); });
...@@ -114,20 +101,7 @@ function loadpoli() { ...@@ -114,20 +101,7 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -135,7 +109,7 @@ function loadpoli() { ...@@ -135,7 +109,7 @@ function loadpoli() {
function loadantrian(id) { function loadantrian(id) {
$iddok= $('#dokter').val(); $iddok = $('#dokter').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -146,7 +120,7 @@ function loadantrian(id) { ...@@ -146,7 +120,7 @@ function loadantrian(id) {
}, },
success: function (result) { success: function (result) {
// console.log(result.data); console.log(result.data);
$('table.table-bordered > tbody').empty(); $('table.table-bordered > tbody').empty();
// console.log(result); // console.log(result);
...@@ -154,7 +128,7 @@ function loadantrian(id) { ...@@ -154,7 +128,7 @@ function loadantrian(id) {
if (result.code == 0) { if (result.code == 0) {
let data = result.data; let data = result.data;
console.log(data); // console.log(data);
let counter = 1; let counter = 1;
for (x in data) { for (x in data) {
...@@ -172,9 +146,10 @@ function loadantrian(id) { ...@@ -172,9 +146,10 @@ function loadantrian(id) {
$("#antrianadmin").append(newRow); $("#antrianadmin").append(newRow);
counter++; counter++;
// $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>'); // $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>');
} }
// console.log(data);
} else { } else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true }); bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
} }
...@@ -271,25 +246,25 @@ function tampilangka(id) { ...@@ -271,25 +246,25 @@ function tampilangka(id) {
$('#btnNext').on('click', function () { $('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20,id); actionqueue(noantrian + 1, 20, id);
loadantrian() loadantrian(id)
}); });
$('#btnCall').on('click', function () { $('#btnCall').on('click', function () {
actionqueue(noantrian, 30,id); actionqueue(noantrian, 30, id);
}); });
$('#btnDone').on('click', function () { $('#btnDone').on('click', function () {
actionqueue(noantrian, 50,id); actionqueue(noantrian, 50, id);
}); });
$('#btnMissed').on('click', function () { $('#btnMissed').on('click', function () {
actionqueue(noantrian, 60,id); actionqueue(noantrian, 60, id);
}); });
$('#btnServed').on('click', function () { $('#btnServed').on('click', function () {
actionqueue(noantrian, 40,id); actionqueue(noantrian, 40, id);
...@@ -346,14 +321,16 @@ function actionqueue(antrianno, status, iddok) { ...@@ -346,14 +321,16 @@ function actionqueue(antrianno, status, iddok) {
var flush = new Audio('../../data/tone/a1.mp3'); var flush = new Audio('../../data/tone/a1.mp3');
setTimeout(function() { setTimeout(function () {
flush.play(); }, ) flush.play();
})
flush.onended = function() { flush.onended = function () {
textToAudio() textToAudio()
setTimeout(function() { setTimeout(function () {
textToAudioRuang() }, 3000) textToAudioRuang()
}, 3000)
}; };
swal({ swal({
......
...@@ -38,53 +38,14 @@ function cekpasien(no_rekam_medis) { ...@@ -38,53 +38,14 @@ function cekpasien(no_rekam_medis) {
console.log(result); console.log(result);
if (result.code != 0) { if (result.code != 0) {
bootbox.alert({ message: "No rekam medis atau NIK tidak sesuai!", centerVertical: true }); bootbox.alert({ message: "No rekam medis tidak sesuai!", centerVertical: true });
} }
else if (result.code == 0) { else if (result.code == 0) {
console.log(result.data['datapasien'][0]['no_rekam_medis']); console.log(result.data['datapasien'][0]['no_rekam_medis']);
// alert('berhasil');
if (result.data['datapasien'][0]['no_rekam_medis'] == null) {
let $id = result.data['datapasien'][0]['id_pasien']; let $id = result.data['datapasien'][0]['id_pasien'];
let $encodedId = btoa($id); let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId); window.location.href = ("datapasien/" + $encodedId);
}
if (result.data['datapasien'][0]['no_rekam_medis'] != null && (result.data['datapasien'][0]['status_code'] == 10)) {
let $idantrian = result.data['datapasien'][0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let no_rekam_medis = result.data['datapasien'][0]['no_rekam_medis'];
let nama = result.data['datapasien'][0]['nama'];
swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else if (result.data['datapasien'][0]['status_code'] == 20) {
bootbox.alert({ message: "Pasien Sedang Dalam Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 30) {
bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 40) {
bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 50) {
bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 60) {
bootbox.alert({ message: "Pasien Sedang Telah Terlewat Silahkan Hubungi Petugas", centerVertical: true });
}
// } else if (result.data['validasiinput'] == 1) {
// bootbox.alert({ message: "No Induk Kependudukan tidak sesuai", centerVertical: true });
} else {
// bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
} }
}, },
...@@ -132,49 +93,4 @@ function validasidokter(no_rekam_medis, ktp) { ...@@ -132,49 +93,4 @@ function validasidokter(no_rekam_medis, ktp) {
} }
var inputQuantity = [];
$(function () {
$("#ktp").each(function (i) {
inputQuantity[i] = this.defaultValue;
$(this).data("idx", i); // save this field's index to access later
});
$("#ktp").on("keyup", function (e) {
var $field = $(this),
val = this.value,
$thisIndex = parseInt($field.data("idx"), 10); // retrieve the index
// window.console && console.log($field.is(":invalid"));
// $field.is(":invalid") is for Safari, it must be the last to not error in IE8
if (this.validity && this.validity.badInput || isNaN(val) || $field.is(":invalid")) {
this.value = inputQuantity[$thisIndex];
return;
}
if (val.length > Number($field.attr("maxlength"))) {
val = val.slice(0, 16);
$field.val(val);
}
inputQuantity[$thisIndex] = val;
});
})
var inputQuantity = [];
$(function () {
$("#no_rekam_medis").each(function (i) {
inputQuantity[i] = this.defaultValue;
$(this).data("idx", i); // save this field's index to access later
});
$("#no_rekam_medis").on("keyup", function (e) {
var $field = $(this),
val = this.value,
$thisIndex = parseInt($field.data("idx"), 10); // retrieve the index
// window.console && console.log($field.is(":invalid"));
// $field.is(":invalid") is for Safari, it must be the last to not error in IE8
if (this.validity && this.validity.badInput || isNaN(val) || $field.is(":invalid")) {
this.value = inputQuantity[$thisIndex];
return;
}
if (val.length > Number($field.attr("maxlength"))) {
val = val.slice(0, 8);
$field.val(val);
}
inputQuantity[$thisIndex] = val;
});
})
...@@ -45,8 +45,8 @@ function loadsisaantrian() { ...@@ -45,8 +45,8 @@ function loadsisaantrian() {
let no_antrian = $("input[name=antrian]:checked").val(); let no_antrian = $("input[name=antrian]:checked").val();
var sisa_antrian; var sisa_antrian;
console.log(dokter); // console.log(dokter);
console.log(no_antrian); // console.log(no_antrian);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -65,7 +65,7 @@ function loadsisaantrian() { ...@@ -65,7 +65,7 @@ function loadsisaantrian() {
let data = result.data; let data = result.data;
console.log(data[0].count); // console.log(data[0].count);
sisa_antrian = data[0].count; sisa_antrian = data[0].count;
// $('#sisa_antrian').val(data[0].count); // $('#sisa_antrian').val(data[0].count);
...@@ -121,7 +121,7 @@ function savedataaja() { ...@@ -121,7 +121,7 @@ function savedataaja() {
ipoli: poli, ipoli: poli,
idokter: dokter, idokter: dokter,
ino_antrian: no_antrian, ino_antrian: no_antrian,
isisa_antrian :sisa_antrian, isisa_antrian: sisa_antrian,
}, },
success: function (response) { success: function (response) {
...@@ -155,7 +155,7 @@ function savedataaja() { ...@@ -155,7 +155,7 @@ function savedataaja() {
loadpoli(); loadpoli();
$('#poli').on('change', function () { $('#poli').on('change', function () {
var idpoli = $('#poli').val(); var idpoli = $('#poli').val();
console.log(idpoli); // console.log(idpoli);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -176,20 +176,7 @@ $('#poli').on('change', function () { ...@@ -176,20 +176,7 @@ $('#poli').on('change', function () {
$("select#dokter").removeAttr('disabled'); $("select#dokter").removeAttr('disabled');
$("select#dokter").html(optionseg); $("select#dokter").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -214,46 +201,100 @@ function loadpoli() { ...@@ -214,46 +201,100 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
} }
} }
}); });
}
// validasipasien()
function validasipasien(id_poli, dokter, id_pasien) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/valpilihAntrian',
async: false,
data: {
id_pasien: id_pasien
},
success: function (result) {
console.log(dokter)
var data = result.data;
for (x in data) {
if (id_pasien == data[x]['id_pasien']) {
if (id_poli == data[x]['id_poli']) {
if (dokter == data[x]['id_dokter']) {
exist = 1;
}
} }
} }
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
}); });
return exist;
} }
$('#pilihno').on('click', function () { $('#pilihno').on('click', function (e) {
pilihAntrian() e.preventDefault();
var id_pasien = $('#id_pasien').val();
var id_poli = $('#poli option:selected').attr("value");
var dokter = $('#dokter option:selected').attr("value");
pilihAntrian(id_poli)
// console.log(id_poli)
}); });
function pilihAntrian() {
var $dokter = $('#dokter option:selected').attr("value"); function pilihAntrian(id_poli) {
var dokter = $('#dokter option:selected').attr("value");
var id_pasien = $('#id_pasien').val();
// console.log(id_pasien);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadPilihAntrian', url: baseURL + '/api/loadPilihAntrian',
data: { data: {
iddok: $dokter, iddok: dokter,
id_poli: id_poli,
}, },
success: function (response) { success: function (response) {
// console.log(response.data);
var $antrian = (response.data); var $antrian = (response.data);
// console.log($antrian); // console.log(validasipasien(id_poli, dokter, id_pasien) == 1);
// console.log(response);
if (validasipasien(id_poli, dokter, id_pasien) == 1) {
let $idantrian = response.data[0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let nama = response.data[0]['nama'];
swal({
title: "Pasien dengan nama'" + nama + "' telah melakukan pendaftaran di poli dan dokter ini! \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else {
if ($antrian) { if ($antrian) {
var hour = 0; var hour = 0;
...@@ -269,8 +310,9 @@ function pilihAntrian() { ...@@ -269,8 +310,9 @@ function pilihAntrian() {
$('.antrian').empty(); $('.antrian').empty();
for (var i = 0; i < $antrian.length; i++) { for (var i = 0; i < $antrian.length; i++) {
var A = Date.now();
if ($antrian[i]['id_pasien'] === null) {//jika masih kosong if ($antrian[i]['id_pasien'] === null) {//jika masih kosong
let y = ''; let y = ' ';
var splittime = []; var splittime = [];
...@@ -282,8 +324,8 @@ function pilihAntrian() { ...@@ -282,8 +324,8 @@ function pilihAntrian() {
hour += Math.floor(minute / 60); hour += Math.floor(minute / 60);
minute = minute % 60; minute = minute % 60;
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
...@@ -325,8 +367,8 @@ function pilihAntrian() { ...@@ -325,8 +367,8 @@ function pilihAntrian() {
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
...@@ -376,8 +418,8 @@ function pilihAntrian() { ...@@ -376,8 +418,8 @@ function pilihAntrian() {
minute = minute % 60; minute = minute % 60;
} }
if(hour >=24){ if (hour >= 24) {
hour=0; hour = 0;
} }
let y = ''; let y = '';
...@@ -398,6 +440,11 @@ function pilihAntrian() { ...@@ -398,6 +440,11 @@ function pilihAntrian() {
} else { } else {
} }
}
}, },
error: function (xhr) { error: function (xhr) {
......
...@@ -36,7 +36,7 @@ function Loadunregister() { ...@@ -36,7 +36,7 @@ function Loadunregister() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-danger btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>';
// console.log(data[x].id_pasien); // console.log(data[x].id_pasien);
newRow.append(cols); newRow.append(cols);
...@@ -89,7 +89,7 @@ function unregister(id_pasien) { ...@@ -89,7 +89,7 @@ function unregister(id_pasien) {
if (result.code == 0) { if (result.code == 0) {
swal({ swal({
title: "", title: "",
text: "Data Berhasil Diupdate!", text: "Data Berhasil Direset!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}, function () { }, function () {
...@@ -99,7 +99,7 @@ function unregister(id_pasien) { ...@@ -99,7 +99,7 @@ function unregister(id_pasien) {
} else { } else {
swal({ swal({
title: "", title: "",
text: "Data Gagal Diupdate!", text: "Data Gagal Direset!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}); });
......
...@@ -24,20 +24,7 @@ function loadpoli() { ...@@ -24,20 +24,7 @@ function loadpoli() {
$("select#poli").html(optionseg); $("select#poli").html(optionseg);
} else { } else {
bootbox.dialog({ bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
...@@ -75,9 +62,10 @@ function Loaddokter() { ...@@ -75,9 +62,10 @@ function Loaddokter() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].kode_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].kode_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_dokter + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_dokter + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_dokter + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_dokter + ')">Hapus</span> <span style="padding: 7px;margin-top:10px; font-size: 14px;"class="btn btn-info btn-xs" onclick="Update(' + data[x].id_dokter + "," + data[x].id_condition + ')">Update Kondisi</span></div></td>';
newRow.append(cols); newRow.append(cols);
$("#tabledokter").append(newRow); $("#tabledokter").append(newRow);
...@@ -98,11 +86,12 @@ function Loaddokter() { ...@@ -98,11 +86,12 @@ function Loaddokter() {
paging: true, paging: true,
columnDefs: [ columnDefs: [
{ width: 30, targets: 0 }, { width: 30, targets: 0 },
{ width: 155, targets: 1 }, { width: 120, targets: 1 },
{ width: 155, targets: 2 }, { width: 120, targets: 2 },
{ width: 155, targets: 3 }, { width: 120, targets: 3 },
{ width: 155, targets: 4 }, { width: 120, targets: 4 },
{ width: 90, targets: 5 }, { width: 90, targets: 5 },
{ width: 90, targets: 6 },
], ],
}); });
...@@ -211,8 +200,8 @@ function validasigambar() { ...@@ -211,8 +200,8 @@ function validasigambar() {
$('#tambahmodal').on('click', function () { $('#tambahmodal').on('click', function () {
loadpoli() loadpoli()
}) })
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
let nama_dokter = $('#nama_dokter').val(); let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val(); let kode_dokter = $('#kode_dokter').val();
...@@ -249,7 +238,7 @@ $('#tambah').on('click', function () { ...@@ -249,7 +238,7 @@ $('#tambah').on('click', function () {
} }
else if (validasigambar() == 1) { else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} else { } else {
savedokter() savedokter()
} }
...@@ -325,7 +314,7 @@ $('#edit').on('click', function () { ...@@ -325,7 +314,7 @@ $('#edit').on('click', function () {
let nama_dokter = $('#nama_dokteredt').val(); let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val();
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
const fileupload = $('#gambar_dokter').prop('files')[0]; const fileupload = $('#gambar_dokteredt').prop('files')[0];
if (nama_dokter == null || nama_dokter == "") { if (nama_dokter == null || nama_dokter == "") {
...@@ -340,19 +329,20 @@ $('#edit').on('click', function () { ...@@ -340,19 +329,20 @@ $('#edit').on('click', function () {
bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
return false; return false;
} }
else if (fileupload == null) {
bootbox.alert({ message: 'Gambar dokter tidak boleh kosong', centerVertical: true }); else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) {
return false;
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 3) {
bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true });
} }
else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) { else if (validasidokter(poli, nama_dokter, kode_dokter) == 5) {
bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true });
} else if (validasigambar() == 2) {
if (fileupload == null || fileupload == '') {
editdatadokter(id_dokter);
} else {
bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} }
else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
} else { } else {
editdatadokter(id_dokter) editdatadokter(id_dokter)
} }
...@@ -362,7 +352,7 @@ $('#edit').on('click', function () { ...@@ -362,7 +352,7 @@ $('#edit').on('click', function () {
}) })
function editdatadokter(id_dokter) { function editdatadokter(id_dokter) {
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
let condition = $("#condition option:selected").attr("value");
let nama_dokter = $('#nama_dokteredt').val(); let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val(); let kode_dokter = $('#kode_dokteredt').val();
const fileupload = $('#gambar_dokteredt').prop('files')[0]; const fileupload = $('#gambar_dokteredt').prop('files')[0];
...@@ -373,7 +363,7 @@ function editdatadokter(id_dokter) { ...@@ -373,7 +363,7 @@ function editdatadokter(id_dokter) {
formData.append('inama_dokter', nama_dokter); formData.append('inama_dokter', nama_dokter);
formData.append('ikode_dokter', kode_dokter); formData.append('ikode_dokter', kode_dokter);
formData.append('ipoli', poli); formData.append('ipoli', poli);
formData.append('icondition', condition);
formData.append('fileupload', fileupload); // set file ke tipe data binary formData.append('fileupload', fileupload); // set file ke tipe data binary
...@@ -468,14 +458,6 @@ function loadedit(id_dokter) { ...@@ -468,14 +458,6 @@ function loadedit(id_dokter) {
$("select#poliedt").val(data[0].id_poli).change(); $("select#poliedt").val(data[0].id_poli).change();
}); });
for (var i = 0; i < res.condition.length; i++) {//Condition
optionsegc += '<option value="' + res.condition[i].id_condition + '">' + res.condition[i].condition + '</option>';
}
$("select#condition").html(optionsegc);
$(document).ready(function () {
$("select#condition").val(data[0].id_condition).change();
});
...@@ -561,3 +543,35 @@ function Delete(param) { ...@@ -561,3 +543,35 @@ function Delete(param) {
}); });
} }
function Update(id_dokter, id_condition) {
// console.log(id_dokter)
// console.log(id_condition)
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateconditiondok',
data: {
id_dokter: id_dokter,
id_condition: id_condition,
},
success: function (result) {
console.log(result);
// console.log(result)
if (result.code == 0) {
location.reload();
} else {
bootbox.alert({ message: 'Gagal ', centerVertical: true });
}
},
error: function () {
bootbox.alert({ message: 'Data dokter masih terdaftar dalam poli ', centerVertical: true });
}
});
}
\ No newline at end of file
...@@ -34,7 +34,7 @@ function Loadpasien() { ...@@ -34,7 +34,7 @@ function Loadpasien() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_hp + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_hp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_pasien + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_pasien + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_pasien + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_pasien + ')">Hapus</span></div></td>';
// console.log(data[x].id_pasien); // console.log(data[x].id_pasien);
newRow.append(cols); newRow.append(cols);
......
...@@ -27,7 +27,6 @@ function Loadpoli() { ...@@ -27,7 +27,6 @@ function Loadpoli() {
let data = result.data; let data = result.data;
let counter = 1; let counter = 1;
for (x in data) { for (x in data) {
// console.log(data); // console.log(data);
// var newRow = $("<tr>"); // var newRow = $("<tr>");
...@@ -39,7 +38,7 @@ function Loadpoli() { ...@@ -39,7 +38,7 @@ function Loadpoli() {
cols += '<td class="tdCenterText bgtd1 ">' + data[x].kode_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].kode_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 ">' + data[x].deskripsi_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].deskripsi_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 ">' + data[x].image_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 ">' + data[x].image_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_poli + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_poli + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_poli + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_poli + ')">Hapus</span></div></td>';
cols += '</tr>' cols += '</tr>'
//newRow.append(cols); //newRow.append(cols);
$("#tablepoli").append(cols); $("#tablepoli").append(cols);
...@@ -114,7 +113,7 @@ $('#tambah').on('click', function (e) { ...@@ -114,7 +113,7 @@ $('#tambah').on('click', function (e) {
bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true }); bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true });
} }
else if (validasigambar() == 1) { else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
} else { } else {
savedatapoli(); savedatapoli();
} }
...@@ -217,7 +216,10 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { ...@@ -217,7 +216,10 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
var data = result.data; var data = result.data;
console.log(data) console.log(data)
var counter = 0; var counternama = 0;
var counterkode = 0;
var counterdesk = 0;
var counterimage = 0;
for (x in data) { for (x in data) {
...@@ -235,27 +237,27 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) { ...@@ -235,27 +237,27 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
exist = 4; exist = 4;
} }
if (nama_poli == data[x]['nama_poli']) { if (nama_poli == data[x]['nama_poli']) {
counter += 1; counternama += 1;
if (counter > 1) { if (counternama > 1) {
exist = 5; exist = 5;
} }
} }
if (kode_poli == data[x]['kode_poli']) { if (kode_poli == data[x]['kode_poli']) {
counter += 1; counterkode += 1;
if (counter > 1) { if (counterkode > 1) {
exist = 6; exist = 6;
} }
} }
if (deskripsi_poli == data[x]['deskripsi_poli']) { if (deskripsi_poli == data[x]['deskripsi_poli']) {
counter += 1; counterdesk += 1;
if (counter > 1) { if (counterdesk > 1) {
exist = 7; exist = 7;
} }
} }
if (fileupload == data[x]['image_poli']) { if (fileupload == data[x]['image_poli']) {
counter += 1; counterimage += 1;
if (counter > 1) { if (counterimage > 1) {
exist = 8; exist = 8;
} }
} }
...@@ -281,6 +283,7 @@ $('#edit').on('click', function () { ...@@ -281,6 +283,7 @@ $('#edit').on('click', function () {
let kode_poli = $('#kode_poliEdt').val(); let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val(); let deskripsi_poli = $('#deskripsi_poliEdt').val();
const fileupload = $('#gambar_poliedt').prop('files')[0]; const fileupload = $('#gambar_poliedt').prop('files')[0];
console.log(fileupload);
if (nama_poli == null || nama_poli == "") { if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
...@@ -294,10 +297,7 @@ $('#edit').on('click', function () { ...@@ -294,10 +297,7 @@ $('#edit').on('click', function () {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true }); bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false; return false;
} }
else if (fileupload == null) {
bootbox.alert({ message: ' Gambar tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli.toString().length > 5) { else if (kode_poli.toString().length > 5) {
bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true }); bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true });
return false; return false;
...@@ -311,11 +311,15 @@ $('#edit').on('click', function () { ...@@ -311,11 +311,15 @@ $('#edit').on('click', function () {
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) { else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) {
bootbox.alert({ message: 'Deskripsi Poli harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Deskripsi Poli harus berbeda!', centerVertical: true });
} }
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload.name) == 8) { else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 8) {
bootbox.alert({ message: 'Gambar Poli harus berbeda!', centerVertical: true }); bootbox.alert({ message: 'Gambar Poli harus berbeda!', centerVertical: true });
} }
else if (validasigambar() == 2) { else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true }); if (fileupload == null || fileupload == '') {
editdatapoli(id_poli)
} else {
bootbox.alert({ message: 'File Harus berupa gambar', centerVertical: true });
}
} else { } else {
editdatapoli(id_poli) editdatapoli(id_poli)
......
...@@ -82,7 +82,7 @@ function Loadruang() { ...@@ -82,7 +82,7 @@ function Loadruang() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_ruang + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_ruang + ')">Delete</span></div></td>'; cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_ruang + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_ruang + ')">Hapus</span><span style="padding: 7px;margin-top:10px; font-size: 14px;"class="btn btn-info btn-xs" onclick="Update(' + data[x].id_ruang + "," + data[x].id_condition + ')">Update Kondisi</span></div></td>';
newRow.append(cols); newRow.append(cols);
$("#tableruang").append(newRow); $("#tableruang").append(newRow);
...@@ -288,7 +288,7 @@ function editdataruang(id_ruang) { ...@@ -288,7 +288,7 @@ function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val(); let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val(); let lantai = $('#lantaiedt').val();
let condition = $("#condition option:selected").attr("value");
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -299,7 +299,6 @@ function editdataruang(id_ruang) { ...@@ -299,7 +299,6 @@ function editdataruang(id_ruang) {
inama_ruang: nama_ruang, inama_ruang: nama_ruang,
ipoli: poli, ipoli: poli,
ilantai: lantai, ilantai: lantai,
icondition: condition,
}, },
...@@ -389,15 +388,6 @@ function loadedit(id_ruang) { ...@@ -389,15 +388,6 @@ function loadedit(id_ruang) {
$("select#poliedt").val(data[0].id_poli).change(); $("select#poliedt").val(data[0].id_poli).change();
}); });
for (var i = 0; i < res.condition.length; i++) {//Condition
optionsegc += '<option value="' + res.condition[i].id_condition + '">' + res.condition[i].condition + '</option>';
}
$("select#condition").html(optionsegc);
$(document).ready(function () {
$("select#condition").val(data[0].id_condition).change();
});
} }
...@@ -431,8 +421,9 @@ function Delete(param) { ...@@ -431,8 +421,9 @@ function Delete(param) {
success: function (result) { success: function (result) {
// console.log(result); // console.log(result);
let nama_ruang = result.data[0].nama_ruang; let nama_ruang = result.data[0].nama_ruang;
let lantai = result.data[0].lantai;
swal({ swal({
title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ", title: "Apakah yakin mengahapus ruang '" + nama_ruang + " ' lantai '" + lantai + "'? ",
type: "error", type: "error",
confirmButtonClass: "btn-danger", confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!", confirmButtonText: "Yes!",
...@@ -479,3 +470,35 @@ function Delete(param) { ...@@ -479,3 +470,35 @@ function Delete(param) {
}); });
} }
function Update(id_ruang, id_condition) {
// console.log(id_dokter)
// console.log(id_condition)
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateconditionruang',
data: {
id_ruang: id_ruang,
id_condition: id_condition,
},
success: function (result) {
console.log(result);
// console.log(result)
if (result.code == 0) {
location.reload();
} else {
bootbox.alert({ message: 'Gagal ', centerVertical: true });
}
},
error: function () {
bootbox.alert({ message: 'Data dokter masih terdaftar dalam poli ', centerVertical: true });
}
});
}
\ No newline at end of file
...@@ -154,19 +154,17 @@ function reset() { ...@@ -154,19 +154,17 @@ function reset() {
} }
LoadDadta(); LoadDadta();
function LoadDadta(id) { function LoadDadta() {
/* save data */ /* save data */
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadantrianregister', url: baseURL + '/api/loadantrianregister',
data: {
id: id,
},
success: function (result) { success: function (result) {
// console.log(result); console.log(result);
$('table.table-bordered > tbody').empty(); $('table.table-bordered > tbody').empty();
// console.log(result); // console.log(result);
...@@ -188,12 +186,12 @@ function LoadDadta(id) { ...@@ -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_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</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_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].jam_mulai + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].waktu_antrian + '</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 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>' cols += '</tr>'
...@@ -216,13 +214,12 @@ function LoadDadta(id) { ...@@ -216,13 +214,12 @@ function LoadDadta(id) {
{ width: 20, targets: 0 }, { width: 20, targets: 0 },
{ width: 100, targets: 1 }, { width: 100, targets: 1 },
{ width: 100, targets: 2 }, { width: 100, targets: 2 },
{ width: 80, targets: 3 }, { width: 50, targets: 3 },
{ width: 30, targets: 4 }, { width: 50, targets: 4 },
{ width: 30, targets: 5 }, { width: 50, targets: 5 },
{ width: 30, targets: 6 }, { width: 50, targets: 6 },
{ width: 30, targets: 7 }, { width: 50, targets: 7 },
{ width: 90, targets: 8 }, { width: 100, targets: 8 },
{ width: 90, targets: 9 },
], ],
}); });
...@@ -252,10 +249,10 @@ function SaveDataRegister(param) { ...@@ -252,10 +249,10 @@ function SaveDataRegister(param) {
let poli = $('#poli option:selected').attr("value"); let poli = $('#poli option:selected').attr("value");
let dokter = $('#dokter option:selected').attr("value"); let dokter = $('#dokter option:selected').attr("value");
let antrian_all = $('#antrian_all').val(); 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 waktu_antrian = $('#waktu_antrian').val();
let jam_mulai = $('#jam_mulai').val(); let jam_mulai = $('#jam_mulai').val();
if (ruang == null || ruang == "") { if (ruang == null || ruang == "") {
swal({ swal({
title: "", title: "",
...@@ -273,22 +270,8 @@ function SaveDataRegister(param) { ...@@ -273,22 +270,8 @@ function SaveDataRegister(param) {
button: "ok", button: "ok",
}); });
return false; 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 == "") { } else if (waktu_antrian == null || waktu_antrian == "") {
swal({ swal({
title: "", title: "",
...@@ -315,40 +298,7 @@ function SaveDataRegister(param) { ...@@ -315,40 +298,7 @@ function SaveDataRegister(param) {
button: "ok", button: "ok",
}); });
return false; 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) { else if (parseInt(antrian_all) > 30) {
swal({ swal({
...@@ -367,15 +317,6 @@ function SaveDataRegister(param) { ...@@ -367,15 +317,6 @@ function SaveDataRegister(param) {
}); });
return false; return false;
} }
else if (parseInt(antrian_awal) < 5) {
swal({
title: "",
text: "antrian mobile dimulai dari 5! ",
icon: "error",
button: "ok",
});
return false;
}
/* save data */ /* save data */
$.ajax({ $.ajax({
...@@ -386,8 +327,6 @@ function SaveDataRegister(param) { ...@@ -386,8 +327,6 @@ function SaveDataRegister(param) {
iruang: ruang, iruang: ruang,
id: param, id: param,
iantrian_all: antrian_all,//variable json diisi oleh variable yang menyimpan data inputan 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, iwaktu_antrian: waktu_antrian,
ipoli: poli, ipoli: poli,
idokter: dokter, idokter: dokter,
...@@ -408,7 +347,6 @@ function SaveDataRegister(param) { ...@@ -408,7 +347,6 @@ function SaveDataRegister(param) {
html: true, html: true,
type: "success" type: "success"
}, function () { }, function () {
location.reload(); location.reload();
}); });
// loadpoli(); // loadpoli();
...@@ -421,7 +359,7 @@ function SaveDataRegister(param) { ...@@ -421,7 +359,7 @@ function SaveDataRegister(param) {
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}); });
bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true }); // bootbox.alert({ message: 'Gagal', centerVertical: true });
} }
}, },
...@@ -455,21 +393,10 @@ function editregister(id_register) { ...@@ -455,21 +393,10 @@ function editregister(id_register) {
let poli = $('#poli option:selected').attr("value"); let poli = $('#poli option:selected').attr("value");
let dokter = $('#dokter option:selected').attr("value"); let dokter = $('#dokter option:selected').attr("value");
let antrian_all = $('#antrian_alledt').val(); 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 waktu_antrian = $('#waktu_antrianedt').val();
let jam_mulai = $('#jam_mulaiedt').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 == "") { if (antrian_all == null || antrian_all == "") {
swal({ swal({
title: "", title: "",
...@@ -478,22 +405,8 @@ function editregister(id_register) { ...@@ -478,22 +405,8 @@ function editregister(id_register) {
button: "ok", button: "ok",
}); });
return false; 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 == "") { } else if (waktu_antrian == null || waktu_antrian == "") {
swal({ swal({
title: "", title: "",
...@@ -503,59 +416,9 @@ function editregister(id_register) { ...@@ -503,59 +416,9 @@ function editregister(id_register) {
}); });
return false; 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) { else if (parseInt(antrian_all) > 30) {
swal({ swal({
title: "", title: "",
...@@ -573,16 +436,6 @@ function editregister(id_register) { ...@@ -573,16 +436,6 @@ function editregister(id_register) {
}); });
return false; return false;
} }
else if (parseInt(antrian_awal) < 5) {
swal({
title: "",
text: "antrian mobile dimulai dari 5! ",
icon: "error",
button: "ok",
});
return false;
}
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -595,8 +448,7 @@ function editregister(id_register) { ...@@ -595,8 +448,7 @@ function editregister(id_register) {
idokter: dokter, idokter: dokter,
iruang: ruang, iruang: ruang,
iantrial_all: antrian_all, iantrial_all: antrian_all,
iantrian_awal: antrian_awal,
iantrian_akhir: antrian_akhir,
iwaktu_antrian: waktu_antrian, iwaktu_antrian: waktu_antrian,
ijam_mulai: jam_mulai, ijam_mulai: jam_mulai,
}, },
...@@ -643,8 +495,8 @@ function editregister(id_register) { ...@@ -643,8 +495,8 @@ function editregister(id_register) {
}); });
} }
loadedit()
function loadedit(param) { function loadedit(id_register) {
/* save data */ /* save data */
$.ajax({ $.ajax({
...@@ -652,10 +504,10 @@ function loadedit(param) { ...@@ -652,10 +504,10 @@ function loadedit(param) {
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadantrianregister', url: baseURL + '/api/loadantrianregister',
data: { data: {
id: param, id: id_register,
}, },
success: function (result) { success: function (result) {
// console.log(result); // console.log(result.code);
// $('.loaddata').empty(); // $('.loaddata').empty();
// console.log(result); // console.log(result);
...@@ -667,24 +519,23 @@ function loadedit(param) { ...@@ -667,24 +519,23 @@ function loadedit(param) {
optdok = `<p class="card-text">` + data[0].nama_dokter + `</p>` optdok = `<p class="card-text">` + data[0].nama_dokter + `</p>`
optpol = `<p class="card-text">` + data[0].nama_poli + `</p>` optpol = `<p class="card-text">` + data[0].nama_poli + `</p>`
optrua = `<p class="card-text">` + data[0].nama_ruang + `</p>` optrua = `<p class="card-text">` + data[0].nama_ruang + `</p>`
// console.log(data[0].nama_poli);
$('#id_register').val(data[0].id_register); $('#id_register').val(data[0].id_register);
$('#poliedt').html(optpol); $('#poliedt').html(optpol);
$('#dokteredt').html(optdok); $('#dokteredt').html(optdok);
$('#ruangedt').html(optrua); $('#ruangedt').html(optrua);
// console.log(data[0].id_dokter);
$('#antrian_alledt').val(data[0].antrian_all); $('#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); $('#jam_mulaiedt').val(data[0].jam_mulai);
$('#waktu_antrianedt').val(data[0].waktu_antrian); $('#waktu_antrianedt').val(data[0].waktu_antrian);
} else { } else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true }); // bootbox.alert({ message: 'Data Kosong', centerVertical: true });
} }
}, },
......
...@@ -10,7 +10,7 @@ function loadpoli() { ...@@ -10,7 +10,7 @@ function loadpoli() {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadRegisterPoli', url: baseURL + '/api/loadPoli',
success: function (result) { success: function (result) {
...@@ -29,17 +29,17 @@ function loadpoli() { ...@@ -29,17 +29,17 @@ function loadpoli() {
$("#poli").append(y); $("#poli").append(y);
} else { } else {
alert(result.info); // alert(result.info);
} }
}, },
error: function (xhr) { // error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText); // alert(xhr.status + '-' + xhr.statusText);
} // }
}); });
} }
$(document).ready(function () { $(document).ready(function () {
loadChart(9) loadChart(12)
}); });
function loadChart(id) { function loadChart(id) {
...@@ -120,7 +120,7 @@ function loadChart(id) { ...@@ -120,7 +120,7 @@ function loadChart(id) {
}); });
bootbox.alert({ message: 'Data Kosong', centerVertical: true }); // bootbox.alert({ message: 'Data Kosong', centerVertical: true });
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment