Commit 344ac3d3 authored by Indra Raja's avatar Indra Raja

commit

parent 5d91bfce
Pipeline #182 canceled with stages
......@@ -56,14 +56,16 @@ return [
],
],
],
'api' => [
'type' => Segment::class,
'options' => [
'route' => '/api[/][:action][/:id]',
'route' => '/api[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => [
'controller' => Controller\ApiController::class,
'action' => 'index',
......
......@@ -33,10 +33,7 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-dasboaard.js');
// $this->headScript->appendFile('/tamplateadmin/js/demo/chart-bar-demo.js');
// $this->headScript->appendFile('/tamplateadmin/js/demo/chart-area-demo.js');
$this->headScript->appendFile('/tamplateadmin/js/demo/chart-pie-demo.js');
$this->headScript->appendFile('/action-js/antrian-js/action-panggil.js');
$this->layout("layout/layoutAdmin");
return $view;
......@@ -50,30 +47,77 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$id = $getpath[3];
// echo "<pre>";
// print_r($uri);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-admin.js');
// $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
// $param = new \Application\Model\Param($storage);
$this->layout("layout/layoutAdmin");
return $view;
}
public function registrasidokterAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/nextantrian",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('inoantrian' => '1','idok' => '74','istatus' => '30'),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// echo $response;
// function curl($url, $data){
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output = curl_exec($ch);
// curl_close($ch);
// return $output;
// }
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
// // Data Parameter yang Dikirim oleh cURL
// $data = array("inoantrian"=>"1","idok"=>"74","istatus"=>"40");
// print_r($data);
// $send = curl("http://queue.indra/api/nextantrian/",json_encode($data));
// echo json_encode(array('respon'=>$send),JSON_UNESCAPED_SLASHES);
$arr = json_decode(file_get_contents("php://input"));
if (empty($arr->inoantrian) OR empty($arr->idok) OR empty($arr->istatus)){
echo "Submit gagal!";
} else {
echo "Submit berhasil!".$arr->inoantrian."</b><b>".$arr->idok."</b>.<b>".$arr->istatus."</b>.";
}
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-registrasidokter.js');
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $id . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-admin.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianterlewatAction()
public function registrasidokterAction()
{
$this->isLoggedIn();
$view = new ViewModel();
......@@ -84,12 +128,12 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolaantrian.js');
$this->headScript->appendFile('/action-js/antrian-js/action-registrasidokter.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianunregisterAction()
public function kelolapasienAction()
{
$this->isLoggedIn();
$view = new ViewModel();
......@@ -100,7 +144,7 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolaantrianunreg.js');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolapasien.js');
$this->layout("layout/layoutAdmin");
return $view;
......@@ -137,22 +181,6 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolapasienAction()
{
$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-kelolapasien.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolaruanganAction()
{
$this->isLoggedIn();
......@@ -185,13 +213,45 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function cobainAction()
{
//$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/index-js/action-listdata.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function tampilanumumAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
// require_once(APPPATH.'vendor/autoload.php');
// $options = array(
// 'cluster' => 'ap1',
// 'useTLS' => true
// );
// $pusher = new PusherPusher(
// '6f23df2468d8c1c7d0a2', //ganti dengan App_key pusher Anda
// 'd2c2bf5a98edcdddfda2', //ganti dengan App_secret pusher Anda
// '1090832', //ganti dengan App_key pusher Anda
// $options
// );
// $data['message'] = 'success';
// $pusher->trigger('my-channel', 'my-event', $data);
$today = gmdate("d M Y ", time()+60*60*7);
$view->setVariable('today', $today);
......
......@@ -76,9 +76,8 @@ class ApiController extends \Application\Master\GlobalActionController {
$no_hp = $post->ino_hp;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$norm = $post->inorm;
$dataArrayPasien = array (
$dataArrayPasien = array (
'id_pasien' => $idpasien,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
......@@ -87,9 +86,9 @@ class ApiController extends \Application\Master\GlobalActionController {
'alamat' => $alamat,
'no_hp' => $no_hp,
'ktp' => $ktp,
'no_rekam_medis' => $norm
);
$param->saveGlobal( $dataArrayPasien, $table_pasien);
......@@ -129,6 +128,32 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadsisaantrianAction(){
$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);
// print_r($load);die;
$load = $test->loadsisaantrian($post->id,$post->no);
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 cekpasienAction(){
$result = new Result();
$request = $this->getRequest();
......@@ -138,23 +163,19 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$no_rekam_medis = $post->ino_rekam_medis;
$ktp = $post->iktp;
$cekpasien = $test->cekpasien($no_rekam_medis);
$array = array(
'datapasien'=> $cekpasien->data
);
$cekpasien = $test->cekpasien($no_rekam_medis);
// print_r( $cekpasien) ;die;
// print_r($cekpasien) ;die;
if($cekpasien->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $array;
$result->data = $cekpasien->data ;
}else{
$result->code = 1;
$result->info = 'Not Found';
......@@ -185,6 +206,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis;
$sisa_antrian = $post->isisa_antrian;
// $counter= $param->getMaxCounter();
......@@ -200,6 +222,7 @@ class ApiController extends \Application\Master\GlobalActionController {
'no_hp' => $no_hp,
'ktp' => $ktp,
'status_code' => 10,
'sisa_antrian' => $sisa_antrian,
);
$table_antrianpasien = 'antrian_pasien';
......@@ -224,7 +247,10 @@ class ApiController extends \Application\Master\GlobalActionController {
}
return $this->getOutput($result->toJson());
}
public function TampilanUmumAction(){
}
public function saveregisterAction(){
$result = new Result();
......@@ -609,67 +635,43 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function savekelolapoliAction(){
if($this->isLoggedIn()){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$table_poli= 'poli';
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
try{
$fileupload = $_FILES['fileupload']['tmp_name'];
// print_r($fileupload);die;
try{
$nama_poli = $post->inama_poli;
$kode_poli = $post->ikode_poli;
$deskripsi_poli = $post->ideskripsi_poli;
if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name'];
$tipes = $_FILES['fileupload']['type'];
$size = $_FILES['fileupload']['size'];
$uploaddir = './public/tamplate/img/poli/'; // directory file
$dataArrayPoli = array (
$alamatfile = $uploaddir.$ImageName;
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
// print_r('berhasil');die;
/* jika upload berhasil ke folder sever */
$dataAtt = array(
'nama_poli' => $nama_poli,
'image_poli' => $ImageName,
'deskripsi_poli' => $deskripsi_poli,
'kode_poli' => $kode_poli,
);
$param->saveGlobal($dataAtt, $table_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPoli->data;
'nama_poli' => $nama_poli,
'kode_poli' =>$kode_poli,
'deskripsi_poli'=>$deskripsi_poli,
}else{
$result->code = 17;
$result->info = 'FAILED UPLOAD FILE to SERVER';
}
);
// print_r($dataArrayPoli);die;
}else{
$result->info = 'File tidak boleh kosong';
}
$param->saveGlobal($dataArrayPoli, $table_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPoli;
}catch (\Exception $exc) {
......@@ -682,7 +684,6 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function editkelolapoliAction(){
if($this->isLoggedIn()){
$result = new Result();
......@@ -696,58 +697,29 @@ class ApiController extends \Application\Master\GlobalActionController {
$param = new \Application\Model\Param($storage);
try{
$fileupload = $_FILES['fileupload']['tmp_name'];
$id_poli = $post->id_poli;
$id_poli = $post->id;
$nama_poli = $post->inama_poli;
$kode_poli = $post->ikode_poli;
$deskripsi_poli = $post->ideskripsi_poli;
if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name'];
$tipes = $_FILES['fileupload']['type'];
$size = $_FILES['fileupload']['size'];
$uploaddir = './public/tamplate/img/poli/'; // directory file
$dataArrayPoli = array (
$alamatfile = $uploaddir.$ImageName;
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
/* jika upload berhasil ke folder sever */
$dataArrayPoli = array(
'nama_poli' => $nama_poli,
'kode_poli' =>$kode_poli,
'deskripsi_poli'=>$deskripsi_poli,
'nama_poli' => $nama_poli,
'image_poli' => $ImageName,
'deskripsi_poli' => $deskripsi_poli,
'kode_poli' => $kode_poli,
);
$load = $param->loadkelolapoli($post->id_poli);
$table_poli = 'poli';
$where = 'id_poli='.$id_poli;
$param->updateGlobal($table_poli, $dataArrayPoli, $where);
$result->code = 0;
$result->info = 'ok';
$result->data = $load->data;
}else{
$result->code = 17;
$result->info = 'FAILED UPLOAD FILE to SERVER';
}
}else{
$result->info = 'File tidak boleh kosong';
}
);
$load = $param->loadkelolapoli($post->id);
// print_r($load);die;
$table_poli= 'poli';
$where = 'id_poli='.$id_poli;
// print_r ($where);die;
$param->updateGlobal($table_poli, $dataArrayPoli, $where);
$result->code = 0;
$result->info = 'ok';
$result->data = $load->data;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
......@@ -831,76 +803,41 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
try{
$fileupload = $_FILES['fileupload']['tmp_name'];
$nama_dokter = $post->inama_dokter;
$kode_dokter = $post->ikode_dokter;
$poli = $post->ipoli;
//print_r($poli);die;
if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name'];
$tipes = $_FILES['fileupload']['type'];
$size = $_FILES['fileupload']['size'];
$uploaddir = './public/tamplate/img/doctor/'; // directory file
$alamatfile = $uploaddir.$ImageName;
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
// print_r('berhasil');die;
/* jika upload berhasil ke folder sever */
$DokterPoli = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli,
'image_dokter' => $ImageName,
'id_condition' => 1,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
$DokterPoli = array (
);
$Dokter = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'image_dokter' => $ImageName,
);
$param->saveGlobal($Dokter, $table_dokter);
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $DokterPoli->data;
}else{
$result->code = 17;
$result->info = 'FAILED UPLOAD FILE to SERVER';
}
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli,
'id_condition' => 1,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
);
$Dokter = array (
}else{
$result->info = 'File tidak boleh kosong';
}
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
);
//print_r($poli);die;
// print_r($dataArraydokter);die;
$param->saveGlobal($Dokter, $table_dokter);
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArraydokter->data;
}catch (\Exception $exc) {
......@@ -926,80 +863,46 @@ class ApiController extends \Application\Master\GlobalActionController {
$param = new \Application\Model\Param($storage);
try{
$fileupload = $_FILES['fileupload']['tmp_name'];
$id_dokter = $post->id_dokter;
// print_r($id_dokter);die;
$nama_dokter = $post->inama_dokter;
$kode_dokter = $post->ikode_dokter;
$poli = $post->ipoli;
$condition = $post->icondition;
$id_dokter = $post->id;
$nama_dokter = $post->inama_dokter;
$kode_dokter = $post->ikode_dokter;
$poli = $post->ipoli;
$condition = $post->icondition;
if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name'];
$tipes = $_FILES['fileupload']['type'];
$size = $_FILES['fileupload']['size'];
$uploaddir = './public/tamplate/img/doctor/'; // directory file
$alamatfile = $uploaddir.$ImageName;
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
// print_r('berhasil');die;
/* jika upload berhasil ke folder sever */
$DokterPoli = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli,
'id_condition' =>$condition,
'image_dokter' => $ImageName,
$DokterPoli = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli,
'id_condition' =>$condition,
);
);
$Dokter = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
'image_dokter' => $ImageName,
$Dokter = array (
);
$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';
$result->data = $load->data;
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
);
}else{
$result->code = 17;
$result->info = 'FAILED UPLOAD FILE to SERVER';
}
$load = $param->loadkeloladokter($post->id);
// print_r($dataArraydokter);die;
$table_dokter_to_poli= 'dokter_to_poli';
$where = 'id_dokter='.$id_dokter;
// print_r ($where);die;
$param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where);
}else{
$result->info = 'File tidak boleh kosong';
}
// print_r($dataArraydokter);die;
$table_dokter= 'dokter';
$where = 'id_dokter='.$id_dokter;
// print_r ($where);die;
$param->updateGlobal($table_dokter, $Dokter, $where);
$result->code = 0;
$result->info = 'ok';
$result->data = $load->data;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
......@@ -1083,13 +986,11 @@ class ApiController extends \Application\Master\GlobalActionController {
try{
$nama_ruang = $post->inama_ruang;
$lantai = $post->ilantai;
$poli = $post->ipoli;
//print_r($poli);die;
$dataArrayruang = array (
'nama_ruang' =>$nama_ruang,
'lantai' =>$lantai,
'nama_ruang' =>'R '.$nama_ruang,
'id_poli' =>$poli,
'id_condition' => 1
);
......@@ -1130,7 +1031,6 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_ruang = $post->id;
$nama_ruang = $post->inama_ruang;
$poli = $post->ipoli;
$lantai = $post->ilantai;
$condition = $post->icondition;
......@@ -1139,7 +1039,6 @@ class ApiController extends \Application\Master\GlobalActionController {
'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli,
'lantai' =>$lantai,
'id_condition' =>$condition,
);
......@@ -1193,19 +1092,19 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadantrianmissAction(){
public function loadkelolaantrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$n
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadantrianmiss($post->id);
// print_r($load);die;
// print_r($load);die;
$load = $test->loadkelolaantrian($post->id);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
......@@ -1217,136 +1116,109 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadantrianunregisAction(){
$result = new Result();
public function loadRegisterEditAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$n
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$poli = new \Application\Model\Param($storage);
$load = $poli->loadRegisterPoli();
$loadc = $poli->loadCondition();
$listdata= array();
$listdata = array(
'poli' =>$load->data,
'condition' =>$loadc->data
);
// print_r($listdata);die;
$load = $test->loadantrianunregis($post->id);
// print_r($load);die;
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'Not Found';
$result->info = 'Not Found poli';
}
return $this->getOutput($result->toJson());
}
public function loadkelolapasienAction(){
$result = new Result();
public function loadRegisterPoliAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$poli = new \Application\Model\Param($storage);
$load = $poli->loadRegisterPoli();
$load = $test->loadkelolapasien($post->id_pasien);
// 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';
$result->info = 'Not Found poli';
}
return $this->getOutput($result->toJson());
}
public function loadRegisterDokterAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
public function editkelolapasienAction(){
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());
$dokter = new \Application\Model\Param($storage);
$load = $dokter->loadRegisterDokter($post->id_poli);
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 dokter';
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
try{
$id_pasien = $post->id_pasien;
$nama_pasien = $post->inama;
$ktp = $post->iktp;
$tanggal_lahir = $post->itanggal_lahir;
$tempat_lahir = $post->itempat_lahir;
$alamat = $post->ialamat;
$no_hp = $post->ino_hp;
}
$dataarraypasien = array (
'ktp' => $ktp,
'nama' =>$nama_pasien,
'tanggal_lahir' =>$tanggal_lahir,
'tempat_lahir' =>$tempat_lahir,
'alamat' =>$alamat,
'no_hp' =>$no_hp,
return $this->getOutput($result->toJson());
}
);
$load = $param->loadkelolapasien($post->id_pasien);
$table= 'pasien';
$where = 'id_pasien='.$id_pasien;
// print_r($where);die;
$param->updateGlobal($table, $dataarraypasien, $where);
$result->code = 0;
$result->info = 'ok';
$result->data = $load->data;
}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 deletekelolapasienAction(){
$result = new Result();
public function loadRegisterRuangAction(){
$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);
$ruang = new \Application\Model\Param($storage);
$tabel = 'pasien';
$where = 'id_pasien='.$post->id_pasien;
// print_r($where);die;
$res = $test->deleteGlobal($tabel, $where);
$load = $ruang->loadRegisterRuang($post->id_poli);
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';
......@@ -1355,9 +1227,8 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadantrianAction(){
public function loadpasienAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
......@@ -1367,120 +1238,12 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
// print_r($post->no_rekam_medis);die;
$load = $test->loadpasien($post->id, $post->no_rekam_medis);
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 loadRegisterEditAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$poli = new \Application\Model\Param($storage);
$load = $poli->loadRegisterPoli();
$loadc = $poli->loadCondition();
$listdata= array();
$listdata = array(
'poli' =>$load->data,
'condition' =>$loadc->data
);
// print_r($listdata);die;
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'Not Found poli';
}
return $this->getOutput($result->toJson());
}
public function loadRegisterPoliAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$poli = new \Application\Model\Param($storage);
$load = $poli->loadRegisterPoli();
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 poli';
}
return $this->getOutput($result->toJson());
}
public function loadRegisterDokterAction(){
$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);
$load = $dokter->loadRegisterDokter($post->id_poli);
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 dokter';
}
return $this->getOutput($result->toJson());
}
public function loadRegisterRuangAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$ruang = new \Application\Model\Param($storage);
$load = $ruang->loadRegisterRuang($post->id_poli);
// $id = $this->_getParam($test->loadAntrian($post->id_poli));
$load = $test->loadAntrian($post->id_poli);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
......@@ -1493,35 +1256,6 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadAntrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$antrian = new \Application\Model\Param($storage);
$load = $antrian->loadAntrian();
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 loadConditionAction(){
$result = new Result();
$request = $this->getRequest();
......@@ -1555,7 +1289,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$poli = new \Application\Model\Param($storage);
$load = $poli->loadPoli();
$load = $poli->loadPoli($post->$id_poli);
......@@ -1622,7 +1356,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->info = $result::INFO_SUCCESS;
$result->data = $listdata;
}else{
$result->code = 1;
$result->code = 1;
$result->info = 'Not Found';
}
......@@ -1640,7 +1374,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$idokter = $post->id;
$idokter = $post->iid;
$loadAntrianAdmin = $test->loadAntrianAdmin($idokter);
// print_r( $idokter);die;
......@@ -1690,36 +1424,50 @@ class ApiController extends \Application\Master\GlobalActionController {
$request = $this->getRequest();
$post = $request->getPost();
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
try{
$noantrian = $post->inoantrian;
$iddok = $post->idok;
$status = $post->istatus;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$dataarray = array(
'status_code' => $status,
);
$loadAntrianAdmin = $test->loadAntrianAdmin($iddok);
$noantrian = $post->inoantrian;
$iddok = $post->idok;
$status = $post->istatus;
$table = 'antrian_pasien';
$where = 'id_dokter='.$iddok.' and no_antrian='.$noantrian;
$test->updateGlobal($table, $dataarray, $where);
$dataarray = array(
'status_code' => $status,
);
$loadAntrianAdmin = $test->loadAntrianAdmin($iddok);
$table = 'antrian_pasien';
$where = 'id_dokter='.$iddok.' and no_antrian='.$noantrian;
$test->updateGlobal($table, $dataarray, $where);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loadAntrianAdmin->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loadAntrianAdmin->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}
}
return $this->getOutput($result->toJson());
}
public function updateantrianmissAction(){
$result = new Result();
......@@ -1758,52 +1506,6 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function updateunregisterAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$id_pasien= $post->id_pasien;
$dataarray = array(
'id_pasien' => null,
'create_date' => null,
'nama' => null,
'tempat_lahir' => null,
'tanggal_lahir' => null,
'alamat' => null,
'no_rekam_medis'=> null,
'no_hp' => null,
'ktp' => null,
'status_code' => null,
);
// $loadunreg = $test->loadantrianunregis($id_pasien);
$table = 'antrian_pasien';
$where = 'id_pasien='.$id_pasien;
$test->updateGlobal($table, $dataarray, $where);
// print_r($where);
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $dataarray->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function tampildokterAction(){
$result = new Result();
......@@ -1832,182 +1534,4 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function tampilpoliAction(){
$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);
$loadpoli = $test->tampilpoli($post->id);
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loadpoli->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function tampildatapoliAction(){
$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);
$loaddatapoli = $test->tampildatapoli($post->id);
// print_r($loaddatapoli);die;
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loaddatapoli->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadjumlahpasienAction(){
$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->loadjumlahpasien();
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 loadpasiendalamantrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadpasiendalamantrian();
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 loadpasienterlewatAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadpasienterlewat();
// 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 loadterlayaniAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadterlayani();
// 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 loadtotalantrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadtotalantrian();
// 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());
}
}
\ No newline at end of file
......@@ -116,38 +116,16 @@ class QueueController extends \Application\Master\GlobalActionController
}
public function poliAction()
{
$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->appendScript(' var id = null');
$this->headScript->appendFile('/action-js/antrian-js/action-poli.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function datapoliAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
$id = $_GET["id"];
// print_r($id);die;
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $id. '"');
$this->headScript->appendFile('/action-js/antrian-js/action-poli.js');
$this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutQueue");
return $view;
......@@ -180,8 +158,18 @@ class QueueController extends \Application\Master\GlobalActionController
//print_r($uri);die;
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// print_($getpath);die;
$decodeid = base64_decode($getpath[3]);
$decodeiddok = base64_decode($getpath[4]);
// $decodeidpol = base64_decode($getpath[5]);
// $decodeidant = base64_decode($getpath[6]);
// print_r($decodeiddok );die;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
......@@ -196,7 +184,7 @@ class QueueController extends \Application\Master\GlobalActionController
foreach($codeCounter->data as $result) {
}
//print_r($codeCounter);die;
// print_r($codeCounter);
$view->setVariable('no_rekam_medis', $result['no_rekam_medis']);
$view->setVariable('nama', $result['nama']);
$view->setVariable('nama_dokter', $result['nama_dokter']);
......@@ -204,6 +192,7 @@ class QueueController extends \Application\Master\GlobalActionController
$view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('kode_dokter', $result['kode_dokter']);
$view->setVariable('sisa_antrian', $result['sisa_antrian']);
// print_r($result);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
......@@ -212,12 +201,13 @@ class QueueController extends \Application\Master\GlobalActionController
$this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"');
$this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"');
$this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendScript(' var sisa_antrian = "' . $result['sisa_antrian'] . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-cetak.js');
$this->layout("layout/layoutQueue");
return $view;
}
}
......@@ -41,6 +41,7 @@ class UmumController extends \Application\Master\GlobalActionController
{
$view = new ViewModel();
$result = new Result();
$today = gmdate("d M Y ", time()+60*60*7);
$view->setVariable('today', $today);
......@@ -48,27 +49,40 @@ class UmumController extends \Application\Master\GlobalActionController
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$decodeid = base64_decode($getpath[3]);
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js');
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/loadantrian?id_poli=$decodeid",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('id_poli' => $decodeid),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// // echo $response;
$this->layout("layout/layoutUmum");
return $view;
}
public function tampilanantrianAction()
{
$view = new ViewModel();
$result = new Result();
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js');
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum");
return $view;
}
}
......@@ -61,20 +61,16 @@ class Param extends Mapper {
$data = $this->_storage->loadUserData($id,$iddok);
return $data;
}
public function loadpasien($id = null, $norm = null){
$data = $this->_storage->loadpasien($id, $norm);
return $data;
}
public function loaddatapasien($id){
$data = $this->_storage->loaddatapasien($id);
return $data;
}
public function cekpasien($no_rekam_medis = null,$ktp = null ){
$data = $this->_storage->cekpasien($no_rekam_medis, $ktp);
public function loadsisaantrian($id,$no){
$data = $this->_storage->loadsisaantrian($id,$no);
return $data;
}
public function cekktp($no_rekam_medis, $ktp){
$data = $this->_storage->cekktp($no_rekam_medis, $ktp);
public function cekpasien($no_rekam_medis = null){
$data = $this->_storage->cekpasien($no_rekam_medis);
return $data;
}
......@@ -106,10 +102,6 @@ class Param extends Mapper {
$data = $this->_storage->loadkelolapoli($id);
return $data;
}
public function loadkelolapasien($id = null){
$data = $this->_storage->loadkelolapasien($id);
return $data;
}
public function loadkeloladokter($id = null){
$data = $this->_storage->loadkeloladokter($id);
return $data;
......@@ -122,16 +114,12 @@ class Param extends Mapper {
$data = $this->_storage->updatekelolaantrian($idpasien,$iddok);
return $data;
}
public function loadantrianmiss($id){
$data = $this->_storage->loadantrianmiss($id);
return $data;
}
public function loadantrianunregis($id){
$data = $this->_storage->loadantrianunregis($id);
public function loadkelolaantrian($id){
$data = $this->_storage->loadkelolaantrian($id);
return $data;
}
public function loadPoli($id = null){
$data = $this->_storage->loadPoli($id);
public function loadPoli($id_poli = null){
$data = $this->_storage->loadPoli($id_poli);
return $data;
}
public function loadPilihAntrian($iddok = null){
......@@ -155,38 +143,12 @@ class Param extends Mapper {
return $data;
}
public function loadAntrian($id = null){
$data = $this->_storage->loadAntrian($id);
return $data;
}
public function loadjumlahpasien(){
$data = $this->_storage->loadjumlahpasien();
return $data;
}
public function loadpasiendalamantrian(){
$data = $this->_storage->loadpasiendalamantrian();
return $data;
}
public function loadpasienterlewat(){
$data = $this->_storage->loadpasienterlewat();
return $data;
}
public function loadterlayani(){
$data = $this->_storage->loadterlayani();
return $data;
}
public function loadtotalantrian(){
$data = $this->_storage->loadtotalantrian();
return $data;
}
public function tampilpoli($id = null){
$data = $this->_storage-> tampilpoli($id);
return $data;
}
public function tampildatapoli($id = null){
$data = $this->_storage-> tampildatapoli($id);
public function loadAntrian($id_poli){
$data = $this->_storage->loadAntrian($id_poli);
return $data;
}
public function tampildokter(){
$data = $this->_storage->tampildokter();
return $data;
......
......@@ -322,7 +322,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter,antrian_pasien.id_pasien, dokter_to_poli.id_dokter
$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
FROM antrian_pasien
INNER JOIN dokter_to_poli
ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter
......@@ -359,52 +359,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function loadpasien($id = null, $norm = null){
$result = new Result();
try {
$sql = " SELECT * FROM pasien";
if($id){
$sql .= " WHERE id_pasien = $id ";
}
if($norm){
$sql .= " WHERE no_rekam_medis = '$norm'";
}
$sql .= " ORDER BY no_rekam_medis ASC";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
// print_r($listdata);die;
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 loadMaxCounter(){
......@@ -440,85 +394,16 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result;
}
public function loaddatapasien($id){
$result = new Result();
try {
$sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
// 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 loadjumlahpasien(){
$result = new Result();
try {
$sql = " SELECT count(id_pasien) FROM 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 loadtotalantrian(){
public function loadsisaantrian($id,$no){
$result = new Result();
try {
$sql = " SELECT count(id_dokter) FROM antrian_pasien ";
$sql = " SELECT COUNT(id_pasien)
FROM antrian_pasien
WHERE id_pasien is not null AND
id_dokter =$id AND (status_code <> 50 and status_code <> 60) and no_antrian < $no";
// print_r($sql);die;
......@@ -537,43 +422,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$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 loadpasiendalamantrian(){
$result = new Result();
try {
$sql = " SELECT count(id_pasien) FROM antrian_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';
......@@ -588,49 +437,13 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function loadpasienterlewat(){
$result = new Result();
try {
$sql = " SELECT count(status_code) FROM antrian_pasien WHERE status_code= 60 ";
// 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 loadterlayani(){
public function loaddatapasien($id){
$result = new Result();
try {
$sql = " SELECT count(status_code) FROM antrian_pasien
WHERE status_code = 50 ";
$sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
// print_r($sql);die;
......@@ -703,13 +516,13 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
public function cekpasien($no_rekam_medis){
$result = new Result();
try {
$sql = " SELECT p.id_pasien, ap.no_rekam_medis, ap.status_code,ap.no_antrian ,ap.no_antrian, ap.id_antrian, ap.nama FROM pasien p
LEFT JOIN antrian_pasien ap
ON ap.id_pasien = p.id_pasien
try {
WHERE p.no_rekam_medis = '$no_rekam_medis' ";
$sql = " SELECT p.id_pasien, ap.no_rekam_medis, ap.status_code,ap.no_antrian ,ap.no_antrian, ap.id_antrian,ap.nama FROM pasien p
LEFT JOIN antrian_pasien ap
ON ap.id_pasien = p.id_pasien
WHERE p.no_rekam_medis='$no_rekam_medis' ";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
......@@ -738,57 +551,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function cekktp($no_rekam_medis, $ktp){
$result = new Result();
try {
$sql = "SELECT no_rekam_medis FROM pasien WHERE no_rekam_medis = '$no_rekam_medis' ";
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
array_push($listdata, $val);
}
if ($listdata) {
$sqlktp = "SELECT ktp, no_rekam_medis FROM pasien WHERE no_rekam_medis = '$no_rekam_medis' AND ktp = '$ktp'";
$stmtktp = $this->_db->query($sqlktp);
$resdataktp = $stmtktp->execute();
$listdataktp = array();
foreach($resdataktp as $val){
array_push($listdataktp, $val);
}
if($listdataktp){
$result->code = 0;
$result->info = 'OK';
$result->data = $listdataktp;
}else{
$result->code = 1;
$result->info = 'your ktp wrong';
$result->data = $listdata;
}
}else{
$result->code = 2;
$result->info = 'Your no_rekam_medis wrong';
}
}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 loadRegisterPoli($id = null){
$result = new Result();
......@@ -968,49 +730,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$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){
$result = new Result();
try {
$sql = " SELECT * FROM pasien";
if($id){
$sql .= " WHERE id_pasien = $id ";
}
$sql .= " ORDER BY no_rekam_medis ASC";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
......@@ -1088,13 +807,13 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = " SELECT dokter_to_poli.id_dokter, dokter_to_poli.nama_dokter, dokter_to_poli.kode_dokter , poli.id_poli, poli.nama_poli,dokter_to_poli.image_dokter, condition.condition,condition.id_condition
FROM dokter_to_poli
INNER JOIN poli
ON dokter_to_poli.id_poli = poli.id_poli
INNER JOIN condition
ON condition.id_condition = dokter_to_poli.id_condition
";
$sql = " SELECT dokter_to_poli.id_dokter, dokter_to_poli.nama_dokter, dokter_to_poli.kode_dokter , poli.id_poli, poli.nama_poli, condition.condition,condition.id_condition
FROM dokter_to_poli
INNER JOIN poli
ON dokter_to_poli.id_poli = poli.id_poli
INNER JOIN condition
ON condition.id_condition = dokter_to_poli.id_condition
";
if($id){
$sql .= " Where dokter_to_poli.id_dokter = $id";
......@@ -1139,7 +858,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition, ruang.lantai
$sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition
FROM RUANG
INNER JOIN poli
ON ruang.id_poli = poli.id_poli
......@@ -1183,7 +902,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function loadantrianmiss($id){
public function loadkelolaantrian($id){
$result = new Result();
try {
......@@ -1203,53 +922,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
// 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 loadantrianunregis($id){
$result = new Result();
try {
$sql = "SELECT antrian_pasien.id_pasien, antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.ktp,antrian_pasien.no_rekam_medis,poli.nama_poli,dokter_to_poli.nama_dokter,dokter_to_poli.id_dokter FROM antrian_pasien
INNER JOIN poli
on poli.id_poli = antrian_pasien.id_poli
INNER JOIN dokter_to_poli
on dokter_to_poli.id_dokter = antrian_pasien.id_dokter
WHERE id_pasien IS NOT NULL
ORDER BY poli.nama_poli asc
";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
......@@ -1338,9 +1010,16 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql = " SELECT poli.id_poli, poli.nama_poli
FROM antrian_pasien
INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli
GROUP BY poli.id_poli
ORDER BY nama_poli asc";
ON antrian_pasien.id_poli = poli.id_poli ";
if($id){
$sql .=" WHERE poli.id_poli=$id";
}
$sql .= " GROUP BY poli.id_poli";
......@@ -1420,11 +1099,11 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = "SELECT dokter_to_poli.id_dokter,dokter_to_poli.image_dokter, dokter_to_poli.nama_dokter , poli.nama_poli , dokter_to_poli.kode_dokter
$sql = "SELECT dokter_to_poli.id_dokter,dokter_to_poli.image, dokter_to_poli.nama_dokter , poli.nama_poli
FROM dokter_to_poli
INNER JOIN poli
ON dokter_to_poli.id_poli = poli.id_poli
ORDER BY nama_poli ASC ";
ON dokter.id_poli = poli.id_poli
ORDER BY nama_poli ASC ";
// $sql .= " ORDER BY jumlah DESC";
......@@ -1460,102 +1139,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function tampildatapoli($id){
$result = new Result();
try {
$sql = "SELECT * FROM poli
where id_poli=$id";
// $sql .= " ORDER BY jumlah DESC";
//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);
}
// print_r($listdata);die;
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 tampilpoli($id= null){
$result = new Result();
try {
if ($id){
$sql = "SELECT poli.nama_poli, poli.kode_poli, poli.deskripsi_poli ,poli.id_poli, poli.image_poli, dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter, dokter_to_poli.kode_dokter, dokter_to_poli.image_dokter
FROM poli
INNER JOIN dokter_to_poli
ON dokter_to_poli.id_poli = poli.id_poli" ;
$sql .= " where poli.id_poli = $id";
$sql .= " ORDER BY poli.nama_poli ASC";
} else {
$sql = "SELECT * FROM poli";
}
// 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);
}
// print_r($listdata);die;
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 loadPilihAntrian($iddok ){
$result = new Result();
......@@ -1656,17 +1239,29 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result;
}
public function loadAntrian($id = null){
public function loadAntrian($id_poli){
$result = new Result();
try {
$sql = " SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang FROM antrian_pasien idd
LEFT JOIN dokter_to_poli dok on idd.id_dokter = dok.id_dokter
LEFT JOIN poli pol on idd.id_poli = pol.id_poli
LEFT JOIN ruang rur on idd.id_ruang = rur.id_ruang
WHERE idd.id_pasien is not null and status_code=20 or status_code=30 or status_code =40";
$sql="
SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang ,idd.status_code,idd.id_poli
FROM antrian_pasien idd
LEFT JOIN dokter_to_poli dok
on idd.id_dokter = dok.id_dokter
LEFT JOIN poli pol
on idd.id_poli = pol.id_poli
LEFT JOIN ruang rur
on idd.id_ruang = rur.id_ruang
LEFT JOIN counter_status cs
on cs.status_code = idd.status_code
WHERE idd.id_pasien is not null
and
(cs.status_code=30 or cs.status_code =40) and
idd.id_poli=$id_poli
";
$stmt = $this->_db->query($sql);
......
<!-- <script type="text/javascript">
// 1 detik = 1000
window.setTimeout("waktu()",1000);
function waktu() {
var tanggal = new Date();
setTimeout("waktu()",1000);
document.getElementById("tanggalku").innerHTML
= tanggal.getHours()+":"+tanggal.getMinutes()+":"+tanggal.getSeconds();
}
</script> -->
<!-- Page header -->
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<h4 style="font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4>
</div>
<div class="heading-elements">
<div class="heading-btn-group">
<div style="color: #fff9ff;font-size: 50px;font-weight: 600;margin-top:-20px;">
<span id="tanggalku"></span>
<div class="row">
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<h4 style="color: #fff;font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4>
</div>
<div class="heading-elements">
<div class="heading-btn-group">
<div style="color: #fff;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div>
<div style="color: #fff9ff;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div>
</div>
</div>
</div>
<div class="justify-content-center">
<div class="col-sm-200" >
<div class="card mb-3 alert alert-info alert-styled-left alert-arrow-left alert-component col-sm-100" style="border-color: #e94c72;background: #faebd73b;width: 1300px;margin-left: 100px;">
<div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span > Nomer</span></p>
<h1 class="error-title" style=" font-weight: bold;font-size:100px;font-family: Times New Roman, Times, serif;color: #fff"><span id="no_antrian"></span></h1>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span > Please Proceed To</span></p>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span id="ruang"></span></p>
<!-- <div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
<div><input type="hidden" value="nama_ruang" id="nama_ruang" /><span style="visibility:hidden" id="nama_ruang"></span></div> -->
</div>
</div>
<div id="listdata" class="card-deck" style="padding-left: 100px;padding-right: 100px;width: 2000px;">
</div>
<div class="card">
<h5 class="card-header">Featured</h5>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<!-- <div id="box" class="wrap">
<!--
<div class="col-md-7 mt-25">
<div class="card mb-3">
<div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: grey"><span > Number</span></p>
<h1 class="error-title" style=" font-weight: bold;font-size:215px;font-family: Times New Roman, Times, serif;color: red"><span id="no_antrian"></span></h1>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: grey"><span > Please Proceed To</span></p>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: red"><span > Ruang 1.1</span></p>
<div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
<div><input type="hidden" value="nama_ruang" id="nama_ruang" /><span style="visibility:hidden" id="nama_ruang"></span></div> -->
<!-- </div>
</div>
</div> -->
</div> -->
<!-- /navigation -->
\ No newline at end of file
<div class="container"></div>
<form class="form-inline">
<div class="form-group form-control-lg ">
......
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Jumlah Pasien</div>
<div id="jumlah_pasien" class="h5 mb-0 font-weight-bold text-gray-800" > </div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">Pasien Dalam Antrian</div>
<div id="pasien_antrian" class="h5 mb-0 font-weight-bold text-gray-800"></div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">Pasien Terlewat</div>
<div class="row no-gutters align-items-center">
<div class="col-auto">
<div id="pasien_terlewat" class="h5 mb-0 mr-3 font-weight-bold text-gray-800"></div>
</div>
</div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Pending Requests Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">Pasien Terlayani</div>
<div id="jumlah_terlayani" class="h5 mb-0 font-weight-bold text-gray-800"></div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Pie Chart -->
<div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Revenue Sources</h6>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChart"></canvas>
</div>
<div class="mt-4 text-center small">
<span class="mr-2">
<i class="fas fa-circle text-primary"></i> Direct
</span>
<span class="mr-2">
<i class="fas fa-circle text-success"></i> Social
</span>
<span class="mr-2">
<i class="fas fa-circle text-info"></i> Referral
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
>
</div>
</div>
<!-- /.container-fluid -->
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
......@@ -6,21 +12,16 @@
<button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button>
<br>
<br>
<table class="table table-bordered" id="dataTable">
<thead>
<tr>
<tr class="table-infos">
<th style="width: 70px">NO</th>
<th style="width: 70px">NO</>
<!-- <th colspan="" class=" thLeftText">Id Poli</th> -->
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Kode Dokter</th>
<th colspan="" class=" thLeftText">Kondisi Dokter</th>
<th colspan="" class=" thLeftText">Gambar Dokter</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
......@@ -52,7 +53,7 @@
<div class="form-group">
<label>Nama Poli</label>
<select name="poli" id="poli" class="form-control" >
<select name="nama_poli" id="poli" class="form-control" >
<option disable selected> Pilih </option>
</select>
......@@ -66,10 +67,11 @@
<input type="input" id="kode_dokter" name="kode_dokter" class="form-control" placeholder="Kode Dokter" /></input>
</div>
<div class="form-group " >
<label>Gambar Dokter</label>
<input type="file" name="gambar_dokter" id="gambar_dokter" class="form-control-file">
</div>
<!-- <div class="form-group">
<label>Foto Dokter</label>
<input type="image" id="image" name="image" class="form-control" required /></input>
</div> -->
<div class="modal-footer">
<button button type="button" class="btn btn-primary" id="tambah">Add</button>
......@@ -118,11 +120,10 @@
</select>
</div>
<div class="form-group " >
<label>Gambar Dokter</label>
<input type="file" name="gambar_dokteredt" id="gambar_dokteredt" class="form-control-file">
</div>
<!-- <div class="form-group">
<label>Foto Dokter</label>
<input type="image" id="image" name="image" class="form-control" required /></input>
</div> -->
<div class="modal-footer">
......@@ -137,3 +138,6 @@
</div>
</div>
</body>
</html>
......@@ -3,19 +3,31 @@
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Pasien</h1>
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Antrian Pasien</h1>
<!-- <form class="form-inline">
<div class="form-group form-control-lg ">
<label >Pilih poli </label>
<select name="nama_poli" id="poli" class="form-control" >
<option disabled selected>Pilih </option>
</select>
</div>
<div class="form-group form-control-lg">
<label>Pilih dokter</label> <br>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form> -->
<br>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">NO Rekam Medis</th>
<th colspan="" class=" thLeftText">No Induk Kependudukan (NIK)</th>
<th colspan="" class=" thLeftText">NO Antrian Pasien</th>
<th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">Tempat Lahir </th>
<th colspan="" class=" thLeftText">Tanggal Lahir</th>
<th colspan="" class=" thLeftText">Alamat</th>
<th colspan="" class=" thLeftText">No Hp</th>
<th colspan="" class=" thLeftText">Tanggal Pendaftaran</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Status</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
......@@ -28,65 +40,3 @@
</div>
</div>
<div id="Editdata" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Data Dokter</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<form id="myForm" >
<input type="hidden" id="id_pasien" class="form-control" /></input>
<div class="form-group">
<label> No Rekam Medis</label><br>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" disabled ></input>
</div>
<div class="form-group">
<label>No Induk Kependudukan (NIK)</label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk Kependudukan (NIK)" max="9999999999999999" maxlength="16"></input>
</div>
<div class="form-group">
<label>Nama Pasien</label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input>
</div>
<div class="form-group ">
<label>Tempat Lahir</label>
<textarea type="text" id="tempat_lahir" class="form-control " placeholder="Tempat Lahir" ></textarea >
</div>
<div class="form-group">
<label>Tanggal Lahir</label>
<input type="date" id="tanggal_lahir" class="form-control" /></input>
</div>
<div class="form-group" >
<label>Alamat</label>
<textarea type="text" id="alamat" rows="3" class="form-control" placeholder="Alamat"/></textarea >
</div>
<div class="form-group">
<label>No HP</label>
<input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input>
</div>
<div class="modal-footer">
<button button type="button" class="btn btn-primary" id="edit">Edit</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
</div>
</div>
......@@ -29,7 +29,6 @@
<th>Nama Poli</th>
<th>Kode Poli</th>
<th>Deskripsi Poli</th>
<th>Gambar Poli</th>
<th>Action</th>
</tr>
</thead>
......@@ -58,25 +57,29 @@
<div class="form-group">
<label>Nama Poli</label>
<input type="input" id="nama_poli" name="nama_poli" class="form-control" placeholder="Nama Poli" required ></input>
<input type="input" id="nama_poli" name="nama_poli" class="form-control" placeholder="Nama Poli" required /></input>
</select>
</div>
<div class="form-group">
<label>Kode Poli</label>
<input type="input" id="kode_poli" name="kode_poli" class="form-control" placeholder="Kode Poli" required ></input>
<input type="input" id="kode_poli" name="kode_poli" class="form-control" placeholder="Kode Poli" required /></input>
</div>
<div class="form-group">
<label>Deskripsi Poli</label>
<textarea type="input" style="height:100px;" id="deskripsi_poli" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
<textarea type="type" id="deskripsi_poli" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
</div>
<div class="form-group " >
<!-- <div class="form-group ">
<label>Gambar Poli</label>
<input type="file" name="gambar_poli" id="gambar_poli" class="form-control-file">
</div>
<input type="file" name="uploadimage" id="uploadimage" class="form-control">
</div> -->
<div class="modal-footer">
<button type="submit" class="btn btn-primary" id="tambah">Add</button>
<button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button button type="button" class="btn btn-primary" id="tambah">Add</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</div>
......@@ -103,23 +106,23 @@
<div class="form-group">
<label>Nama Poli</label>
<input type="input" id="nama_poliEdt" name="nama_poli" class="form-control" placeholder="Nama Poli" required ></input>
<input type="input" id="nama_poliEdt" name="nama_poli" class="form-control" placeholder="Nama Poli" required /></input>
</select>
</div>
<div class="form-group">
<label>Kode Poli</label>
<input type="input" id="kode_poliEdt" name="kode_poli" class="form-control" placeholder="Kode Poli" required></input>
<input type="input" id="kode_poliEdt" name="kode_poli" class="form-control" placeholder="Kode Poli" required /></input>
</div>
<div class="form-group">
<label>Deskripsi Poli</label>
<textarea type="input" style="height:100px;" id="deskripsi_poliEdt" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
<textarea type="type" id="deskripsi_poliEdt" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
</div>
<div class="form-group ">
<!-- <div class="form-group ">
<label>Gambar Poli</label>
<input type="file" name="gambar_poliedt" id="gambar_poliedt" class="form-control-file"></input>
</div>
<input type="file" name="uploadimage" id="uploadimage" class="form-control">
</div> -->
<div class="modal-footer">
<button button type="button" class="btn btn-primary" id="edit">Edit</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
......@@ -133,4 +136,3 @@
</div>
......@@ -26,7 +26,6 @@
<th style="width: 70px">NO</th>
<!-- <th colspan="" class=" thLeftText">Id Poli</th> -->
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Lantai</th>
<th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Kondisi Ruang</th>
<th colspan="" class=" thLeftText">Action</th>
......@@ -63,17 +62,13 @@
<option disable selected> Pilih </option>
</select>
</div>
<div class="form-group">
<label>Lantai</label>
<input type="input" id="lantai" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan" required /></input>
</div>
<div class="form-group">
<label>Ruangan</label>
<input type="input" id="nama_ruang" name="nama_ruang" class="form-control" placeholder="Nama Ruangan" required /></input>
<input type="input" id="nama_ruang" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="tambah">Add</button>
<button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button button type="button" class="btn btn-primary" id="tambah">Add</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
......@@ -101,10 +96,6 @@
</select>
</div >
<div class="form-group">
<label>Lantai</label>
<input type="input" id="lantaiedt" name="lantai" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
</div>
<div class="form-group">
<label>Ruangan</label>
<input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
......
......@@ -12,7 +12,7 @@
<thead>
<tr class="table-infos">
<th style="">NO</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Jenis Layanan (Poli)</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th>
......@@ -50,7 +50,7 @@
<form id="myForm" >
<div class="form-group">
<label>Nama Poli</label>
<label>Jenis Layanan</label>
<select name="nama_poli" id="poli" class="form-control" require>
<option disable selected> Pilih </option>
......@@ -134,7 +134,7 @@
<input type="input" id="id_register" class="form-control" /></input>
<div class="form-group">
<label>Nama Poli</label>
<label>Jenis Layanan</label>
<div class="card" >
<div class="card-body" style="padding: 0.5rem;" id="poliedt" >
</div>
......
<script type="text/javascript">
// 1 detik = 1000
window.setTimeout("waktu()",1000);
function waktu() {
var tanggal = new Date();
setTimeout("waktu()",1000);
document.getElementById("tanggalku").innerHTML
= tanggal.getHours()+":"+tanggal.getMinutes()+":"+tanggal.getSeconds();
}
</script>
<!-- Page header -->
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<div style=" text-align: center;color: #808080;font-family: Times New Roman, Times, serif;font-size: 50px;font-weight: 600;margin-top:-20px;">
<span id="tanggalku"></span>
</div>
<div style="text-align: center;color: #808080;font-family: Times New Roman, Times, serif;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div>
</div>
<!-- /header content -->
</div>
<!-- /page header -->
<div id="box" class="wrap">
\ No newline at end of file
......@@ -5,9 +5,12 @@
<div class="col-lg-5 col-xl-5">
<div class="banner_text">
<div class="banner_text_iner">
<h5>Kami di sini untuk perawatan Anda</h5>
<h1>Perawatan Terbaik</h1>
<p>Dalam kesehatan terdapat kebebasan. Kesehatan adalah hal paling pertama dalam semua kebebasan.
<h5>We are here for your care</h5>
<h1>Best Care &
Better Doctor</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing
elit sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Quis ipsum suspendisse ultrices gravida.Risus cmodo viverra </p>
<a href="<?php echo $this->basePath('queue/cekdatapasien');?>"class="btn_2">Registrai Antrian</a>
</div>
......
......@@ -42,13 +42,8 @@ input::-webkit-inner-spin-button {
<div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" ></input>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" style="width: 950px;display:inline;"></input>
</div>
<!-- <div class="form-group">
<label> <h5>No Induk Kependudukan (NIK)</h5></label><br>
<input type="number" id="ktp" placeholder="No Induk Kependudukan (NIK)" class="form-control"max="9999999999999999" maxlength="16" ></input>
</div> -->
<p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p>
<a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a>
</form>
......
......@@ -3,6 +3,7 @@
<br>
<br>
<br>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
......@@ -89,7 +90,21 @@
<h3><?php echo $this->kode_dokter ?><?php echo $this->no_antrian ?></label></h3>
</div>
</div>
<br>
<br>
<div class="row">
<div class="col-sm-2">
<h3>Sisa Antrian</h3>
</div>
<div class="col-sm-1">
<h3>:</h3>
</div>
<div class="col-sm-6">
<h3><?php echo $this->sisa_antrian ?></label></h3>
</div>
</div>
<br>
</div>
</div>
......
......@@ -5,7 +5,6 @@ input::-webkit-inner-spin-button {
margin: 0;
}
</style>
......@@ -42,22 +41,14 @@ input::-webkit-inner-spin-button {
<input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group">
<label><h5>No Induk Kependudukan (NIK)</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk Kependudukan (NIK)" max="9999999999999999" maxlength="16"></input>
<label><h5>No Induk KTP</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk KTP" max="9999999999999999" maxlength="16"></input>
</div>
<div class="form-group">
<label><h5>Nama Pasien</h5></label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input>
</div>
<!-- <div class="form-group">
<label><h5>Jenis Kelamin</h5></label> <br>
<input type="radio" id="male" name="gender" value="male">
<label for="male"><h5>Laki-laki </h5></label>
<input type="radio" id="female" name="gender" value="female">
<label for="female"><h5>Perempuan </h5></label>
</div> -->
<div class="form-group ">
<label><h5>Tempat Lahir</h5></label>
......@@ -77,9 +68,7 @@ input::-webkit-inner-spin-button {
<label><h5>No HP</h5></label>
<input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input>
</div>
</form>
</div>
......
......@@ -63,6 +63,9 @@ input[type="picked"] + label {
width : 55px;
cursor:not-allowed;
text-align:center;
}
......@@ -179,6 +182,9 @@ input[type="done"] + label {
<div class="form-group ">
<input type="hidden" id="tempat_lahir" class="form-control "disabled ></input>
</div>
<div class="form-group ">
<input type="hidden" id="sisa_antrian" class="form-control "disabled ></input>
</div>
<div class="form-group">
<input type="hidden" id="tanggal_lahir" class="form-control"disabled /></input>
......
......@@ -20,13 +20,13 @@
<!-- breadcrumb start-->
<!--::doctor_part start::-->
<section class="doctor_part single_page_doctor_part" style="padding:20px;">
<section class="doctor_part single_page_doctor_part">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8" style=" height: 75px; ">
<div class="col-xl-8">
<div class="section_tittle text-center">
<h2 > Beberapa dokter di rumah sakit</h2>
<h2> Dokter </h2>
<p>Beberapa dokter di rumah sakit ini</p>
</div>
</div>
</div>
......@@ -34,5 +34,26 @@
<div class="row dokter">
</div>
<!-- <div class="row">
<div class="col-sm-6 col-lg-3">
<div class="single_blog_item">
<div class="single_blog_img">
<img src="<?php $this->basePath('samss/') ?>/tamplate/img/doctor/doctor_1.png" alt="doctor">
</div>
<div class="single_text">
<div class="single_blog_text">
<h3>DR Adam Billiard</h3>
<p> Spesialis Umum</p>
</div>
</div>
</div>
</div>
</div> -->
</div>
</section>
<!--::doctor_part end::-->
\ No newline at end of file
......@@ -20,18 +20,46 @@
<!-- breadcrumb start-->
<!-- feature_part start-->
<section class="doctor_part single_page_doctor_part" style="padding:0px;" >
<section class="feature_part">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8">
<div class="section_tittle text-center">
<h2> Poli Kami </h2>
<h2>Poli Kami</h2>
</div>
</div>
</div>
<div class="row poli">
<div class="row justify-content-between align-items-center">
<div class="col-lg-3 col-md-4 col-xs-6 thumb">
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/gigi.png" alt=""></span>
<h4>Poli Gigi</h4>
<p>Poli gigi adalah...</p>
</div>
</div>
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/mata.png" alt=""></span>
<h4>Poli Mata</h4>
<p>Poli mata adalah...</p>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12">
<div class="single_feature_img">
<img src="<?php $this->basePath('') ?>/tamplate/img/service.png" alt="">
</div>
</div>
<div class="col-lg-3 col-sm-12">
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/umum.png" alt=""></span>
<h4>Poli Umum</h4>
<p>Poli umum adalah...</p>
</div>
</div>
</div>
</div>
</div>
</section>
......
......@@ -57,7 +57,7 @@
<script src="<?php $this->basePath();?>/tamplateadmin/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<script src="<?php $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script>
<!-- Page level custom scripts -->
<script src="<?php $this->basePath();?>/tamplateadmin/vendor/chart.js/Chart.min.js"></script>
<!-- <script src="<?php $this->basePath();?>/tamplateadmin/js/demo/datatables-demo.js"></script> -->
<body id="page-top">
......@@ -120,24 +120,13 @@
<div class="sidebar-heading" >
Feature
</div>
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages" aria-expanded="true" aria-controls="collapsePages">
<i class="fas fa-fw fa-table"></i>
<span>Kelola Antrian Pasien</span>
</a>
<div id="collapsePages" class="collapse" aria-labelledby="headingPages" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item"href="<?php echo $this->basePath('admin/antrianterlewat') ?>">Antrian Terlewat</a>
<a class="collapse-item"href="<?php echo $this->basePath('admin/antrianunregister') ?>">Antrian Unregister</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/kelolapasien') ?>">
<i class="fas fa-fw fa-table"></i>
<span>Kelola Pasien </span>
<span>Kelola Antrian </span>
</a>
</li>
......
......@@ -43,15 +43,6 @@
float:left; margin:5px;
margin-bottom:1px;
}
#h6a {
display: block;
margin-block-start: 0em;
margin-block-end: 0em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
</style>
<body>
......@@ -63,7 +54,9 @@
<div class="col-lg-12">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="<?php echo $this->basePath('queue/beranda');?>"> <img src="<?php echo $this->basePath();?> /tamplate/img/logo.png" alt="logo"> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse main-menu-item justify-content-center"
......@@ -73,20 +66,18 @@
<a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi Antrian </a>
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi </a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/') ?>">Pilih Antrian</a>
</li> -->
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link " href="<?php echo $this->basePath('user/login') ?>">Login</a>
</li>
-->
</ul>
</div>
</nav>
......@@ -114,18 +105,22 @@
<div class="row justify-content-between">
<div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget">
<a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/beranda') ?>/tamplate/img/logo.png" alt="#"> </a>
<p>Hidup sehat adalah hidup sejahtera dan bahagia yang berawal dari diri kita sendiri</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor </p>
<div class="social_logo">
<a href="#"><i class="ti-facebook"></i></a>
<a href="#"> <i class="ti-twitter"></i> </a>
<a href="#"><i class="ti-instagram"></i></a>
<a href="#"><i class="ti-skype"></i></a>
</div>
</div>
<div class="col-xl-9 col-sm-6 col-md-4 single-footer-widget">
<h4>Quick Links</h4>
<ul>
<li><a href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a></li>
<li><a href="<?php echo $this->basePath('queue/pocekdatapasienli') ?>">Registrasi Antrian</a></li>
<li><a href="<?php echo $this->basePath('queue/dokter') ?>">Dokter</a></li>
<li><a href="<?php echo $this->basePath('queue/poli') ?>">Poli</a></li>
<li><a href="<?php echo $this->basePath('user/login') ?>">Login</a></li>
<li><a href="#">Beranda</a></li>
<li><a href="#">Registrasi Antrian</a></li>
<li><a href="#">Dokter</a></li>
<li><a href="#">Poli</a></li>
<li><a href="#">Tentang Kami</a></li>
</ul>
</div>
......@@ -142,8 +137,19 @@
<div class="copyright_part">
<div class="container">
<div class="row align-items-center">
<p class="footer-text m-0 col-lg-8 col-md-12">
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
Copyright &copy;
is made with <i class="ti-heart" aria-hidden="true"></i> by <a href="https://colorlib.com"
target="_blank">Colorlib</a>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
</p>
<div class="col-lg-4 col-md-12 text-center text-lg-right footer-social">
<a href="#"><i class="ti-facebook"></i></a>
<a href="#"> <i class="ti-twitter"></i> </a>
<a href="#"><i class="ti-instagram"></i></a>
<a href="#"><i class="ti-skype"></i></a>
</div>
</div>
</div>
</div>
......@@ -181,6 +187,7 @@
->prependFile($this->basePath('js/bootstrap.min.js'))
->prependFile($this->basePath('js/jquery-3.1.0.min.js'))
->prependFile($this->basePath('/tamplate/js/bootbox.all.min.js'))
//->prependFile($this->basePath('/js/jquery.nicescroll.js'))
// ->prependFile($this->basePath('/js/jquery.seat-charts.js'))
// ->prependFile($this->basePath('/js/jquery.seat-charts.min.js'))
......
......@@ -30,17 +30,13 @@
width: 100wh;
height: 90vh;
color: #fff;
background-color: #4d5dfb;
background: linear-gradient(to right, #f05053 80%, #e1eec3);
background: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
background-size: 400% 400%;
-webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite;
animation: Gradient 15s ease infinite;
overflow: hidden;
}
@-webkit-keyframes Gradient {
0% {
......@@ -88,7 +84,8 @@
<?= $this->headScript()
->prependFile($this->basePath('js/bootstrap.min.js'))
->prependFile($this->basePath('js/jquery-3.1.0.min.js'))
->prependFile($this->basePath('js/jquery-3.1.0.min.js'))
->prependFile($this->basePath('js/pusher.js'))
?>
......
......@@ -15,7 +15,7 @@ function textToAudio() {
let no_antrian = document.getElementById("no_antrian").innerHTML;
let voice = "nomor antrian " + no_antrian;
//
console.log(voice)
......@@ -28,7 +28,7 @@ function textToAudio() {
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
}
function textToAudioRuang() {
// let msg1 = "nomor antrian";
......@@ -36,7 +36,7 @@ function textToAudioRuang() {
var res = ruang.replace(".", " ");
document.getElementById("nama_ruang").innerHTML = res;
let voice = "silahkan masuk ke " + res;
let voice = "silahkan masuk ke ruang " + res;
console.log(voice)
let speech = new SpeechSynthesisUtterance();
......@@ -93,6 +93,18 @@ $('#poli').on('change', function () {
});
});
$( '#dokter' ).on( "change", function() {
$id_dokter =$('#dokter').val();
window.location.href = ("/admin/antrianadmin/" +$id_dokter);
});
if(window.location.pathname == "/admin/antrianadmin/" +id){
$( window ).on( "load", function() {
tampilangka(id)
loadantrian(id)
});
}
function loadpoli() {
$.ajax({
......@@ -132,14 +144,15 @@ function loadpoli() {
});
}
function loadantrian() {
var iddokter = $('#dokter').val();
function loadantrian(id) {
$iddok= $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadAntrianAdmin',
data: {
id: iddokter
iid: id,
},
......@@ -186,28 +199,22 @@ function loadantrian() {
}
$('#dokter').on('change', function () {
loadantrian();
tampilangka();
});
$('#no_antrian').html('-');
function tampilangka() {
var iddokter = $('#dokter').val();
function tampilangka(id) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadNoAntrian',
data: {
id_dokter: iddokter,
id_dokter: id,
},
async: false,
success: function (result) {
// console.log(result.data);
console.log(result.data);
// console.log(result);
if (result.data) {
......@@ -275,41 +282,43 @@ function tampilangka() {
$('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20);
actionqueue(noantrian + 1, 20,id);
loadantrian()
});
$('#btnCall').on('click', function () {
actionqueue(noantrian, 30);
actionqueue(noantrian, 30,id);
});
$('#btnDone').on('click', function () {
actionqueue(noantrian, 50);
actionqueue(noantrian, 50,id);
});
$('#btnMissed').on('click', function () {
actionqueue(noantrian, 60);
actionqueue(noantrian, 60,id);
});
$('#btnServed').on('click', function () {
actionqueue(noantrian, 40);
actionqueue(noantrian, 40,id);
});
function actionqueue(antrianno, status) {
function actionqueue(antrianno, status, iddok) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/nextantrian',
data: {
inoantrian: antrianno,
istatus: status,
idok: iddok,
istatus: status
},
success: function (result) {
if (result.data == null && status == 20) {
......@@ -320,13 +329,14 @@ function actionqueue(antrianno, status) {
html: true,
type: "warning"
});
$('#no_antrian').html('-');
return false;
}
if (status == 20) {
var res = result['data'][0];
var valTemp = res['kode_dokter'] + '' + res['no_antrian'];
noantrian = res['no_antrian'];
......
$('#cekdata').on('click', function () {
let no_rekam_medis = $('#no_rekam_medis').val();
if (no_rekam_medis == null || no_rekam_medis == "") {
bootbox.alert({ message: 'No Rekam Medis tidak boleh kosong', centerVertical: true });
return false;
} else if (no_rekam_medis.toString().length > 8) {
bootbox.alert({ message: 'No Rekam Medis tidak boleh lebih dari 8 angka', centerVertical: true });
return false;
} else if (no_rekam_medis.toString().length < 8) {
bootbox.alert({ message: 'No Rekam Medis tidak boleh kurang dari 8 angka', centerVertical: true });
return false;
}
else {
cekpasien(no_rekam_medis);
}
cekpasien(no_rekam_medis);
})
function cekpasien(no_rekam_medis) {
function cekpasien() {
let no_rekam_medis = $('#no_rekam_medis').val();
// alert(no_rekam_medis);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/cekpasien',
data: {
ino_rekam_medis: no_rekam_medis,
},
success: function (result) {
// let data = result.data['datapasien'][0]['no_rekam_medis'];
// let validasi = result.data['validasiinput'];
console.log(result);
if (result.code != 0) {
bootbox.alert({ message: "No rekam medis atau NIK tidak sesuai!", centerVertical: true });
}
else if (result.code == 0) {
console.log(result.data['datapasien'][0]['no_rekam_medis']);
// alert('berhasil');
if (result.data['datapasien'][0]['no_rekam_medis'] == null) {
let $id = result.data['datapasien'][0]['id_pasien'];
if (result.code == 0) {
console.log(result.data);
if (result.data[0]['no_rekam_medis'] == null) {
let $id = result.data[0]['id_pasien'];
let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId);
}
if (result.data['datapasien'][0]['no_rekam_medis'] != null && (result.data['datapasien'][0]['status_code'] == 10)) {
let $idantrian = result.data['datapasien'][0]['id_antrian'];
if (result.data[0]['no_rekam_medis'] != null && (result.data[0]['status_code'] == 10)) {
let $idantrian = result.data[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'];
let no_rekam_medis = result.data[0]['no_rekam_medis'];
let nama = result.data[0]['nama'];
swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
......@@ -64,117 +41,50 @@ function cekpasien(no_rekam_medis) {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else if (result.data['datapasien'][0]['status_code'] == 20) {
} else if (result.data[0]['status_code'] == 20) {
bootbox.alert({ message: "Pasien Sedang Dalam Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 30) {
} else if (result.data[0]['status_code'] == 30) {
bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 40) {
} else if (result.data[0]['status_code'] == 40) {
bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 50) {
} else if (result.data[0]['status_code'] == 50) {
bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true });
} else if (result.data['datapasien'][0]['status_code'] == 60) {
} else if (result.data[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 });
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
// $('#id_pasien').val(data[0].id_pasien);
// $('#no_rekam_medis').val(data[0].no_rekam_medis);
// $('#ktp').val(data[0].ktp);
// $('#nama').val(data[0].nama);
// $('#tempat_lahir').val(data[0].tempat_lahir);
// $('#tanggal_lahir').val(data[0].tanggal_lahir);
// $('#alamat').val(data[0].alamat);
// $('#no_hp').val(data[0].no_hp);
function validasidokter(no_rekam_medis, ktp) {
var exist = 0;
} else {
bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasien',
async: false,
data: {
id: null,
},
success: function (result) {
// console.log(result)
var data = result.data;
for (x in data) {
if (no_rekam_medis == data[x]['no_rekam_medis']) {
exist = 1;
}
if (ktp == data[x]['ktp']) {
exist = 2;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
alert(xhr.status + '-' + xhr.statusText);
}
});
return exist;
}
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;
});
})
......@@ -2,17 +2,18 @@
$('#cetak').on('click', function (e) {
//alert("kepanggil");
e.preventDefault();
var w = window.open('', '', 'width=300,height=400');
w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' +
'<th><h3>No Rekam Medis : ' + no_rekam_medis_cetak + '</h3>' +
'<h2>ANTRIAN</h2>' +
'<th><h2>ANTRIAN</h2>' +
'<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' +
'<h4>Nama Pasien : ' + nama_pasien_cetak + '</h4>' +
'<h4>Poli : ' + kode_poli_cetak + '</h4>' +
'<h5>Nama Dokter : ' + nama_dokter_cetak + '</h5>' +
'<div class="h6a" style="text-align:right;font-size: 11px;";>No rekam medis tidak boleh hilang</div>' +
'<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' +
'<h3>Poli : ' + kode_poli_cetak + '</h3>' +
'<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' +
'<h3>Jumlah yang sedang dalam antrian : ' + sisa_antrian + '</h3>' +
'<h4>waktu : ' + new Date().toLocaleString("en-US", {timeZone: "Asia/Jakarta"}) + '</h4>' +
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
......
......@@ -24,96 +24,12 @@ $(document).ready(function () {
$('#tambahdata').on('click', function () {
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
let alamat = $('#alamat').val();
let no_hp = $('#no_hp').val();
let KTP = $('#ktp').val();
if (KTP == null || KTP == "") {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh kosong', centerVertical: true });
return false;
}
else if (nama == null || nama == "") {
bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
return false;
} else if (tempat_lahir == null || tempat_lahir == "") {
bootbox.alert({ message: 'Tempat lahir tidak boleh kosong', centerVertical: true });
return false;
} else if (tanggal_lahir == null || tanggal_lahir == "") {
bootbox.alert({ message: 'Tanggal lahir tidak boleh kosong', centerVertical: true });
return false;
} else if (alamat == null || alamat == "") {
bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
return false;
} else if (no_hp == null || no_hp == "") {
bootbox.alert({ message: 'No hp tidak boleh kosong', centerVertical: true });
return false;
} else if (KTP.toString().length > 16) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh lebih dari 16 angka', centerVertical: true });
return false;
} else if (KTP.toString().length < 16) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh kurang dari 16 angka', centerVertical: true });
return false;
} else if (no_hp.toString().length > 13) {
bootbox.alert({ message: 'No HP tidak boleh lebih dari 13 angka', centerVertical: true });
return false;
}
else if (validasipoli(KTP) == 1) {
bootbox.alert({ message: 'KTP Sudah Digunakan!', centerVertical: true });
}
else {
validasinorekammedis();
}
SaveDataAja();
})
function makeid(length) {
let result = '';
let characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
function makeidnumber(length) {
let result = '';
let characters =
'1234567890';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
function validasinorekammedis() {
let norekamedis = makeid(2) + makeidnumber(6);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasien',
data: {
no_rekam_medis: norekamedis
},
success: function (result) {
if (result.info == 'Not Found') {
SaveDataAja(norekamedis);
} else {
validasinorekammedis();
}
}
});
}
function SaveDataAja(norekamedis) {
let no_rekam_medis = norekamedis;
let id_pasien = $('#id_pasien').val();
function SaveDataAja() {
let id_pasien = $('#nama').val();
let no_rekam_medis = $('#nama').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
......@@ -122,26 +38,57 @@ function SaveDataAja(norekamedis) {
let ktp = $('#ktp').val();
// console.log(no_antrian);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savedatapasien',
data: {
id_pasien: id_pasien,
ino_rekam_medis: no_rekam_medis,
iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
inorm: no_rekam_medis
},
success: function (response) {
// alert("success");
// response[data];
// if (ktp == null || ktp == "") {
// bootbox.alert({ message: 'Ktp tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (nama == null || nama == "") {
// bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tempat_lahir == null || tempat_lahir == "") {
// bootbox.alert({ message: 'Tempat lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tanggal_lahir == null || tanggal_lahir == "") {
// bootbox.alert({ message: 'Tanggal lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (alamat == null || alamat == "") {
// bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
// return false;
// } else if (no_hp == null || no_hp == "") {
// bootbox.alert({ message: 'No hp tidak boleh kosong', centerVertical: true });
// return false;
// } else if (ktp.toString().length > 16) {
// bootbox.alert({ message: 'KTP tidak boleh lebih dari 16 angka', centerVertical: true });
// return false;
// } else if (ktp.toString().length < 16) {
// bootbox.alert({ message: 'KTP tidak boleh kurang dari 16 angka', centerVertical: true });
// return false;
// } else if (no_hp.toString().length > 13) {
// bootbox.alert({ message: 'No HP tidak boleh lebih dari 13 angka', centerVertical: true });
// return false;
// }
if (response['code'] == 0) {
console.log(response);
let $id = response.data['id_pasien'];
......@@ -150,7 +97,7 @@ function SaveDataAja(norekamedis) {
window.location.href = ("datapasien/" + $encodedId);
} else {
bootbox.alert({ message: 'Gagal Ditambahkan', centerVertical: true });
bootbox.alert({ message: ' gagal', centerVertical: true });
}
}, error: function (xhr) {
......@@ -164,42 +111,7 @@ function SaveDataAja(norekamedis) {
});
}
function validasipoli(KTP) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasien',
async: false,
data: {
id: null,
},
success: function (result) {
var data = result.data;
for (x in data) {
if (KTP == data[x]['ktp']) {
exist = 1;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
// alert('this');
var inputQuantity = [];
$(function () {
$("#ktp").each(function (i) {
......
// alert(id);
var functionsavedata = false;
loaddatapasien(id)
function loaddatapasien(param) {
......@@ -27,10 +31,11 @@ function loaddatapasien(param) {
$('#tanggal_lahir').val(data[0].tanggal_lahir);
$('#alamat').val(data[0].alamat);
$('#no_hp').val(data[0].no_hp);
} else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
alert(result.info);
}
},
error: function (xhr) {
......@@ -40,16 +45,56 @@ function loaddatapasien(param) {
}
function loadsisaantrian() {
let dokter = $('#dokter option:selected').attr("value");
let no_antrian = $("input[name=antrian]:checked").val();
var sisa_antrian;
console.log(dokter);
console.log(no_antrian);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadsisaantrian',
async: false,
data: {
id: dokter,
no: no_antrian,
},
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
console.log(data[0].count);
sisa_antrian = data[0].count;
// $('#sisa_antrian').val(data[0].count);
} else {
alert(result.info);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
return sisa_antrian;
}
$('#tambah').on('click', function () {
savedataaja();
loadsisaantrian()
savedataaja()
})
function savedataaja() {
let id = $('#id_pasien').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
......@@ -59,11 +104,13 @@ function savedataaja() {
let no_rekam_medis = $('#no_rekam_medis').val();
let poli = $("#poli option:selected").attr("value");
let dokter = $('#dokter option:selected').attr("value");
let sisa_antrian = loadsisaantrian()
console.log(sisa_antrian);
let ktp = $('#ktp').val();
let no_antrian = $("input[name=antrian]:checked").val();
// console.log(id);
/* save data */
$.ajax({
type: 'POST',
......@@ -81,14 +128,16 @@ function savedataaja() {
ipoli: poli,
idokter: dokter,
ino_antrian: no_antrian,
isisa_antrian :sisa_antrian,
},
success: function (response) {
if (response['code'] == 0) {
console.log(response);
// console.log(response);
let $id = response.data[0].id_antrian;
// console.log($id);
let $encodedId = btoa($id);
......@@ -114,7 +163,7 @@ function savedataaja() {
loadpoli();
$('#poli').on('change', function () {
var idpoli = $('#poli').val();
console.log(idpoli);
// console.log(idpoli);
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -214,7 +263,7 @@ function pilihAntrian() {
// console.log($antrian);
// console.log(response);
if ($antrian) {
var hour = 0;;
var hour = 0;
var splithour = [];
splithour[0] = $antrian[0]['jam_mulai'].split(':');
......@@ -225,10 +274,10 @@ function pilihAntrian() {
minute = parseInt(splithour[0][1]);
$('.antrian').empty();
for (var i = 0; i < $antrian.length; i++) {
if ($antrian[i]['id_pasien'] === null) {
if ($antrian[i]['id_pasien'] === null) {//jika masih kosong
let y = '';
......@@ -241,6 +290,9 @@ function pilihAntrian() {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if(hour >=24){
hour=0;
}
if (minute.toString().length === 1) {
y += `<div class="col-lg-1">
......@@ -265,7 +317,7 @@ function pilihAntrian() {
minute += parseInt(splittime[i][1]);
} else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) {
} else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) {//jika antrian sudah terisi
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
let y = '';
......@@ -274,8 +326,15 @@ function pilihAntrian() {
if (minute >= 60) {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if(hour >=24){
hour=0;
}
if (minute.toString().length === 1) {
......@@ -323,6 +382,10 @@ function pilihAntrian() {
if (minute >= 60) {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if(hour >=24){
hour=0;
}
let y = '';
......@@ -349,10 +412,11 @@ function pilihAntrian() {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
bootbox.alert({ message: 'Cannot load queue', centerVertical: true });
alert('Cannot load queue');
}
}
});
}
$(document).ready(function () {
......
......@@ -20,10 +20,9 @@ function loaddokter() {
y += ` <div class="col">
<div class="card-hide" style="height:330px;width:200px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:180px; height:200px;" src="/tamplate/img/doctor/`+ data[counter]['image_dokter'] + `" ></h5>
<h5 class="card-title "> <img style="width:180px; height:200px;" src="/tamplate/img/doctor/`+ data[counter]['image'] + `" ></h5>
<h4 class="card-text font-weight-bold">`+ data[counter]['nama_dokter'] + `</h4>
<h6 class="card-text">`+ `Kode Dokter : ` + data[counter]['kode_dokter'] + `</h6>
<h5 class="card-text">`+ `Poli ` + data[counter]['nama_poli'] + `</h5>
<h5 class="card-text">`+ data[counter]['nama_poli'] + `</h5>
</div>
......
......@@ -76,7 +76,7 @@ function Loaddokter() {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].kode_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image_dokter + '</td>';
// cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image + '</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>';
newRow.append(cols);
......@@ -112,144 +112,19 @@ function Loaddokter() {
}
});
}
function validasidokter(poli, nama_dokter, kode_dokter, fileupload) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkeloladokter',
async: false,
data: {
id: null,
},
success: function (result) {
var data = result.data;
var namacounter = 0;
var kodecounter = 0;
for (x in data) {
if (poli == data[x]['id_poli']) {
// console.log(data[x]['id_poli'])
if (nama_dokter == data[x]['nama_dokter']) {
exist = 1;
}
}
if (poli == data[x]['id_poli']) {
if (kode_dokter == data[x]['kode_dokter']) {
exist = 2;
}
}
if (poli == data[x]['id_poli']) {
if (fileupload == data[x]['image_dokter']) {
exist = 3;
}
}
if (poli == data[x]['id_poli']) {
if (nama_dokter == data[x]['nama_dokter']) {
namacounter += 1;
if (namacounter > 1) {
exist = 4;
}
}
}
if (poli == data[x]['id_poli']) {
if (kode_dokter == data[x]['kode_dokter']) {
kodecounter += 1;
if (kodecounter > 1) {
exist = 5;
}
}
}
if (poli == data[x]['id_poli']) {
if (fileupload == data[x]['image_dokter']) {
kodecounter += 1;
if (kodecounter > 1) {
exist = 6;
}
}
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
function validasigambar() {
var exist = 0;
let inputString = $('#gambar_dokter').val();
let inputStringedt = $('#gambar_dokteredt').val();
var imageReg = /[\/.](gif|jpg|jpeg|tiff|png)$/i;
if (!imageReg.test(inputString)) {
// bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
exist = 1;
}
if (!imageReg.test(inputStringedt)) {
// bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
exist = 2;
}
return exist;
}
$('#tambahmodal').on('click', function () {
loadpoli()
})
$('#tambah').on('click', function () {
let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value");
const fileupload = $('#gambar_dokter').prop('files')[0];
if (nama_dokter == null || nama_dokter == "") {
bootbox.alert({ message: 'Nama dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_dokter == null || kode_dokter == "") {
bootbox.alert({ message: 'Kode dokter tidak boleh kosong', centerVertical: true });
return false;
} else if (poli == null) {
bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (fileupload == null) {
bootbox.alert({ message: 'Gambar dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (poli == null) {
bootbox.alert({ message: 'Kode dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasidokter(poli, nama_dokter, kode_dokter, fileupload) == 1) {
bootbox.alert({ message: 'Nama dokter sudah ada!', centerVertical: true });
}
else if (validasidokter(poli, nama_dokter, kode_dokter, fileupload) == 2) {
bootbox.alert({ message: 'Kode dokter sudah ada!', centerVertical: true });
}
else if (validasidokter(poli, nama_dokter, kode_dokter, fileupload) == 3) {
bootbox.alert({ message: 'Gambar dokter sudah ada!', centerVertical: true });
var nama_dokter = document.getElementById("nama_dokter").value;
var kode_dokter = document.getElementById("kode_dokter").value;
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Sudah Ada!', centerVertical: true });
}
else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
else if (validasidokter(nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode Dokter Sudah Ada!', centerVertical: true });
} else {
savedokter()
}
......@@ -262,29 +137,23 @@ function savedokter() {
let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value");
const fileupload = $('#gambar_dokter').prop('files')[0];
let formData = new FormData();
formData.append('inama_dokter', nama_dokter);
formData.append('ikode_dokter', kode_dokter);
formData.append('ipoli', poli);
formData.append('fileupload', fileupload); // set file ke tipe data binary
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savekeloladokter',
data: formData,
cache: false,
processData: false,
contentType: false,
data: {
inama_dokter: nama_dokter,
ikode_dokter: kode_dokter,
ipoli: poli
},
success: function (response) {
//console.log(poli)
if (response['code'] == 0) {
$('#addData').modal('hide');
swal({
title: "",
text: "Data Berhasil Ditambahkan!",
......@@ -317,42 +186,54 @@ function savedokter() {
});
}
function validasidokter(nama_dokter, kode_dokter) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkeloladokter',
async: false,
data: {
id: null,
},
success: function (result) {
console.log(result)
var data = result.data;
$('#edit').on('click', function () {
let id_dokter = $('#id_dokter').val();
let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val();
let poli = $("#poliedt option:selected").attr("value");
const fileupload = $('#gambar_dokter').prop('files')[0];
for (x in data) {
if (nama_dokter == data[x]['nama_dokter']) {
exist = 1;
}
if (kode_dokter == data[x]['kode_dokter']) {
exist = 2;
}
}
if (nama_dokter == null || nama_dokter == "") {
bootbox.alert({ message: 'Nama dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_dokter == null || kode_dokter == "") {
bootbox.alert({ message: 'Kode dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (poli == null) {
bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (fileupload == null) {
bootbox.alert({ message: 'Gambar dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 3) {
bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true });
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () {
let id_dokter = $('#id_dokter').val();
var nama_dokter = document.getElementById("nama_dokteredt").value;
var kode_dokter = document.getElementById("kode_dokteredt").value;
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Harus Berbeda!', centerVertical: true });
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) {
bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true });
}
else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
else if (validasidokter(nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode Dokter Harus Berbeda!', centerVertical: true });
} else {
editdatadokter(id_dokter)
}
......@@ -365,30 +246,24 @@ function editdatadokter(id_dokter) {
let condition = $("#condition option:selected").attr("value");
let nama_dokter = $('#nama_dokteredt').val();
let kode_dokter = $('#kode_dokteredt').val();
const fileupload = $('#gambar_dokteredt').prop('files')[0];
let formData = new FormData();
formData.append('id_dokter', id_dokter);
formData.append('inama_dokter', nama_dokter);
formData.append('ikode_dokter', kode_dokter);
formData.append('ipoli', poli);
formData.append('icondition', condition);
formData.append('fileupload', fileupload); // set file ke tipe data binary
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkeloladokter',
data: formData,
cache: false,
processData: false,
contentType: false,
url: baseURL + '/api/loadkeloladokter',
data: {
id: id_dokter,
inama_dokter: nama_dokter,
ikode_dokter: kode_dokter,
ipoli: poli,
icondition: condition,
},
success: function (response) {
// console.log(response);
console.log(response);
if (response['code'] == 0) {
$('#Editdata').modal('hide');
swal({
title: "",
text: "Data Berhasil DiUbah!",
......@@ -450,7 +325,7 @@ function loadedit(id_dokter) {
async: false,
success: function (result) {
console.log(data);
// console.log(data);
if (result['code'] == 0) {
......@@ -482,14 +357,19 @@ function loadedit(id_dokter) {
}
}
});
// for (var i = 0; i < data.length; i++) {
// optionseg = '<option value="' + data[i].id_poli + '">' + data[i].nama_poli + '</option>';
// }
// $("select#poliedt").html(optionseg);
$('#id_dokter').val(data[0].id_dokter);
$('#nama_dokteredt').val(data[0].nama_dokter);
$('#kode_dokteredt').val(data[0].kode_dokter);
// $('#condition').val(data[0].condition);
// $("#gambar_dokteredt").val(data[0].image_dokter);
} else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
}
......@@ -511,7 +391,7 @@ function Delete(param) {
id: param,
},
success: function (result) {
// console.log(result.data[0].nama_dokter);
console.log(result);
let nama_dokter = result.data[0].nama_dokter;
swal({
title: "Apakah yakin mengahapus dokter '" + nama_dokter + "'? ",
......@@ -542,16 +422,11 @@ function Delete(param) {
} else {
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
alert('gagal');
}
},
error: function () {
bootbox.alert({ message: 'Data dokter masih terdaftar dalam poli ', centerVertical: true });
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
......
Loadpasien()
function Loadpasien() {
// loadpoli();
// $('#poli').on('change', function () {
// var idpoli = $('#poli').val();
// // console.log(idpoli);
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loaddokter',
// data: {
// id_poli: idpoli
// },
// success: function (result) {
// if (result['code'] == 0) {
// var res = result['data'];
// optionseg = '';
// optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
// for (var i = 0; i < res.length; i++) {
// optionseg += '<option value="' + res[i].id_dokter + '">' + res[i].nama_dokter + '</option>';
// }
// $("select#dokter").removeAttr('disabled');
// $("select#dokter").html(optionseg);
// } else {
// bootbox.dialog({
// message: "<span class='bigger-110'>" + result['info'] + "</span>",
// buttons:
// {
// "OK":
// {
// "label": "<i class='icon-ok'></i> OK ",
// "className": "btn-sm btn-danger",
// "callback": function () {
// notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
// }
// }
// }
// });
// }
// }
// });
// });
// function loadpoli() {
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loadpoli',
// success: function (result) {
// if (result['code'] == 0) {
// //console.log (result);
// var res = result['data'];
// optionseg = '';
// optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
// for (var i = 0; i < res.length; i++) {
// optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
// }
// $("select#poli").html(optionseg);
// } else {
// bootbox.dialog({
// message: "<span class='bigger-110'>" + result['info'] + "</span>",
// buttons:
// {
// "OK":
// {
// "label": "<i class='icon-ok'></i> OK ",
// "className": "btn-sm btn-danger",
// "callback": function () {
// notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
// }
// }
// }
// });
// }
// }
// });
// }
// $('#dokter').on('change', function () {
Loadpasien();
// });
function Loadpasien() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapasien',
url: baseURL + '/api/loadkelolaantrian',
data: {
// id: iddokter
},
success: function (result) {
// console.log(result);
// console.log(result.data);
$('table.table-bordered > tbody').empty();
// console.log(result);
......@@ -26,17 +119,14 @@ function Loadpasien() {
var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
cols += '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText ">' + data[x].no_rekam_medis + '</td>';
cols += '<td class="tdCenterText">' + data[x].ktp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tempat_lahir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tanggal_lahir + '</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].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 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].status_name + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="actionqueue(' + data[x].id_pasien + "," + data[x].id_dokter + ')">Update</span></div> </td>';
// console.log(data[x].id_pasien);
console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
......@@ -55,15 +145,12 @@ function Loadpasien() {
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 80, targets: 1 },
{ width: 50, targets: 1 },
{ width: 130, targets: 2 },
{ width: 130, targets: 3 },
{ width: 130, targets: 4 },
{ width: 130, targets: 5 },
{ width: 130, targets: 6 },
{ width: 130, targets: 7 },
{ width: 110, targets: 8 },
{ width: 100, targets: 9 },
{ width: 100, targets: 6 },
],
});
......@@ -74,90 +161,21 @@ function Loadpasien() {
});
}
$('#edit').on('click', function () {
let id_pasien = $('#id_pasien').val();
let ktp = $('#ktp').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
let alamat = $('#alamat').val();
let no_hp = $('#no_hp').val();
if (nama == null || nama == "") {
bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
return false;
}
else if (ktp == null || ktp == "") {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh kosong', centerVertical: true });
return false;
}
else if (tempat_lahir == null || tempat_lahir == "") {
bootbox.alert({ message: 'Tempat Lahir tidak boleh kosong', centerVertical: true });
return false;
}
else if (tanggal_lahir == null || tanggal_lahir == "") {
bootbox.alert({ message: 'Tanggal Lahir tidak boleh kosong', centerVertical: true });
return false;
}
else if (alamat == null || alamat == "") {
bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
return false;
}
else if (no_hp == null || no_hp == "") {
bootbox.alert({ message: 'No HP tidak boleh kosong', centerVertical: true });
return false;
} else if (ktp.toString().length > 16) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh lebih dari 16 angka', centerVertical: true });
return false;
} else if (ktp.toString().length < 16) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) tidak boleh kurang dari 16 angka', centerVertical: true });
return false;
} else if (no_hp.toString().length > 13) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) HP tidak boleh lebih dari 13 angka', centerVertical: true });
return false;
}
else if (validasipasien(ktp) == 1) {
bootbox.alert({ message: 'No Induk Kependudukan (NIK) Sudah Ada!', centerVertical: true });
} else {
editdatapasien(id_pasien)
}
})
function editdatapasien(id_pasien) {
let ktp = $('#ktp').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
let alamat = $('#alamat').val();
let no_hp = $('#no_hp').val();
function actionqueue(idpasien, iddokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkelolapasien',
url: baseURL + '/api/updateantrianmiss',
data: {
id_pasien: id_pasien,
iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
iddok: iddokter,
iidpasien: idpasien,
},
success: function (response) {
$('#Editdata').modal('hide');
console.log(response);
if (response['code'] == 0) {
success: function (result) {
console.log()
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil DiUbah!",
text: "Data Berhasil Diupdate!",
icon: "succes",
button: "ok",
}, function () {
......@@ -165,157 +183,10 @@ function editdatapasien(id_pasien) {
});
} else {
swal({
title: "",
text: "Data Gagal Ditambahkan!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
}
}
});
}
function validasipasien(ktp) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapasien',
async: false,
data: {
id: null,
},
success: function (result) {
console.log(result)
var data = result.data;
var ktpcounter = 0;
for (x in data) {
if (ktp == data[x]['ktp']) {
ktpcounter += 1;
if (ktpcounter > 1) {
exist = 1;
}
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
function loadedit(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapasien',
data: {
id_pasien: id_pasien,
},
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
$('#id_pasien').val(data[0].id_pasien);
$('#no_rekam_medis').val(data[0].no_rekam_medis);
$('#ktp').val(data[0].ktp);
$('#nama').val(data[0].nama);
$('#tempat_lahir').val(data[0].tempat_lahir);
$('#tanggal_lahir').val(data[0].tanggal_lahir);
$('#alamat').val(data[0].alamat);
$('#no_hp').val(data[0].no_hp);
} else {
alert(result.info);
alert('gagal');
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
function Delete(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapasien',
data: {
id_pasien: id_pasien,
},
success: function (result) {
console.log(result);
let nama_pasien = result.data[0].nama;
swal({
title: "Apakah yakin mengahapus pasien '" + nama_pasien + "'? ",
type: "error",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/deletekelolapasien',
data: {
id_pasien: id_pasien,
},
success: function (result) {
// console.log(result)
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Dihapus!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
alert('gagal');
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
);
}
});
}
......@@ -5,7 +5,7 @@ function reset() {
document.getElementById("myForm").reset();
}
//LOAD
Loadpoli(null);
function Loadpoli() {
......@@ -20,7 +20,7 @@ function Loadpoli() {
$('table.table-bordered > tbody').empty();
console.log(result);
// console.log(result);
if (result.code == 0) {
......@@ -37,7 +37,6 @@ function Loadpoli() {
cols += '<td class="tdCenterText bgtd1 ">' + data[x].nama_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].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 += '</tr>'
//newRow.append(cols);
......@@ -55,11 +54,10 @@ function Loadpoli() {
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 120, targets: 1 },
{ width: 120, targets: 2 },
{ width: 250, targets: 3 },
{ width: 100, targets: 4 },
{ width: 120, targets: 5 },
{ width: 170, targets: 1 },
{ width: 170, targets: 2 },
{ width: 290, targets: 3 },
{ width: 120, targets: 4 },
],
});
......@@ -71,83 +69,41 @@ function Loadpoli() {
}
$('#tambah').on('click', function (e) {
$('#tambah').on('click', function () {
var nama_poli = document.getElementById("nama_poli").value;
var kode_poli = document.getElementById("kode_poli").value;
e.preventDefault();
let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
const fileupload = $('#gambar_poli').prop('files')[0];
// console.log(fileupload.name)
if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli == null || kode_poli == "") {
bootbox.alert({ message: 'Kode poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (deskripsi_poli == null || deskripsi_poli == "") {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (fileupload == null || fileupload == "") {
bootbox.alert({ message: ' Gambar tidak boleh kosong', centerVertical: true });
return false;
if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama Poli Sudah Ada!', centerVertical: true });
}
else if (kode_poli.toString().length > 5) {
bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true });
return false;
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 1) {
bootbox.alert({ message: 'Nama poli sudah ada!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 2) {
bootbox.alert({ message: 'Kode poli sudah ada!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 3) {
bootbox.alert({ message: 'Deskripsi Poli sudah ada!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload.name) == 4) {
bootbox.alert({ message: 'Gambar Poli sudah ada!', centerVertical: true });
}
else if (validasigambar() == 1) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode Poli Sudah Ada', centerVertical: true });
} else {
savedatapoli();
}
})
function savedatapoli() {
let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
const fileupload = $('#gambar_poli').prop('files')[0];
let formData = new FormData();
formData.append('inama_poli', nama_poli);
formData.append('ikode_poli', kode_poli);
formData.append('ideskripsi_poli', deskripsi_poli);
formData.append('fileupload', fileupload); // set file ke tipe data binary
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savekelolapoli',
data: formData,
cache: false,
processData: false,
contentType: false,
data: {
inama_poli: nama_poli,
ikode_poli: kode_poli,
ideskripsi_poli: deskripsi_poli,
},
success: function (response) {
if (response['code'] == 0) {
$('#addData').modal('hide');
swal({
title: "",
text: "Data Berhasil Ditambahkan!",
......@@ -180,27 +136,7 @@ function savedatapoli() {
}
function validasigambar() {
var exist = 0;
let inputString = $('#gambar_poli').val();
let inputStringedt = $('#gambar_poliedt').val();
var imageReg = /[\/.](gif|jpg|jpeg|tiff|png)$/i;
if (!imageReg.test(inputString)) {
// bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
exist = 1;
}
if (!imageReg.test(inputStringedt)) {
// bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
exist = 2;
}
return exist;
}
function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
function validasipoli(nama_poli, kode_poli) {
var exist = 0;
......@@ -215,9 +151,6 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
success: function (result) {
var data = result.data;
console.log(data)
var counter = 0;
for (x in data) {
if (nama_poli == data[x]['nama_poli']) {
......@@ -226,39 +159,6 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
if (kode_poli == data[x]['kode_poli']) {
exist = 2;
}
if (deskripsi_poli == data[x]['deskripsi_poli']) {
exist = 3;
}
if (fileupload == data[x]['image_poli']) {
exist = 4;
}
if (nama_poli == data[x]['nama_poli']) {
counter += 1;
if (counter > 1) {
exist = 5;
}
}
if (kode_poli == data[x]['kode_poli']) {
counter += 1;
if (counter > 1) {
exist = 6;
}
}
if (deskripsi_poli == data[x]['deskripsi_poli']) {
counter += 1;
if (counter > 1) {
exist = 7;
}
}
if (fileupload == data[x]['image_poli']) {
counter += 1;
if (counter > 1) {
exist = 8;
}
}
}
......@@ -276,79 +176,42 @@ function validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) {
$('#edit').on('click', function () {
let id_poli = $('#id_poli').val();
let nama_poli = $('#nama_poliEdt').val();
let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
const fileupload = $('#gambar_poliedt').prop('files')[0];
var nama_poli = document.getElementById("nama_poliEdt").value;
var kode_poli = document.getElementById("kode_poliEdt").value;
if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli == null || kode_poli == "") {
bootbox.alert({ message: 'Kode poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (deskripsi_poli == null || deskripsi_poli == "") {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (fileupload == null) {
bootbox.alert({ message: ' Gambar tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli.toString().length > 5) {
bootbox.alert({ message: 'Kode Poli tidak boleh lebih dari 5 angka', centerVertical: true });
return false;
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 5) {
bootbox.alert({ message: 'Nama poli harus berbeda!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 6) {
bootbox.alert({ message: 'Kode poli harus berbeda!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload) == 7) {
bootbox.alert({ message: 'Deskripsi Poli harus berbeda!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli, deskripsi_poli, fileupload.name) == 8) {
bootbox.alert({ message: 'Gambar Poli harus berbeda!', centerVertical: true });
if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama Poli Harus Berbeda!', centerVertical: true });
}
else if (validasigambar() == 2) {
bootbox.alert({ message: 'Harus berupa gambar', centerVertical: true });
else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode Poli Harus Berbeda!', centerVertical: true });
} else {
editdatapoli(id_poli)
}
})
function editdatapoli(id_poli) {
let nama_poli = $('#nama_poliEdt').val();
let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
const fileupload = $('#gambar_poliedt').prop('files')[0];
let formData = new FormData();
formData.append('id_poli', id_poli);
// console.log(fileuploadedt)
formData.append('inama_poli', nama_poli);
formData.append('ikode_poli', kode_poli);
formData.append('ideskripsi_poli', deskripsi_poli);
formData.append('fileupload', fileupload); // set file ke tipe data binary
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkelolapoli',
async: false,
data: formData,
cache: false,
processData: false,
contentType: false,
data: {
id: id_poli,
inama_poli: nama_poli,
ikode_poli: kode_poli,
ideskripsi_poli: deskripsi_poli,
},
success: function (response) {
//console.log(respoonse);
if (response['code'] == 0) {
$('#editData').modal('hide');
swal({
title: "",
text: "Data Berhasil DiUbah!",
......@@ -396,12 +259,11 @@ function loadedit(param) {
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
console.log(data);
$('#id_poli').val(data[0].id_poli);
$('#nama_poliEdt').val(data[0].nama_poli);
......@@ -409,9 +271,6 @@ function loadedit(param) {
$('#kode_poliEdt').val(data[0].kode_poli);
$('#deskripsi_poliEdt').val(data[0].deskripsi_poli);
} else {
alert(result.info);
}
......@@ -461,12 +320,7 @@ function Delete(param) {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
alert('gagal');
}
},
error: function (xhr) {
......
......@@ -8,9 +8,9 @@ function reset() {
}
// function closeWin() {
// myWindow.close();
// }
function closeWin() {
myWindow.close();
}
function loadpoli() {
......@@ -51,7 +51,7 @@ function loadpoli() {
});
}
Loadruang();
Loadruang(null);
function Loadruang() {
/* save data */
......@@ -77,10 +77,9 @@ function Loadruang() {
cols += '<td class="">' + counter + '</td>';
// cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].id_poli + '</td>'
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].lantai + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
// cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image + '</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>';
......@@ -101,11 +100,10 @@ function Loadruang() {
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 180, targets: 1 },
{ width: 140, targets: 2 },
{ width: 140, targets: 3 },
{ width: 140, targets: 4 },
{ width: 100, targets: 5 },
{ width: 215, targets: 1 },
{ width: 215, targets: 2 },
{ width: 215, targets: 3 },
{ width: 107, targets: 4 },
],
});
......@@ -124,32 +122,12 @@ $('#tambahmodal').on('click', function () {
})
$('#tambah').on('click', function () {
let nama_ruang = $('#nama_ruang').val();
let lantai = $('#lantai').val();
if (nama_ruang == null || nama_ruang == "") {
bootbox.alert({ message: 'Nama Ruang tidak boleh kosong', centerVertical: true });
return false;
}
else if (lantai == null || lantai == "") {
bootbox.alert({ message: 'Lantai tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasiruang(lantai, nama_ruang) == 3) {
bootbox.alert({ message: 'Nama ruang dan lantai sudah ada!', centerVertical: true });
}
else if (validasiruang(lantai, nama_ruang) == 2) {
bootbox.alert({ message: 'Nama ruang dan lantai sudah ada!', centerVertical: true });
}
else {
saveruang()
}
})
saveruang()
})
function saveruang() {
let nama_ruang = $('#nama_ruang').val();
let lantai = $('#lantai').val();
let poli = $("#poli option:selected").attr("value");
......@@ -161,18 +139,13 @@ function saveruang() {
url: baseURL + '/api/savekelolaruang',
data: {
inama_ruang: nama_ruang,
ilantai: lantai,
ipoli: poli,
},
success: function (result) {
// console.log(result)
if (result['code'] == 0) {
$('#addData').modal('hide');
swal({
title: "",
text: "Data Berhasil Ditambahkan!",
......@@ -204,90 +177,19 @@ function saveruang() {
});
}
// validasiruang()
function validasiruang(lantai, nama_ruang) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolaruang',
async: false,
data: {
id: null,
},
success: function (result) {
var data = result.data;
console.log(data[0])
var ruangcounter = 0
for (x in data) {
// if (lantai == data[x]['lantai']) {
// if (nama_ruang == data[x]['nama_ruang']) {
// }
// }
if (lantai == data[x]['lantai']) {
if (nama_ruang == data[x]['nama_ruang']) {
exist = 2;
}
}
if (lantai == data[x]['lantai']) {
if (nama_ruang == data[x]['nama_ruang']) {
ruangcounter += 1;
if (ruangcounter > 1) {
exist = 3;
}
}
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () {
let id_ruang = $('#id_ruang').val();
let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val();
let poli = $("#poliedt option:selected").attr("value");
// console.log(poli)
if (nama_ruang == null || nama_ruang == "") {
bootbox.alert({ message: 'Nama Ruang tidak boleh kosong', centerVertical: true });
return false;
}
else if (lantai == null || lantai == "") {
bootbox.alert({ message: 'Lantai tidak boleh kosong', centerVertical: true });
return false;
} else if (validasiruang(lantai, nama_ruang) == 3) {
bootbox.alert({ message: 'Nama ruang dan lantai harus berbeda!', centerVertical: true });
} else {
editdataruang(id_ruang)
}
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } else {
editdataruang(id_ruang)
// }
})
function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val();
let condition = $("#condition option:selected").attr("value");
$.ajax({
......@@ -298,17 +200,13 @@ function editdataruang(id_ruang) {
id: id_ruang,
inama_ruang: nama_ruang,
ipoli: poli,
ilantai: lantai,
icondition: condition,
},
success: function (response) {
//console.log(respoonse);
if (response['code'] == 0) {
$('#Editdata').modal('hide');
swal({
title: "",
text: "Data Berhasil DiUbah!",
......@@ -374,7 +272,7 @@ function loadedit(id_ruang) {
if (result['code'] == 0) {
// console.log(result);
console.log(result);
var res = result['data'];
optionseg = '';
......@@ -405,7 +303,6 @@ function loadedit(id_ruang) {
});
$('#id_ruang').val(data[0].id_ruang);
$('#nama_ruangedt').val(data[0].nama_ruang);
$('#lantaiedt').val(data[0].lantai);
} else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
......@@ -429,7 +326,7 @@ function Delete(param) {
id: param,
},
success: function (result) {
// console.log(result);
console.log(result);
let nama_ruang = result.data[0].nama_ruang;
swal({
title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ",
......@@ -458,16 +355,11 @@ function Delete(param) {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
alert('gagal');
}
},
error: function () {
bootbox.alert({ message: 'Data ruang masih terdaftar dalam poli ', centerVertical: true });
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusTexDa);
}
});
},
......
......@@ -16,7 +16,7 @@ $(document).ready(function () {
separator: ':',
duration: true,
minimum: '06:00',
maximum: '18:00',
maximum: '24:00',
durationNegative: true
});
});
......@@ -37,7 +37,7 @@ $(document).ready(function () {
separator: ':',
duration: true,
minimum: '00:00',
maximum: '23:00',
maximum: '24:00',
durationNegative: true
});
});
......@@ -47,8 +47,8 @@ $(document).ready(function () {
required: true,
separator: ':',
duration: true,
minimum: '00:10',
maximum: '00:20',
minimum: '00:01',
maximum: '00:59',
durationNegative: true
});
});
......@@ -138,10 +138,23 @@ function loadpoli() {
for (var i = 0; i < res.length; i++) {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
}
$("select#poli").html(optionseg);
} else {
bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
bootbox.dialog({
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
}
}
});
......@@ -234,16 +247,15 @@ function LoadDadta(id) {
}
$('#tambah').on('click', function () {
SaveDataRegister()
})
function SaveDataRegister(param) {
......@@ -256,126 +268,7 @@ function SaveDataRegister(param) {
let antrian_akhir = $('#antrian_akhir').val();
let waktu_antrian = $('#waktu_antrian').val();
let jam_mulai = $('#jam_mulai').val();
if (ruang == null || ruang == "") {
swal({
title: "",
text: "Field ruang is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_all == null || antrian_all == "") {
swal({
title: "",
text: "Field antrian seluruh is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_awal == null || antrian_awal == "") {
swal({
title: "",
text: "Field antrian awal is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_akhir == null || antrian_akhir == "") {
swal({
title: "",
text: "Field antrian akhir is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (waktu_antrian == null || waktu_antrian == "") {
swal({
title: "",
text: "Field waktu antrian is empty!",
icon: "error",
button: "ok",
});
return false;
}
else if (poli == null || poli == "") {
swal({
title: "",
text: "Field poli is empty!",
icon: "error",
button: "ok",
});
return false;
}
else if (dokter == null || dokter == "") {
swal({
title: "",
text: "Field dokter is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
swal({
title: "",
text: "antrian awal tidak boleh lebih besar dari antrian akhir!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian seluruh!",
icon: "error",
button: "ok",
});
return false;
}
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian all!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_awal) == parseInt(antrian_akhir)) {
swal({
title: "",
text: "antrian akhir tidak boleh sama dengan antrian awal!",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_all) > 30) {
swal({
title: "",
text: "antrian seluruh tidak boleh lebih dari 30!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(waktu_antrian) > 10) {
swal({
title: "",
text: "waktu antrian per orang tidak lebih dari 10 menit",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_awal) < 5) {
swal({
title: "",
text: "antrian mobile dimulai dari 5! ",
icon: "error",
button: "ok",
});
return false;
}
/* save data */
$.ajax({
......@@ -396,19 +289,136 @@ function SaveDataRegister(param) {
},
success: function (result) {
if (result.code == 0) {
$('#addData').modal('hide');
if (ruang == null || ruang == "") {
swal({
title: "",
text: "Field ruang is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_all == null || antrian_all == "") {
swal({
title: "",
text: "Field antrian seluruh is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_awal == null || antrian_awal == "") {
swal({
title: "",
text: "Field antrian awal is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_akhir == null || antrian_akhir == "") {
swal({
title: "",
text: "Field antrian akhir is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (waktu_antrian == null || waktu_antrian == "") {
swal({
title: "",
text: "Field waktu antrian is empty!",
icon: "error",
button: "ok",
});
return false;
}
else if (poli == null || poli == "") {
swal({
title: "",
text: "Field poli is empty!",
icon: "error",
button: "ok",
});
return false;
}
else if (dokter == null || dokter == "") {
swal({
title: "",
text: "Field dokter is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
swal({
title: "",
text: "antrian awal tidak boleh lebih besar dari antrian akhir!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian seluruh!",
icon: "error",
button: "ok",
});
return false;
}
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian all!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_awal) == parseInt(antrian_akhir)) {
swal({
title: "",
text: "antrian akhir tidak boleh sama dengan antrian awal!",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_all) > 30) {
swal({
title: "",
text: "antrian seluruh tidak boleh lebih dari 30!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(waktu_antrian) > 10) {
swal({
title: "",
text: "waktu antrian per orang tidak lebih dari 10 menit",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_awal) < 5) {
swal({
title: "",
text: "antrian mobile dimulai dari 5! ",
icon: "error",
button: "ok",
});
return false;
}
else if (result.code == 0) {
swal({
title: "<span style='color:#222'>Good Job!</span>",
confirmButtonColor: "#66BB6A",
html: true,
type: "success"
}, function () {
location.reload();
});
// loadpoli();
......@@ -442,10 +452,12 @@ function SaveDataRegister(param) {
$('#edit').on('click', function () {
let id_register = $('#id_register').val();
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } else {
editregister(id_register)
// }
})
......@@ -460,129 +472,8 @@ function editregister(id_register) {
let waktu_antrian = $('#waktu_antrianedt').val();
let jam_mulai = $('#jam_mulaiedt').val();
// if (ruang == null || ruang == "") {
// swal({
// title: "",
// text: "Field ruang is empty!",
// icon: "error",
// button: "ok",
// });
// return false;
// }
if (antrian_all == null || antrian_all == "") {
swal({
title: "",
text: "Field antrian seluruh is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_awal == null || antrian_awal == "") {
swal({
title: "",
text: "Field antrian awal is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (antrian_akhir == null || antrian_akhir == "") {
swal({
title: "",
text: "Field antrian akhir is empty!",
icon: "error",
button: "ok",
});
return false;
} else if (waktu_antrian == null || waktu_antrian == "") {
swal({
title: "",
text: "Field waktu antrian is empty!",
icon: "error",
button: "ok",
});
return false;
}
// else if (poli == null || poli == "") {
// swal({
// title: "",
// text: "Field poli is empty!",
// icon: "error",
// button: "ok",
// });
// return false;
// }
// else if (dokter == null || dokter == "") {
// swal({
// title: "",
// text: "Field dokter is empty!",
// icon: "error",
// button: "ok",
// });
// return false;
// }
else if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
if (parseInt(antrian_akhir) < parseInt(antrian_awal)) {
swal({
title: "",
text: "antrian awal tidak boleh lebih besar dari antrian akhir!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian seluruh!",
icon: "error",
button: "ok",
});
return false;
}
} else if (parseInt(antrian_akhir) > parseInt(antrian_all)) {
swal({
title: "",
text: "antrian akhir tidak boleh lebih besar dari antrian all!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(antrian_awal) == parseInt(antrian_akhir)) {
swal({
title: "",
text: "antrian akhir tidak boleh sama dengan antrian awal!",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_all) > 30) {
swal({
title: "",
text: "antrian seluruh tidak boleh lebih dari 30!",
icon: "error",
button: "ok",
});
return false;
} else if (parseInt(waktu_antrian) > 10) {
swal({
title: "",
text: "waktu antrian per orang tidak lebih dari 10 menit",
icon: "error",
button: "ok",
});
return false;
}
else if (parseInt(antrian_awal) < 5) {
swal({
title: "",
text: "antrian mobile dimulai dari 5! ",
icon: "error",
button: "ok",
});
return false;
}
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
......@@ -591,7 +482,7 @@ function editregister(id_register) {
async: false,
data: {
id: id_register,
ipoli: poli,
ipoli :poli,
idokter: dokter,
iruang: ruang,
iantrial_all: antrian_all,
......@@ -604,18 +495,20 @@ function editregister(id_register) {
success: function (response) {
console.log(response);
if (response['code'] == 0) {
$('#editData').modal('hide');
swal({
title: "",
text: "Data Berhasil DiUbah!",
icon: "succes",
button: "ok",
},
function () {
location.reload();
});
},
function () {
location.reload();
});
//
//window.onload
//location.reload()
} else {
......
loadantrianumum();
function loadantrianumum() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrian',
success: function (result) {
// console.log(result);
// console.log(result.data);
$('loadantrian').empty();
if (result.code == 0) {
var res = result['data'];
let hasil = '';
for (var i = 0; i < res.length; i++) {
hasil += "<div class='box one" + i + "'> <div class='date'> <h4 >" + res[i]['nama_poli'] + "</h4> <h4 >" + res[i]['nama_ruang'] + "</h4></div> <div class='poster p" + i + "'> <h4 >" + res[i]['kode_dokter'] + "" + res[i]['no_antrian'] + "</h4> </div> </div>"
}
$("#box").append(hasil);
} else {
alert(result.info);
}
},
error: function (xhr) {
console.log('ERROR AJAX:' + xhr.status + '-' + xhr.statusText);
}
});
}
loadantrian(id_poli);
function loadantrian(param) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + `/api/loadantrian`,
data: {
id_poli: param,
},
success: function (result) {
console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result['code'] == 0) {
var res = result['data'];
$("#listdata").empty();
$('#no_antrian').empty();
let hasil = '';
for (var i = 0; i < res.length; i++) {
$('#no_antrian').empty();
$('#no_antrian').append("-");
if(res[i]['status_code']==30){
valTemp= res[i]['kode_dokter'] + res[i]['no_antrian'];
$('#no_antrian').empty();
$('#no_antrian').append(valTemp);
ruang= res[i]['nama_ruang'];
$('#ruang').empty();
$('#ruang').append(ruang);
}else{
$('#no_antrian').append("-");
}
hasil =
`
<div class="card col-sm-2" style="border-color: #e94c72;background: #faebd73b; width: 20rem;">
<div class="alert alert-info alert-styled-left alert-arrow-left alert-component" style="background: #faebd73b;">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<h1 class="error-title" style=" font-weight:;font-size:53px;font-family: Times New Roman, Times, serif;color: #fff"><span > `+res[i]['kode_dokter']+`-`+res[i]['no_antrian']+` </span></h1>
</div>
<div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
<div><input type="hidden" value="nama_ruang" id="nama_ruang" /><span style="visibility:hidden" id="nama_ruang"></span></div>
</div>
`
$("#listdata").append(hasil);
}
} else {
$('#no_antrian').empty();
$('#no_antrian').append("-");
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
loadpoli();
$('#pilih').on('click', function () {
// let poli = $("#poli option:selected").attr("value");
window.location.href = ("tampilanantrian");
loaddatadokter()
});
function loaddatadokter() {
let poli =$("#antrian_poli option:selected").attr("value");
console.log(poli);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpoli',
data: {
id_poli: poli,
},
success: function (response) {
if (response['code'] == 0) {
console.log(response);
let $id = poli;
console.log($id)
let $encodedId = btoa($id);
window.location.href = ("/umum/umumtampilan/" + $encodedId);
} else {
bootbox.alert({ message: ' gagal', centerVertical: true });
}
}, error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('data tidak ada');
}
}
});
}
function loadpoli() {
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -13,7 +53,7 @@ function loadpoli() {
success: function (result) {
if (result['code'] == 0) {
//console.log (result);
console.log (result);
var res = result['data'];
optionseg = '';
optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
......@@ -21,22 +61,60 @@ function loadpoli() {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
}
$("select#antrian_poli").html(optionseg);
let $id = result.data[0].id_poli;
// let $id = result.data['id_poli'];
// console.log($id);
} else {
bootbox.dialog({
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
}
}
});
}
\ No newline at end of file
}
// function loadantriandata() {
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loadpoli',
// success: function (result) {
// if (result['code'] == 0) {
// console.log (result);
// var res = result['data'];
// optionseg = '';
// optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
// for (var i = 0; i < res.length; i++) {
// optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
// }
// $("select#antrian_poli").html(optionseg);
// let $id = result.data[0].id_poli;
// // let $id = result.data['id_poli'];
// console.log($id);
// let $encodedId = btoa($id);
// window.location = (baseURL + "/umum/umumtampilan/"+$encodedId);
// } else {
// bootbox.dialog({
// message: "<span class='bigger-110'>" + result['info'] + "</span>",
// buttons:
// {
// "OK":
// {
// "label": "<i class='icon-ok'></i> OK ",
// "className": "btn-sm btn-danger",
// "callback": function () {
// notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
// }
// }
// }
// });
// }
// }
// });
// }
\ No newline at end of file
// SDK version: v1.0.2
// Git commit: bc6831d1ab41b3b1a3de2297f7024efbb2772d8e
'use strict';
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var defineProperty = _defineProperty;
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
defineProperty(target, key, source[key]);
});
}
return target;
}
var objectSpread = _objectSpread;
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var runtime_1 = createCommonjsModule(function (module) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = (function (exports) {
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined$1; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
exports.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
exports.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function(error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return exports.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined$1) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined$1;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined$1;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined$1;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
exports.values = values;
function doneResult() {
return { value: undefined$1, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined$1;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined$1;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined$1;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined$1;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined$1;
}
return ContinueSentinel;
}
};
// Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}(
// If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
module.exports
));
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
});
var regenerator = runtime_1;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
var asyncToGenerator = _asyncToGenerator;
function doRequest(_ref) {
var method = _ref.method,
path = _ref.path,
_ref$body = _ref.body,
body = _ref$body === void 0 ? null : _ref$body,
_ref$headers = _ref.headers,
headers = _ref$headers === void 0 ? {} : _ref$headers;
var options = {
method: method,
headers: headers
};
if (body !== null) {
options.body = JSON.stringify(body);
options.headers = objectSpread({
'Content-Type': 'application/json'
}, headers);
}
return fetch(path, options).then(
/*#__PURE__*/
function () {
var _ref2 = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee(response) {
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (response.ok) {
_context.next = 3;
break;
}
_context.next = 3;
return handleError(response);
case 3:
_context.prev = 3;
_context.next = 6;
return response.json();
case 6:
return _context.abrupt("return", _context.sent);
case 9:
_context.prev = 9;
_context.t0 = _context["catch"](3);
return _context.abrupt("return", null);
case 12:
case "end":
return _context.stop();
}
}
}, _callee, null, [[3, 9]]);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}());
}
function handleError(_x2) {
return _handleError.apply(this, arguments);
}
function _handleError() {
_handleError = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee2(response) {
var errorMessage, _ref3, _ref3$error, error, _ref3$description, description;
return regenerator.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.prev = 0;
_context2.next = 3;
return response.json();
case 3:
_ref3 = _context2.sent;
_ref3$error = _ref3.error;
error = _ref3$error === void 0 ? 'Unknown error' : _ref3$error;
_ref3$description = _ref3.description;
description = _ref3$description === void 0 ? 'No description' : _ref3$description;
errorMessage = "Unexpected status code ".concat(response.status, ": ").concat(error, ", ").concat(description);
_context2.next = 14;
break;
case 11:
_context2.prev = 11;
_context2.t0 = _context2["catch"](0);
errorMessage = "Unexpected status code ".concat(response.status, ": Cannot parse error response");
case 14:
throw new Error(errorMessage);
case 15:
case "end":
return _context2.stop();
}
}
}, _callee2, null, [[0, 11]]);
}));
return _handleError.apply(this, arguments);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var classCallCheck = _classCallCheck;
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
var createClass = _createClass;
var DeviceStateStore =
/*#__PURE__*/
function () {
function DeviceStateStore(instanceId) {
classCallCheck(this, DeviceStateStore);
this._instanceId = instanceId;
this._dbConn = null;
}
createClass(DeviceStateStore, [{
key: "connect",
value: function connect() {
var _this = this;
return new Promise(function (resolve, reject) {
var request = indexedDB.open(_this._dbName);
request.onsuccess = function (event) {
var db = event.target.result;
_this._dbConn = db;
_this._readState().then(function (state) {
return state === null ? _this.clear() : Promise.resolve();
}).then(resolve);
};
request.onupgradeneeded = function (event) {
var db = event.target.result;
db.createObjectStore('beams', {
keyPath: 'instance_id'
});
};
request.onerror = function (event) {
var error = new Error("Database error: ".concat(event.target.error));
reject(error);
};
});
}
}, {
key: "clear",
value: function clear() {
return this._writeState({
instance_id: this._instanceId,
device_id: null,
token: null,
user_id: null
});
}
}, {
key: "_readState",
value: function _readState() {
var _this2 = this;
if (!this.isConnected) {
throw new Error('Cannot read value: DeviceStateStore not connected to IndexedDB');
}
return new Promise(function (resolve, reject) {
var request = _this2._dbConn.transaction('beams').objectStore('beams').get(_this2._instanceId);
request.onsuccess = function (event) {
var state = event.target.result;
if (!state) {
resolve(null);
}
resolve(state);
};
request.onerror = function (event) {
reject(event.target.error);
};
});
}
}, {
key: "_readProperty",
value: function () {
var _readProperty2 = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee(name) {
var state;
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this._readState();
case 2:
state = _context.sent;
if (!(state === null)) {
_context.next = 5;
break;
}
return _context.abrupt("return", null);
case 5:
return _context.abrupt("return", state[name] || null);
case 6:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function _readProperty(_x) {
return _readProperty2.apply(this, arguments);
}
return _readProperty;
}()
}, {
key: "_writeState",
value: function _writeState(state) {
var _this3 = this;
if (!this.isConnected) {
throw new Error('Cannot write value: DeviceStateStore not connected to IndexedDB');
}
return new Promise(function (resolve, reject) {
var request = _this3._dbConn.transaction('beams', 'readwrite').objectStore('beams').put(state);
request.onsuccess = function (_) {
resolve();
};
request.onerror = function (event) {
reject(event.target.error);
};
});
}
}, {
key: "_writeProperty",
value: function () {
var _writeProperty2 = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee2(name, value) {
var state;
return regenerator.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return this._readState();
case 2:
state = _context2.sent;
state[name] = value;
_context2.next = 6;
return this._writeState(state);
case 6:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function _writeProperty(_x2, _x3) {
return _writeProperty2.apply(this, arguments);
}
return _writeProperty;
}()
}, {
key: "getToken",
value: function getToken() {
return this._readProperty('token');
}
}, {
key: "setToken",
value: function setToken(token) {
return this._writeProperty('token', token);
}
}, {
key: "getDeviceId",
value: function getDeviceId() {
return this._readProperty('device_id');
}
}, {
key: "setDeviceId",
value: function setDeviceId(deviceId) {
return this._writeProperty('device_id', deviceId);
}
}, {
key: "getUserId",
value: function getUserId() {
return this._readProperty('user_id');
}
}, {
key: "setUserId",
value: function setUserId(userId) {
return this._writeProperty('user_id', userId);
}
}, {
key: "getLastSeenSdkVersion",
value: function getLastSeenSdkVersion() {
return this._readProperty('last_seen_sdk_version');
}
}, {
key: "setLastSeenSdkVersion",
value: function setLastSeenSdkVersion(sdkVersion) {
return this._writeProperty('last_seen_sdk_version', sdkVersion);
}
}, {
key: "getLastSeenUserAgent",
value: function getLastSeenUserAgent() {
return this._readProperty('last_seen_user_agent');
}
}, {
key: "setLastSeenUserAgent",
value: function setLastSeenUserAgent(userAgent) {
return this._writeProperty('last_seen_user_agent', userAgent);
}
}, {
key: "_dbName",
get: function get() {
return "beams-".concat(this._instanceId);
}
}, {
key: "isConnected",
get: function get() {
return this._dbConn !== null;
}
}]);
return DeviceStateStore;
}();
self.PusherPushNotifications = {
endpointOverride: null,
onNotificationReceived: null,
_endpoint: function _endpoint(instanceId) {
return self.PusherPushNotifications.endpointOverride ? self.PusherPushNotifications.endpointOverride : "https://".concat(instanceId, ".pushnotifications.pusher.com");
},
_getVisibleClient: function _getVisibleClient() {
return self.clients.matchAll({
type: 'window',
includeUncontrolled: true
}).then(function (clients) {
return clients.find(function (c) {
return c.visibilityState === 'visible';
});
});
},
_hasVisibleClient: function _hasVisibleClient() {
return self.PusherPushNotifications._getVisibleClient().then(function (client) {
return client !== undefined;
});
},
_getFocusedClient: function _getFocusedClient() {
return self.clients.matchAll({
type: 'window',
includeUncontrolled: true
}).then(function (clients) {
return clients.find(function (c) {
return c.focused === true;
});
});
},
_hasFocusedClient: function _hasFocusedClient() {
return self.PusherPushNotifications._getFocusedClient().then(function (client) {
return client !== undefined;
});
},
reportEvent: function () {
var _reportEvent = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee(_ref) {
var eventType, pusherMetadata, instanceId, publishId, hasDisplayableContent, hasData, deviceStateStore, deviceId, userId, appInBackground, path, options;
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
eventType = _ref.eventType, pusherMetadata = _ref.pusherMetadata;
instanceId = pusherMetadata.instanceId, publishId = pusherMetadata.publishId, hasDisplayableContent = pusherMetadata.hasDisplayableContent, hasData = pusherMetadata.hasData;
if (!(!instanceId || !publishId)) {
_context.next = 4;
break;
}
return _context.abrupt("return");
case 4:
deviceStateStore = new DeviceStateStore(instanceId);
_context.next = 7;
return deviceStateStore.connect();
case 7:
_context.next = 9;
return deviceStateStore.getDeviceId();
case 9:
deviceId = _context.sent;
_context.next = 12;
return deviceStateStore.getUserId();
case 12:
_context.t0 = _context.sent;
if (_context.t0) {
_context.next = 15;
break;
}
_context.t0 = null;
case 15:
userId = _context.t0;
_context.next = 18;
return self.PusherPushNotifications._hasVisibleClient();
case 18:
appInBackground = !_context.sent;
path = "".concat(self.PusherPushNotifications._endpoint(instanceId), "/reporting_api/v2/instances/").concat(instanceId, "/events");
options = {
method: 'POST',
path: path,
body: {
publishId: publishId,
event: eventType,
deviceId: deviceId,
userId: userId,
timestampSecs: Math.floor(Date.now() / 1000),
appInBackground: appInBackground,
hasDisplayableContent: hasDisplayableContent,
hasData: hasData
}
};
_context.prev = 21;
_context.next = 24;
return doRequest(options);
case 24:
_context.next = 28;
break;
case 26:
_context.prev = 26;
_context.t1 = _context["catch"](21);
case 28:
case "end":
return _context.stop();
}
}
}, _callee, null, [[21, 26]]);
}));
function reportEvent(_x) {
return _reportEvent.apply(this, arguments);
}
return reportEvent;
}()
};
self.addEventListener('push', function (e) {
var payload;
try {
payload = e.data.json();
} catch (_) {
return; // Not a pusher notification
}
if (!payload.data || !payload.data.pusher) {
return; // Not a pusher notification
} // Report analytics event, best effort
self.PusherPushNotifications.reportEvent({
eventType: 'delivery',
pusherMetadata: payload.data.pusher
});
var customerPayload = objectSpread({}, payload);
var customerData = {};
Object.keys(customerPayload.data || {}).forEach(function (key) {
if (key !== 'pusher') {
customerData[key] = customerPayload.data[key];
}
});
customerPayload.data = customerData;
var pusherMetadata = payload.data.pusher;
var handleNotification =
/*#__PURE__*/
function () {
var _ref2 = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee2(payloadFromCallback) {
var hideNotificationIfSiteHasFocus, title, body, icon, options;
return regenerator.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
hideNotificationIfSiteHasFocus = payloadFromCallback.notification.hide_notification_if_site_has_focus === true;
_context2.t0 = hideNotificationIfSiteHasFocus;
if (!_context2.t0) {
_context2.next = 6;
break;
}
_context2.next = 5;
return self.PusherPushNotifications._hasFocusedClient();
case 5:
_context2.t0 = _context2.sent;
case 6:
if (!_context2.t0) {
_context2.next = 8;
break;
}
return _context2.abrupt("return");
case 8:
title = payloadFromCallback.notification.title || '';
body = payloadFromCallback.notification.body || '';
icon = payloadFromCallback.notification.icon;
options = {
body: body,
icon: icon,
data: {
pusher: {
customerPayload: payloadFromCallback,
pusherMetadata: pusherMetadata
}
}
};
return _context2.abrupt("return", self.registration.showNotification(title, options));
case 13:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return function handleNotification(_x2) {
return _ref2.apply(this, arguments);
};
}();
if (self.PusherPushNotifications.onNotificationReceived) {
self.PusherPushNotifications.onNotificationReceived({
payload: customerPayload,
pushEvent: e,
handleNotification: handleNotification
});
} else {
e.waitUntil(handleNotification(customerPayload));
}
});
self.addEventListener('notificationclick', function (e) {
var pusher = e.notification.data.pusher;
var isPusherNotification = pusher !== undefined;
if (isPusherNotification) {
// Report analytics event, best effort
self.PusherPushNotifications.reportEvent({
eventType: 'open',
pusherMetadata: pusher.pusherMetadata
});
if (pusher.customerPayload.notification.deep_link) {
e.waitUntil(clients.openWindow(pusher.customerPayload.notification.deep_link));
}
e.notification.close();
}
});
\ No newline at end of file
......@@ -36,7 +36,7 @@ input, button {
input, select {
border: 1px solid #CCC;
width: 20px; }
width: 250px; }
::-webkit-input-placeholder {
color: #BBB; }
......
......@@ -39,34 +39,34 @@ input:hover, input:focus {
/* line 18, ../../01 cl html template/03_jun 2019/182_medico_html/sass/_common.scss */
.section_padding {
padding: 50px 0px;
padding: 140px 0px;
}
@media only screen and (min-width: 992px) and (max-width: 1200px) {
/* line 18, ../../01 cl html template/03_jun 2019/182_medico_html/sass/_common.scss */
.section_padding {
padding: 40px 0px;
padding: 80px 0px;
}
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
/* line 18, ../../01 cl html template/03_jun 2019/182_medico_html/sass/_common.scss */
.section_padding {
padding: 30px 0px;
padding: 70px 0px;
}
}
@media (max-width: 576px) {
/* line 18, ../../01 cl html template/03_jun 2019/182_medico_html/sass/_common.scss */
.section_padding {
padding: 30px 0px;
padding: 70px 0px;
}
}
@media only screen and (min-width: 576px) and (max-width: 767px) {
/* line 18, ../../01 cl html template/03_jun 2019/182_medico_html/sass/_common.scss */
.section_padding {
padding: 30px 0px;
padding: 70px 0px;
}
}
......
......@@ -3,57 +3,33 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
Chart.defaults.global.defaultFontColor = '#858796';
// Pie Chart Example
// var ctx = document.getElementById("myPieChart");
// var myPieChart = new Chart(ctx, {
// type: 'doughnut',
// data: {
// labels: ["Direct", "Referral", "Social"],
// datasets: [{
// data: [55, 30, 15],
// backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
// hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],
// hoverBorderColor: "rgba(234, 236, 244, 1)",
// }],
// },
// options: {
// maintainAspectRatio: false,
// tooltips: {
// backgroundColor: "rgb(255,255,255)",
// bodyFontColor: "#858796",
// borderColor: '#dddfeb',
// borderWidth: 1,
// xPadding: 15,
// yPadding: 15,
// displayColors: false,
// caretPadding: 10,
// },
// legend: {
// display: false
// },
// cutoutPercentage: 80,
// },
// });
jumlahantrian()
function jumlahantrian() {
var id = document.getElementById("myPieChart");
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadtotalantrian',
success: function (result) {
console.log(result)
}
});
}
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Direct", "Referral", "Social"],
datasets: [{
data: [55, 30, 15],
backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],
hoverBorderColor: "rgba(234, 236, 244, 1)",
}],
},
options: {
maintainAspectRatio: false,
tooltips: {
backgroundColor: "rgb(255,255,255)",
bodyFontColor: "#858796",
borderColor: '#dddfeb',
borderWidth: 1,
xPadding: 15,
yPadding: 15,
displayColors: false,
caretPadding: 10,
},
legend: {
display: false
},
cutoutPercentage: 80,
},
});
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