Commit cd87a10e authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

pemabnahan dan memperbaiki fitur

parent 95e7301f
...@@ -33,7 +33,10 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -33,7 +33,10 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-panggil.js'); $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->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; return $view;
...@@ -70,7 +73,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -70,7 +73,7 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; return $view;
} }
public function kelolapasienAction() public function antrianterlewatAction()
{ {
$this->isLoggedIn(); $this->isLoggedIn();
$view = new ViewModel(); $view = new ViewModel();
...@@ -81,7 +84,23 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -81,7 +84,23 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolapasien.js'); $this->headScript->appendFile('/action-js/antrian-js/action-kelolaantrian.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianunregisterAction()
{
$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-kelolaantrianunreg.js');
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; return $view;
...@@ -118,6 +137,22 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -118,6 +137,22 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; 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() public function kelolaruanganAction()
{ {
$this->isLoggedIn(); $this->isLoggedIn();
...@@ -150,22 +185,7 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -150,22 +185,7 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
return $view; 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() public function tampilanumumAction()
{ {
$this->isLoggedIn(); $this->isLoggedIn();
......
...@@ -137,19 +137,24 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -137,19 +137,24 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$no_rekam_medis = $post->ino_rekam_medis; $no_rekam_medis = $post->ino_rekam_medis;
$ktp = $post->iktp;
$cekpasien = $test->cekpasien($no_rekam_medis); $cekpasien = $test->cekpasien($no_rekam_medis);
$validasi = $test->cekktp($no_rekam_medis, $ktp);
$array = array(
'validasiinput' => $validasi->code,
'datapasien'=> $cekpasien->data
);
// print_r($cekpasien) ;die; // print_r($no_rekam_medis) ;die;
if($cekpasien->code == 0){ if($cekpasien->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS; $result->info = $result::INFO_SUCCESS;
$result->data = $cekpasien->data ; $result->data = $array;
}else{ }else{
$result->code = 1; $result->code = 1;
$result->info = 'Not Found'; $result->info = 'Not Found';
...@@ -604,11 +609,14 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -604,11 +609,14 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function savekelolapoliAction(){ public function savekelolapoliAction(){
if($this->isLoggedIn()){ if($this->isLoggedIn()){
$result = new Result(); $result = new Result();
$request = $this->getRequest(); $request = $this->getRequest();
$post = $request->getPost(); $post = $request->getPost();
$table_poli= 'poli'; $table_poli= 'poli';
...@@ -618,8 +626,10 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -618,8 +626,10 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage); $param = new \Application\Model\Param($storage);
try{
try{
$nama_poli = $post->inama_poli; $nama_poli = $post->inama_poli;
$kode_poli = $post->ikode_poli; $kode_poli = $post->ikode_poli;
$deskripsi_poli = $post->ideskripsi_poli; $deskripsi_poli = $post->ideskripsi_poli;
...@@ -772,6 +782,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -772,6 +782,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage); $param = new \Application\Model\Param($storage);
try{ try{
$nama_dokter = $post->inama_dokter; $nama_dokter = $post->inama_dokter;
...@@ -800,13 +811,13 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -800,13 +811,13 @@ class ApiController extends \Application\Master\GlobalActionController {
// print_r($dataArraydokter);die; // print_r($dataArraydokter);die;
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$param->saveGlobal($Dokter, $table_dokter); $param->saveGlobal($Dokter, $table_dokter);
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$result->code = 0; $result->code = 0;
$result->info = 'ok'; $result->info = 'ok';
$result->data = $dataArraydokter->data; $result->data = $DokterPoli->data;
}catch (\Exception $exc) { }catch (\Exception $exc) {
...@@ -955,11 +966,13 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -955,11 +966,13 @@ class ApiController extends \Application\Master\GlobalActionController {
try{ try{
$nama_ruang = $post->inama_ruang; $nama_ruang = $post->inama_ruang;
$lantai = $post->ilantai;
$poli = $post->ipoli; $poli = $post->ipoli;
//print_r($poli);die; //print_r($poli);die;
$dataArrayruang = array ( $dataArrayruang = array (
'nama_ruang' =>'R '.$nama_ruang, 'nama_ruang' =>$nama_ruang,
'lantai' =>$lantai,
'id_poli' =>$poli, 'id_poli' =>$poli,
'id_condition' => 1 'id_condition' => 1
); );
...@@ -1000,6 +1013,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1000,6 +1013,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_ruang = $post->id; $id_ruang = $post->id;
$nama_ruang = $post->inama_ruang; $nama_ruang = $post->inama_ruang;
$poli = $post->ipoli; $poli = $post->ipoli;
$lantai = $post->ilantai;
$condition = $post->icondition; $condition = $post->icondition;
...@@ -1008,6 +1022,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1008,6 +1022,7 @@ class ApiController extends \Application\Master\GlobalActionController {
'nama_ruang' =>$nama_ruang, 'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli, 'id_poli' =>$poli,
'lantai' =>$lantai,
'id_condition' =>$condition, 'id_condition' =>$condition,
); );
...@@ -1061,18 +1076,182 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1061,18 +1076,182 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function loadkelolaantrianAction(){ public function loadantrianmissAction(){
$result = new Result(); $result = new Result();
$request = $this->getRequest(); $request = $this->getRequest();
$post = $request->getPost(); $post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name'); //$n
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$load = $test->loadantrianmiss($post->id);
// print_r($load);die;
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadantrianunregisAction(){
$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);
$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;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadkelolapasienAction(){
$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->loadkelolapasien($post->id_pasien);
// 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;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
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());
$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,
);
$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();
$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);
$tabel = 'pasien';
$where = 'id_pasien='.$post->id_pasien;
// print_r($where);die;
$res = $test->deleteGlobal($tabel, $where);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadpasienAction(){
$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($post->id);die;
$load = $test->loadpasien($post->id);
if($load->code == 0){ if($load->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
...@@ -1461,6 +1640,52 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1461,6 +1640,52 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); 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(){ public function tampildokterAction(){
$result = new Result(); $result = new Result();
...@@ -1489,4 +1714,156 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1489,4 +1714,156 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); 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());
}
} }
\ No newline at end of file
...@@ -116,7 +116,7 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -116,7 +116,7 @@ class QueueController extends \Application\Master\GlobalActionController
} }
public function poliAction() public function poliAction()
{ {
$this->isLoggedIn();
$view = new ViewModel(); $view = new ViewModel();
$result = new Result(); $result = new Result();
...@@ -124,8 +124,30 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -124,8 +124,30 @@ class QueueController extends \Application\Master\GlobalActionController
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost()); $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()
{
$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 baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/index-js/action-listdata.js'); $this->headScript->appendScript(' var id = "' . $id. '"');
$this->headScript->appendFile('/action-js/antrian-js/action-poli.js');
$this->layout("layout/layoutQueue"); $this->layout("layout/layoutQueue");
return $view; return $view;
...@@ -159,15 +181,7 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -159,15 +181,7 @@ class QueueController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath()); $getpath = explode("/",$uri->getPath());
$decodeid = base64_decode($getpath[3]); $decodeid = base64_decode($getpath[3]);
// $a = $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()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage); $param = new \Application\Model\Param($storage);
......
...@@ -61,12 +61,20 @@ class Param extends Mapper { ...@@ -61,12 +61,20 @@ class Param extends Mapper {
$data = $this->_storage->loadUserData($id,$iddok); $data = $this->_storage->loadUserData($id,$iddok);
return $data; return $data;
} }
public function loadpasien($id = null){
$data = $this->_storage->loadpasien($id);
return $data;
}
public function loaddatapasien($id){ public function loaddatapasien($id){
$data = $this->_storage->loaddatapasien($id); $data = $this->_storage->loaddatapasien($id);
return $data; return $data;
} }
public function cekpasien($no_rekam_medis = null){ public function cekpasien($no_rekam_medis = null,$ktp = null ){
$data = $this->_storage->cekpasien($no_rekam_medis); $data = $this->_storage->cekpasien($no_rekam_medis, $ktp);
return $data;
}
public function cekktp($no_rekam_medis, $ktp){
$data = $this->_storage->cekktp($no_rekam_medis, $ktp);
return $data; return $data;
} }
...@@ -98,6 +106,10 @@ class Param extends Mapper { ...@@ -98,6 +106,10 @@ class Param extends Mapper {
$data = $this->_storage->loadkelolapoli($id); $data = $this->_storage->loadkelolapoli($id);
return $data; return $data;
} }
public function loadkelolapasien($id = null){
$data = $this->_storage->loadkelolapasien($id);
return $data;
}
public function loadkeloladokter($id = null){ public function loadkeloladokter($id = null){
$data = $this->_storage->loadkeloladokter($id); $data = $this->_storage->loadkeloladokter($id);
return $data; return $data;
...@@ -110,8 +122,12 @@ class Param extends Mapper { ...@@ -110,8 +122,12 @@ class Param extends Mapper {
$data = $this->_storage->updatekelolaantrian($idpasien,$iddok); $data = $this->_storage->updatekelolaantrian($idpasien,$iddok);
return $data; return $data;
} }
public function loadkelolaantrian($id){ public function loadantrianmiss($id){
$data = $this->_storage->loadkelolaantrian($id); $data = $this->_storage->loadantrianmiss($id);
return $data;
}
public function loadantrianunregis($id){
$data = $this->_storage->loadantrianunregis($id);
return $data; return $data;
} }
public function loadPoli($id = null){ public function loadPoli($id = null){
...@@ -143,8 +159,30 @@ class Param extends Mapper { ...@@ -143,8 +159,30 @@ class Param extends Mapper {
$data = $this->_storage->loadAntrian($id); $data = $this->_storage->loadAntrian($id);
return $data; 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 tampilpoli($id = null){
$data = $this->_storage-> tampilpoli($id);
return $data;
}
public function tampildatapoli($id = null){
$data = $this->_storage-> tampildatapoli($id);
return $data;
}
public function tampildokter(){ public function tampildokter(){
$data = $this->_storage->tampildokter(); $data = $this->_storage->tampildokter();
return $data; return $data;
......
...@@ -359,6 +359,47 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -359,6 +359,47 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result->info = 'ERROR : ' . $ex->getMessage(); $result->info = 'ERROR : ' . $ex->getMessage();
} }
return $result; return $result;
}
public function loadpasien($id){
$result = new Result();
try {
$sql = " SELECT * FROM pasien";
if($id){
$sql .= " WHERE id_pasien = $id ";
}
$sql .= " ORDER BY no_rekam_medis ASC";
$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(){ public function loadMaxCounter(){
...@@ -431,6 +472,155 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -431,6 +472,155 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; 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 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';
}
}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 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(){
$result = new Result();
try {
$sql = " SELECT count(status_code) FROM antrian_pasien
WHERE status_code = 50 ";
// 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 getRegister($where){ public function getRegister($where){
$result = new Result(); $result = new Result();
try { try {
...@@ -471,7 +661,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -471,7 +661,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
public function cekpasien($no_rekam_medis){ public function cekpasien($no_rekam_medis){
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT p.id_pasien, ap.no_rekam_medis, ap.status_code,ap.no_antrian ,ap.no_antrian, ap.id_antrian,ap.nama FROM pasien p $sql = " SELECT 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 LEFT JOIN antrian_pasien ap
...@@ -506,6 +696,57 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -506,6 +696,57 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; 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){ public function loadRegisterPoli($id = null){
$result = new Result(); $result = new Result();
...@@ -685,6 +926,49 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -685,6 +926,49 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date"; $sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date";
// print_r($sql);die;
$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; // print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -813,7 +1097,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -813,7 +1097,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition $sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition, ruang.lantai
FROM RUANG FROM RUANG
INNER JOIN poli INNER JOIN poli
ON ruang.id_poli = poli.id_poli ON ruang.id_poli = poli.id_poli
...@@ -857,7 +1141,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -857,7 +1141,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; return $result;
} }
public function loadkelolaantrian($id){ public function loadantrianmiss($id){
$result = new Result(); $result = new Result();
try { try {
...@@ -877,6 +1161,53 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -877,6 +1161,53 @@ 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; // print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -966,7 +1297,8 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -966,7 +1297,8 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
FROM antrian_pasien FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli ON antrian_pasien.id_poli = poli.id_poli
GROUP BY poli.id_poli"; GROUP BY poli.id_poli
ORDER BY nama_poli asc";
...@@ -1046,11 +1378,52 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1046,11 +1378,52 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = "SELECT dokter_to_poli.id_dokter,dokter_to_poli.image, dokter_to_poli.nama_dokter , poli.nama_poli $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
FROM dokter_to_poli FROM dokter_to_poli
INNER JOIN poli INNER JOIN poli
ON dokter.id_poli = poli.id_poli ON dokter_to_poli.id_poli = poli.id_poli
ORDER BY nama_poli ASC "; ORDER BY nama_poli ASC ";
// $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 tampildatapoli($id){
$result = new Result();
try {
$sql = "SELECT * FROM poli
where id_poli=$id";
// $sql .= " ORDER BY jumlah DESC"; // $sql .= " ORDER BY jumlah DESC";
...@@ -1086,6 +1459,61 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1086,6 +1459,61 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; 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 ){ public function loadPilihAntrian($iddok ){
$result = new Result(); $result = new Result();
......
<!-- 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 class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</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="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12"> <div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5"> <div class="card o-hidden border-0 shadow-lg my-5">
...@@ -12,11 +6,15 @@ ...@@ -12,11 +6,15 @@
<button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button> <button type="button" class="btn btn-primary fa fa-plus btn-lg" data-toggle="modal" data-target="#addData" id="tambahmodal"> Tambah</button>
<br> <br>
<br> <br>
<table class="table table-bordered" id="dataTable"> <table class="table table-bordered" id="dataTable">
<thead> <thead>
<tr> <tr>
<tr class="table-infos"> <tr class="table-infos">
<th style="width: 70px">NO</> <th style="width: 70px">NO</th>
<!-- <th colspan="" class=" thLeftText">Id Poli</th> --> <!-- <th colspan="" class=" thLeftText">Id Poli</th> -->
<th colspan="" class=" thLeftText">Nama Poli</th> <th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th colspan="" class=" thLeftText">Nama Dokter</th>
...@@ -53,7 +51,7 @@ ...@@ -53,7 +51,7 @@
<div class="form-group"> <div class="form-group">
<label>Nama Poli</label> <label>Nama Poli</label>
<select name="nama_poli" id="poli" class="form-control" > <select name="poli" id="poli" class="form-control" >
<option disable selected> Pilih </option> <option disable selected> Pilih </option>
</select> </select>
...@@ -138,6 +136,3 @@ ...@@ -138,6 +136,3 @@
</div> </div>
</div> </div>
</body>
</html>
...@@ -3,31 +3,19 @@ ...@@ -3,31 +3,19 @@
<div class="col-xl-12 col-lg-12 col-md-12"> <div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5"> <div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body "> <div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Antrian Pasien</h1> <h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola 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"> <table class="table table-bordered" id="dataTable">
<thead > <thead >
<tr> <tr>
<th style="width: 70px">NO</th> <th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">NO Antrian Pasien</th> <th colspan="" class=" thLeftText">NO Rekam Medis</th>
<th colspan="" class=" thLeftText">No Induk Kependudukan (NIK)</th>
<th colspan="" class=" thLeftText">Nama Pasien</th> <th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th colspan="" class=" thLeftText">Tempat Lahir </th>
<th colspan="" class=" thLeftText">Nama Poli</th> <th colspan="" class=" thLeftText">Tanggal Lahir</th>
<th colspan="" class=" thLeftText">Status</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">Action</th> <th colspan="" class=" thLeftText">Action</th>
</tr> </tr>
</thead> </thead>
...@@ -40,3 +28,65 @@ ...@@ -40,3 +28,65 @@
</div> </div>
</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="text" 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>
...@@ -53,32 +53,28 @@ ...@@ -53,32 +53,28 @@
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form id="myForm" > <form id="myForm">
<div class="form-group"> <div class="form-group">
<label>Nama Poli</label> <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> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Kode Poli</label> <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>
<div class="form-group"> <div class="form-group">
<label>Deskripsi Poli</label> <label>Deskripsi Poli</label>
<textarea type="type" id="deskripsi_poli" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea> <textarea type="input" style="height:100px;" id="deskripsi_poli" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
</div> </div>
<div class="form-group " >
<!-- <div class="form-group ">
<label>Gambar Poli</label> <label>Gambar Poli</label>
<input type="file" name="uploadimage" id="uploadimage" class="form-control"> <input type="file" name="image_poli" id="image_poli" class="form-control-file">
</div> --> </div>
<div class="modal-footer"> <div class="modal-footer">
<button button type="button" class="btn btn-primary" id="tambah">Add</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="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</form> </form>
...@@ -106,23 +102,23 @@ ...@@ -106,23 +102,23 @@
<div class="form-group"> <div class="form-group">
<label>Nama Poli</label> <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> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Kode Poli</label> <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>
<div class="form-group"> <div class="form-group">
<label>Deskripsi Poli</label> <label>Deskripsi Poli</label>
<textarea type="type" id="deskripsi_poliEdt" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea> <textarea type="input" style="height:100px;" id="deskripsi_poliEdt" name="deskripsi_poli" class="form-control" placeholder="Deskripsi Poli" required ></textarea>
</div> </div>
<!-- <div class="form-group "> <div class="form-group ">
<label>Gambar Poli</label> <label>Gambar Poli</label>
<input type="file" name="uploadimage" id="uploadimage" class="form-control"> <input type="file" name="image_poli" id="image_poliedt" class="form-control-file"></input>
</div> --> </div>
<div class="modal-footer"> <div class="modal-footer">
<button button type="button" class="btn btn-primary" id="edit">Edit</button> <button button type="button" class="btn btn-primary" id="edit">Edit</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button> <button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
...@@ -136,3 +132,4 @@ ...@@ -136,3 +132,4 @@
</div> </div>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<th style="width: 70px">NO</th> <th style="width: 70px">NO</th>
<!-- <th colspan="" class=" thLeftText">Id Poli</th> --> <!-- <th colspan="" class=" thLeftText">Id Poli</th> -->
<th colspan="" class=" thLeftText">Nama 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">Ruangan</th>
<th colspan="" class=" thLeftText">Kondisi Ruang</th> <th colspan="" class=" thLeftText">Kondisi Ruang</th>
<th colspan="" class=" thLeftText">Action</th> <th colspan="" class=" thLeftText">Action</th>
...@@ -62,13 +63,17 @@ ...@@ -62,13 +63,17 @@
<option disable selected> Pilih </option> <option disable selected> Pilih </option>
</select> </select>
</div> </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"> <div class="form-group">
<label>Ruangan</label> <label>Ruangan</label>
<input type="input" id="nama_ruang" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input> <input type="input" id="nama_ruang" name="nama_ruang" class="form-control" placeholder="Nama Ruangan" required /></input>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button button type="button" class="btn btn-primary" id="tambah">Add</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="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</form> </form>
...@@ -96,6 +101,10 @@ ...@@ -96,6 +101,10 @@
</select> </select>
</div > </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"> <div class="form-group">
<label>Ruangan</label> <label>Ruangan</label>
<input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input> <input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<thead> <thead>
<tr class="table-infos"> <tr class="table-infos">
<th style="">NO</th> <th style="">NO</th>
<th colspan="" class=" thLeftText">Jenis Layanan (Poli)</th> <th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th> <th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruangan</th> <th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th> <th colspan="" class=" thLeftText">Antrian Seluruh</th>
......
...@@ -42,7 +42,12 @@ input::-webkit-inner-spin-button { ...@@ -42,7 +42,12 @@ input::-webkit-inner-spin-button {
<div class="form-group"> <div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br> <label> <h5>No Rekam Medis</h5></label><br>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" style="width: 950px;display:inline;"></input> <input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" ></input>
</div>
<div class="form-group">
<label> <h5>No Induk Kependudukan (NIK)</h5></label><br>
<input type="number" id="ktp" placeholder="No Induk Kependudukan (NIK)" class="form-control"max="9999999999999999" maxlength="16" ></input>
</div> </div>
<p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p> <p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p>
<a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a> <a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a>
......
...@@ -5,6 +5,7 @@ input::-webkit-inner-spin-button { ...@@ -5,6 +5,7 @@ input::-webkit-inner-spin-button {
margin: 0; margin: 0;
} }
</style> </style>
...@@ -41,14 +42,22 @@ input::-webkit-inner-spin-button { ...@@ -41,14 +42,22 @@ input::-webkit-inner-spin-button {
<input type="hidden" id="iInput" class="form-control" /></input> <input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group"> <div class="form-group">
<label><h5>No Induk KTP</h5></label> <label><h5>No Induk Kependudukan (NIK)</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk KTP" max="9999999999999999" maxlength="16"></input> <input type="number" id="ktp" class="form-control" placeholder="No Induk Kependudukan (NIK)" max="9999999999999999" maxlength="16"></input>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><h5>Nama Pasien</h5></label> <label><h5>Nama Pasien</h5></label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input> <input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input>
</div> </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 "> <div class="form-group ">
<label><h5>Tempat Lahir</h5></label> <label><h5>Tempat Lahir</h5></label>
...@@ -68,6 +77,8 @@ input::-webkit-inner-spin-button { ...@@ -68,6 +77,8 @@ input::-webkit-inner-spin-button {
<label><h5>No HP</h5></label> <label><h5>No HP</h5></label>
<input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input> <input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input>
</div> </div>
</form> </form>
......
...@@ -63,9 +63,6 @@ input[type="picked"] + label { ...@@ -63,9 +63,6 @@ input[type="picked"] + label {
width : 55px; width : 55px;
cursor:not-allowed; cursor:not-allowed;
text-align:center; text-align:center;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- breadcrumb start--> <!-- breadcrumb start-->
<!--::doctor_part start::--> <!--::doctor_part start::-->
<section class="doctor_part single_page_doctor_part"> <section class="doctor_part single_page_doctor_part" style="padding:20px;">
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-xl-8"> <div class="col-xl-8">
...@@ -34,26 +34,5 @@ ...@@ -34,26 +34,5 @@
<div class="row dokter"> <div class="row dokter">
</div> </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> </div>
</section> </section>
<!--::doctor_part end::-->
\ No newline at end of file
...@@ -20,46 +20,18 @@ ...@@ -20,46 +20,18 @@
<!-- breadcrumb start--> <!-- breadcrumb start-->
<!-- feature_part start--> <!-- feature_part start-->
<section class="feature_part"> <section class="doctor_part single_page_doctor_part" style="padding:0px;">
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-xl-8"> <div class="col-xl-8">
<div class="section_tittle text-center"> <div class="section_tittle text-center">
<h2>Poli Kami</h2> <h2> Poli Kami </h2>
</div> </div>
</div> </div>
</div> </div>
<div class="row justify-content-between align-items-center">
<div class="col-lg-3 col-md-4 col-xs-6 thumb"> <div class="row poli">
<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>
</div> </div>
</section> </section>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<script src="<?php $this->basePath();?>/tamplateadmin/assets/js/plugins/notifications/sweet_alert.min.js"></script> <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> <script src="<?php $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script>
<!-- Page level custom scripts --> <!-- Page level custom scripts -->
<!-- <script src="<?php $this->basePath();?>/tamplateadmin/js/demo/datatables-demo.js"></script> --> <script src="<?php $this->basePath();?>/tamplateadmin/vendor/chart.js/Chart.min.js"></script>
<body id="page-top"> <body id="page-top">
...@@ -120,13 +120,24 @@ ...@@ -120,13 +120,24 @@
<div class="sidebar-heading" > <div class="sidebar-heading" >
Feature Feature
</div> </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"> <li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/kelolapasien') ?>"> <a class="nav-link collapsed" href="<?php echo $this->basePath('admin/kelolapasien') ?>">
<i class="fas fa-fw fa-table"></i> <i class="fas fa-fw fa-table"></i>
<span>Kelola Antrian </span> <span>Kelola Pasien </span>
</a> </a>
</li> </li>
......
...@@ -43,6 +43,15 @@ ...@@ -43,6 +43,15 @@
float:left; margin:5px; float:left; margin:5px;
margin-bottom:1px; 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> </style>
<body> <body>
...@@ -54,9 +63,7 @@ ...@@ -54,9 +63,7 @@
<div class="col-lg-12"> <div class="col-lg-12">
<nav class="navbar navbar-expand-lg navbar-light"> <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> <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" <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse main-menu-item justify-content-center" <div class="collapse navbar-collapse main-menu-item justify-content-center"
...@@ -66,18 +73,20 @@ ...@@ -66,18 +73,20 @@
<a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a> <a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi </a> <a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi Antrian </a>
</li> </li>
<!-- <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/') ?>">Pilih Antrian</a>
</li> -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a> <a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a> <a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a>
</li> </li>
<!-- <li class="nav-item">
<a class="nav-link " href="<?php echo $this->basePath('user/login') ?>">Login</a>
</li>
-->
</ul> </ul>
</div> </div>
</nav> </nav>
...@@ -106,21 +115,17 @@ ...@@ -106,21 +115,17 @@
<div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget"> <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> <a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/beranda') ?>/tamplate/img/logo.png" alt="#"> </a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor </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>
<div class="col-xl-9 col-sm-6 col-md-4 single-footer-widget"> <div class="col-xl-9 col-sm-6 col-md-4 single-footer-widget">
<h4>Quick Links</h4> <h4>Quick Links</h4>
<ul> <ul>
<li><a href="#">Beranda</a></li> <li><a href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a></li>
<li><a href="#">Registrasi Antrian</a></li> <li><a href="<?php echo $this->basePath('queue/pocekdatapasienli') ?>">Registrasi Antrian</a></li>
<li><a href="#">Dokter</a></li> <li><a href="<?php echo $this->basePath('queue/dokter') ?>">Dokter</a></li>
<li><a href="#">Poli</a></li> <li><a href="<?php echo $this->basePath('queue/poli') ?>">Poli</a></li>
<li><a href="#">Tentang Kami</a></li> <li><a href="<?php echo $this->basePath('user/login') ?>">Login</a></li>
</ul> </ul>
</div> </div>
...@@ -143,13 +148,8 @@ ...@@ -143,13 +148,8 @@
is made with <i class="ti-heart" aria-hidden="true"></i> by <a href="https://colorlib.com" is made with <i class="ti-heart" aria-hidden="true"></i> by <a href="https://colorlib.com"
target="_blank">Colorlib</a> target="_blank">Colorlib</a>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --> <!-- 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> </div>
</div> </div>
......
$('#cekdata').on('click', function () { $('#cekdata').on('click', function () {
let no_rekam_medis = $('#no_rekam_medis').val(); let no_rekam_medis = $('#no_rekam_medis').val();
cekpasien(no_rekam_medis); let ktp = $('#ktp').val();
cekpasien(no_rekam_medis, ktp);
}) })
function cekpasien() { function cekpasien(no_rekam_medis, ktp) {
let no_rekam_medis = $('#no_rekam_medis').val();
// alert(no_rekam_medis);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/cekpasien', url: baseURL + '/api/cekpasien',
data: { data: {
ino_rekam_medis: no_rekam_medis, ino_rekam_medis: no_rekam_medis,
iktp: ktp,
}, },
success: function (result) { 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 });
if (result.code == 0) { }
else if (result.data['validasiinput'] == 0) {
console.log(result.data); console.log(result.data['datapasien'][0]['no_rekam_medis']);
// alert('berhasil');
if (result.data[0]['no_rekam_medis'] == null) { if (result.data['datapasien'][0]['no_rekam_medis'] == null) {
let $id = result.data[0]['id_pasien']; let $id = result.data['datapasien'][0]['id_pasien'];
let $encodedId = btoa($id); let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId); window.location.href = ("datapasien/" + $encodedId);
} }
if (result.data[0]['no_rekam_medis'] != null && (result.data[0]['status_code'] == 10)) { if (result.data['datapasien'][0]['no_rekam_medis'] != null && (result.data['datapasien'][0]['status_code'] == 10)) {
let $idantrian = result.data[0]['id_antrian']; let $idantrian = result.data['datapasien'][0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian) let $encodedIdantrian = btoa($idantrian)
let no_rekam_medis = result.data[0]['no_rekam_medis']; let no_rekam_medis = result.data['datapasien'][0]['no_rekam_medis'];
let nama = result.data[0]['nama']; let nama = result.data['datapasien'][0]['nama'];
swal({ swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ", title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error", type: "error",
...@@ -41,40 +50,27 @@ function cekpasien() { ...@@ -41,40 +50,27 @@ function cekpasien() {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian); 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 }); bootbox.alert({ message: "Pasien Sedang Dalam Antrian", centerVertical: true });
} else if (result.data[0]['status_code'] == 30) { } else if (result.data['datapasien'][0]['status_code'] == 30) {
bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true }); bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true });
} else if (result.data[0]['status_code'] == 40) { } else if (result.data['datapasien'][0]['status_code'] == 40) {
bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true }); bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true });
} else if (result.data[0]['status_code'] == 50) { } else if (result.data['datapasien'][0]['status_code'] == 50) {
bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true }); bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true });
} else if (result.data[0]['status_code'] == 60) { } else if (result.data['datapasien'][0]['status_code'] == 60) {
bootbox.alert({ message: "Pasien Sedang Telah Terlewat Silahkan Hubungi Petugas", centerVertical: true }); 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 });
// $('#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 { } else {
bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true }); // bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
} }
}, },
...@@ -85,6 +81,86 @@ function cekpasien() { ...@@ -85,6 +81,86 @@ function cekpasien() {
} }
function validasidokter(no_rekam_medis, ktp) {
var exist = 0;
$.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);
}
});
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;
});
})
...@@ -6,11 +6,13 @@ $('#cetak').on('click', function (e) { ...@@ -6,11 +6,13 @@ $('#cetak').on('click', function (e) {
w.document.write('<html><body><table border="" >' + w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' + '<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' + '<tbody><tr>' +
'<th><h2>ANTRIAN</h2>' + '<th><h3>No Rekam Medis : ' + no_rekam_medis_cetak + '</h3>' +
'<h2>ANTRIAN</h2>' +
'<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' + '<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' +
'<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' + '<h4>Nama Pasien : ' + nama_pasien_cetak + '</h4>' +
'<h3>Poli : ' + kode_poli_cetak + '</h3>' + '<h4>Poli : ' + kode_poli_cetak + '</h4>' +
'<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' + '<h5>Nama Dokter : ' + nama_dokter_cetak + '</h5>' +
'<div class="h6a" style="text-align:right;font-size: 11px;";>No rekam medis tidak boleh hilang</div>' +
'</th></tr></tbody></table></body></html>'); '</th></tr></tbody></table></body></html>');
w.window.print(); w.window.print();
w.document.close(); w.document.close();
......
...@@ -24,12 +24,52 @@ $(document).ready(function () { ...@@ -24,12 +24,52 @@ $(document).ready(function () {
$('#tambahdata').on('click', function () { $('#tambahdata').on('click', function () {
SaveDataAja(); 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 {
SaveDataAja();
}
}) })
function SaveDataAja() { function SaveDataAja() {
let id_pasien = $('#nama').val(); let id_pasien = $('#id_pasien').val();
let no_rekam_medis = $('#nama').val();
let nama = $('#nama').val(); let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val(); let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val(); let tanggal_lahir = $('#tanggal_lahir').val();
...@@ -47,7 +87,6 @@ function SaveDataAja() { ...@@ -47,7 +87,6 @@ function SaveDataAja() {
url: baseURL + '/api/savedatapasien', url: baseURL + '/api/savedatapasien',
data: { data: {
id_pasien: id_pasien, id_pasien: id_pasien,
ino_rekam_medis: no_rekam_medis,
iktp: ktp, iktp: ktp,
inama: nama, inama: nama,
itempat_lahir: tempat_lahir, itempat_lahir: tempat_lahir,
...@@ -60,35 +99,7 @@ function SaveDataAja() { ...@@ -60,35 +99,7 @@ function SaveDataAja() {
// alert("success"); // alert("success");
// response[data]; // 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) { if (response['code'] == 0) {
console.log(response); console.log(response);
let $id = response.data['id_pasien']; let $id = response.data['id_pasien'];
...@@ -97,7 +108,7 @@ function SaveDataAja() { ...@@ -97,7 +108,7 @@ function SaveDataAja() {
window.location.href = ("datapasien/" + $encodedId); window.location.href = ("datapasien/" + $encodedId);
} else { } else {
bootbox.alert({ message: ' gagal', centerVertical: true }); bootbox.alert({ message: 'Gagal Ditambahkan', centerVertical: true });
} }
}, error: function (xhr) { }, error: function (xhr) {
...@@ -111,7 +122,43 @@ function SaveDataAja() { ...@@ -111,7 +122,43 @@ function SaveDataAja() {
}); });
} }
// alert('this');
function validasipoli(KTP) {
var exist = 0;
$.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 (KTP == data[x]['ktp']) {
exist = 1;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
var inputQuantity = []; var inputQuantity = [];
$(function () { $(function () {
$("#ktp").each(function (i) { $("#ktp").each(function (i) {
......
...@@ -30,7 +30,7 @@ function loaddatapasien(param) { ...@@ -30,7 +30,7 @@ function loaddatapasien(param) {
} else { } else {
alert(result.info); bootbox.alert({ message: 'Data Kosong', centerVertical: true });
} }
}, },
error: function (xhr) { error: function (xhr) {
...@@ -349,7 +349,7 @@ function pilihAntrian() { ...@@ -349,7 +349,7 @@ function pilihAntrian() {
if (xhr.status != 200) { if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) "); //bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else { } else {
alert('Cannot load queue'); bootbox.alert({ message: 'Cannot load queue', centerVertical: true });
} }
} }
}); });
......
...@@ -20,9 +20,10 @@ function loaddokter() { ...@@ -20,9 +20,10 @@ function loaddokter() {
y += ` <div class="col"> y += ` <div class="col">
<div class="card-hide" style="height:330px;width:200px; " > <div class="card-hide" style="height:330px;width:200px; " >
<div class="card-body text-center " > <div class="card-body text-center " >
<h5 class="card-title "> <img style="width:180px; height:200px;" src="/tamplate/img/doctor/`+ data[counter]['image'] + `" ></h5> <h5 class="card-title "> <img style="width:180px; height:200px;" src="/tamplate/img/doctor/`+ data[counter]['image_dokter'] + `" ></h5>
<h4 class="card-text font-weight-bold">`+ data[counter]['nama_dokter'] + `</h4> <h4 class="card-text font-weight-bold">`+ data[counter]['nama_dokter'] + `</h4>
<h5 class="card-text">`+ data[counter]['nama_poli'] + `</h5> <h6 class="card-text">`+ `Kode Dokter : ` + data[counter]['kode_dokter'] + `</h6>
<h5 class="card-text">`+ `Poli ` + data[counter]['nama_poli'] + `</h5>
</div> </div>
......
...@@ -112,35 +112,105 @@ function Loaddokter() { ...@@ -112,35 +112,105 @@ function Loaddokter() {
} }
}); });
} }
function validasidokter(poli, nama_dokter, kode_dokter) {
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 (nama_dokter == data[x]['nama_dokter']) {
namacounter += 1;
if (namacounter > 1) {
exist = 3;
}
}
}
if (poli == data[x]['id_poli']) {
if (kode_dokter == data[x]['kode_dokter']) {
kodecounter += 1;
if (kodecounter > 1) {
exist = 4;
}
}
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#tambahmodal').on('click', function () { $('#tambahmodal').on('click', function () {
loadpoli() loadpoli()
}) })
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
var nama_dokter = document.getElementById("nama_dokter").value; let nama_dokter = $('#nama_dokter').val();
var kode_dokter = document.getElementById("kode_dokter").value; let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value");
console.log(poli)
if (validasidokter(nama_dokter, kode_dokter) == 1) { if (nama_dokter == null || nama_dokter == "") {
bootbox.alert({ message: 'Nama Dokter Sudah Ada!', centerVertical: true }); bootbox.alert({ message: 'Nama dokter tidak boleh kosong', centerVertical: true });
return false;
} }
else if (validasidokter(nama_dokter, kode_dokter) == 2) { else if (kode_dokter == null || kode_dokter == "") {
bootbox.alert({ message: 'Kode Dokter Sudah Ada!', centerVertical: true }); bootbox.alert({ message: 'Kode dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama dokter sudah ada!', centerVertical: true });
}
else if (validasidokter(poli, nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode dokter sudah ada!', centerVertical: true });
} else { } else {
savedokter() savedokter()
} }
console.log(validasidokter(poli, nama_dokter, kode_dokter));
}) })
function savedokter() { function savedokter() {
let nama_dokter = $('#nama_dokter').val(); let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val(); let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value"); let poli = $("#poli option:selected").attr("value");
// let image = $('#kode_poli').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -186,54 +256,30 @@ function savedokter() { ...@@ -186,54 +256,30 @@ 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;
for (x in data) {
if (nama_dokter == data[x]['nama_dokter']) {
exist = 1;
}
if (kode_dokter == data[x]['kode_dokter']) {
exist = 2;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () { $('#edit').on('click', function () {
let id_dokter = $('#id_dokter').val(); let id_dokter = $('#id_dokter').val();
var nama_dokter = document.getElementById("nama_dokteredt").value; let nama_dokter = $('#nama_dokteredt').val();
var kode_dokter = document.getElementById("kode_dokteredt").value; let kode_dokter = $('#kode_dokteredt').val();
let poli = $("#poliedt option:selected").attr("value");
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 (validasidokter(poli, nama_dokter, kode_dokter) == 3) {
bootbox.alert({ message: 'Nama dokter harus berbeda!', centerVertical: true });
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Harus Berbeda!', centerVertical: true });
} }
else if (validasidokter(nama_dokter, kode_dokter) == 2) { else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) {
bootbox.alert({ message: 'Kode Dokter Harus Berbeda!', centerVertical: true }); bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true });
} else { } else {
editdatadokter(id_dokter) editdatadokter(id_dokter)
} }
...@@ -251,7 +297,7 @@ function editdatadokter(id_dokter) { ...@@ -251,7 +297,7 @@ function editdatadokter(id_dokter) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadkeloladokter', url: baseURL + '/api/editkeloladokter',
data: { data: {
id: id_dokter, id: id_dokter,
inama_dokter: nama_dokter, inama_dokter: nama_dokter,
...@@ -262,7 +308,7 @@ function editdatadokter(id_dokter) { ...@@ -262,7 +308,7 @@ function editdatadokter(id_dokter) {
}, },
success: function (response) { success: function (response) {
console.log(response); // console.log(response);
if (response['code'] == 0) { if (response['code'] == 0) {
swal({ swal({
title: "", title: "",
...@@ -357,18 +403,12 @@ function loadedit(id_dokter) { ...@@ -357,18 +403,12 @@ 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); $('#id_dokter').val(data[0].id_dokter);
$('#nama_dokteredt').val(data[0].nama_dokter); $('#nama_dokteredt').val(data[0].nama_dokter);
$('#kode_dokteredt').val(data[0].kode_dokter); $('#kode_dokteredt').val(data[0].kode_dokter);
// $('#condition').val(data[0].condition);
} else { } else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true }); bootbox.alert({ message: 'Data Kosong', centerVertical: true });
...@@ -391,7 +431,7 @@ function Delete(param) { ...@@ -391,7 +431,7 @@ function Delete(param) {
id: param, id: param,
}, },
success: function (result) { success: function (result) {
console.log(result); // console.log(result.data[0].nama_dokter);
let nama_dokter = result.data[0].nama_dokter; let nama_dokter = result.data[0].nama_dokter;
swal({ swal({
title: "Apakah yakin mengahapus dokter '" + nama_dokter + "'? ", title: "Apakah yakin mengahapus dokter '" + nama_dokter + "'? ",
...@@ -422,7 +462,12 @@ function Delete(param) { ...@@ -422,7 +462,12 @@ function Delete(param) {
} else { } else {
alert('gagal'); swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
} }
}, },
error: function (xhr) { error: function (xhr) {
......
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() { function Loadpasien() {
// var iddokter = $('#dokter').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadkelolaantrian', url: baseURL + '/api/loadkelolapasien',
data: { data: {
// id: iddokter
}, },
success: function (result) { success: function (result) {
// console.log(result.data); // console.log(result);
$('table.table-bordered > tbody').empty(); $('table.table-bordered > tbody').empty();
// console.log(result); // console.log(result);
...@@ -119,14 +26,17 @@ function Loadpasien() { ...@@ -119,14 +26,17 @@ function Loadpasien() {
var cols = ""; var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')"> // onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
cols += '<td class="">' + counter + '</td>'; cols += '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</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].nama + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tempat_lahir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tanggal_lahir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].status_name + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</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>'; 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>';
console.log(data[x].id_pasien); // console.log(data[x].id_pasien);
newRow.append(cols); newRow.append(cols);
$("table.table-bordered").append(newRow); $("table.table-bordered").append(newRow);
counter++; counter++;
...@@ -145,12 +55,15 @@ function Loadpasien() { ...@@ -145,12 +55,15 @@ function Loadpasien() {
paging: true, paging: true,
columnDefs: [ columnDefs: [
{ width: 30, targets: 0 }, { width: 30, targets: 0 },
{ width: 50, targets: 1 }, { width: 80, targets: 1 },
{ width: 130, targets: 2 }, { width: 130, targets: 2 },
{ width: 130, targets: 3 }, { width: 130, targets: 3 },
{ width: 130, targets: 4 }, { width: 130, targets: 4 },
{ width: 130, targets: 5 }, { width: 130, targets: 5 },
{ width: 100, targets: 6 }, { width: 130, targets: 6 },
{ width: 130, targets: 7 },
{ width: 110, targets: 8 },
{ width: 100, targets: 9 },
], ],
}); });
...@@ -161,21 +74,89 @@ function Loadpasien() { ...@@ -161,21 +74,89 @@ function Loadpasien() {
}); });
} }
function actionqueue(idpasien, iddokter) {
$('#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();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/updateantrianmiss', url: baseURL + '/api/editkelolapasien',
data: { data: {
iddok: iddokter, id_pasien: id_pasien,
iidpasien: idpasien, iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
}, },
success: function (result) {
console.log() success: function (response) {
if (result.code == 0) { console.log(response);
if (response['code'] == 0) {
swal({ swal({
title: "", title: "",
text: "Data Berhasil Diupdate!", text: "Data Berhasil DiUbah!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}, function () { }, function () {
...@@ -183,10 +164,157 @@ function actionqueue(idpasien, iddokter) { ...@@ -183,10 +164,157 @@ function actionqueue(idpasien, iddokter) {
}); });
} else { } else {
alert('gagal'); 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);
} }
},
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);
}
});
}
);
}
}); });
} }
...@@ -70,26 +70,55 @@ function Loadpoli() { ...@@ -70,26 +70,55 @@ function Loadpoli() {
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
var nama_poli = document.getElementById("nama_poli").value; let nama_poli = $('#nama_poli').val();
var kode_poli = document.getElementById("kode_poli").value; let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
if (validasipoli(nama_poli, kode_poli) == 1) { if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama Poli Sudah Ada!', centerVertical: true }); 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 (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama poli sudah ada!', centerVertical: true });
} }
else if (validasipoli(nama_poli, kode_poli) == 2) { else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode Poli Sudah Ada', centerVertical: true }); bootbox.alert({ message: 'Kode poli sudah ada', centerVertical: true });
} else { } else {
savedatapoli(); savedatapoli();
} }
}) })
function saveTheoryOfDespair() {
}
function savedatapoli() { function savedatapoli() {
let nama_poli = $('#nama_poli').val(); let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val(); let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val(); let deskripsi_poli = $('#deskripsi_poli').val();
const fileupload = $('#image_poli').prop('files')[0];
// let image = $('#kode_poli').val();
let formData = new FormData();
formData.append('fileupload', fileupload); // set file ke tipe data binary
console.log(fileupload);
let image = $('#kode_poli').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -103,6 +132,7 @@ function savedatapoli() { ...@@ -103,6 +132,7 @@ function savedatapoli() {
success: function (response) { success: function (response) {
if (response['code'] == 0) { if (response['code'] == 0) {
swal({ swal({
title: "", title: "",
...@@ -176,14 +206,27 @@ function validasipoli(nama_poli, kode_poli) { ...@@ -176,14 +206,27 @@ function validasipoli(nama_poli, kode_poli) {
$('#edit').on('click', function () { $('#edit').on('click', function () {
let id_poli = $('#id_poli').val(); let id_poli = $('#id_poli').val();
var nama_poli = document.getElementById("nama_poliEdt").value; let nama_poli = $('#nama_poliEdt').val();
var kode_poli = document.getElementById("kode_poliEdt").value; let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
if (validasipoli(nama_poli, kode_poli) == 1) { if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama Poli Harus Berbeda!', centerVertical: true }); 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 (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama poli harus berbeda!', centerVertical: true });
} }
else if (validasipoli(nama_poli, kode_poli) == 2) { else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode Poli Harus Berbeda!', centerVertical: true }); bootbox.alert({ message: 'Kode poli harus berbeda!', centerVertical: true });
} else { } else {
editdatapoli(id_poli) editdatapoli(id_poli)
} }
...@@ -320,7 +363,12 @@ function Delete(param) { ...@@ -320,7 +363,12 @@ function Delete(param) {
location.reload(); location.reload();
}); });
} else { } else {
alert('gagal'); swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
} }
}, },
error: function (xhr) { error: function (xhr) {
......
...@@ -8,9 +8,9 @@ function reset() { ...@@ -8,9 +8,9 @@ function reset() {
} }
function closeWin() { // function closeWin() {
myWindow.close(); // myWindow.close();
} // }
function loadpoli() { function loadpoli() {
...@@ -51,7 +51,7 @@ function loadpoli() { ...@@ -51,7 +51,7 @@ function loadpoli() {
}); });
} }
Loadruang(null); Loadruang();
function Loadruang() { function Loadruang() {
/* save data */ /* save data */
...@@ -77,9 +77,10 @@ function Loadruang() { ...@@ -77,9 +77,10 @@ function Loadruang() {
cols += '<td class="">' + counter + '</td>'; 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].id_poli + '</td>'
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].lantai + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</td>'; cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</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>'; 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>';
...@@ -100,10 +101,11 @@ function Loadruang() { ...@@ -100,10 +101,11 @@ function Loadruang() {
paging: true, paging: true,
columnDefs: [ columnDefs: [
{ width: 30, targets: 0 }, { width: 30, targets: 0 },
{ width: 215, targets: 1 }, { width: 180, targets: 1 },
{ width: 215, targets: 2 }, { width: 140, targets: 2 },
{ width: 215, targets: 3 }, { width: 140, targets: 3 },
{ width: 107, targets: 4 }, { width: 140, targets: 4 },
{ width: 100, targets: 5 },
], ],
}); });
...@@ -122,12 +124,30 @@ $('#tambahmodal').on('click', function () { ...@@ -122,12 +124,30 @@ $('#tambahmodal').on('click', function () {
}) })
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
saveruang() 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) == 1) {
bootbox.alert({ message: 'Nama ruang dan lantai sudah ada!', centerVertical: true });
}
else {
saveruang()
}
}) })
function saveruang() { function saveruang() {
let nama_ruang = $('#nama_ruang').val(); let nama_ruang = $('#nama_ruang').val();
let lantai = $('#lantai').val();
let poli = $("#poli option:selected").attr("value"); let poli = $("#poli option:selected").attr("value");
...@@ -139,12 +159,16 @@ function saveruang() { ...@@ -139,12 +159,16 @@ function saveruang() {
url: baseURL + '/api/savekelolaruang', url: baseURL + '/api/savekelolaruang',
data: { data: {
inama_ruang: nama_ruang, inama_ruang: nama_ruang,
ilantai: lantai,
ipoli: poli, ipoli: poli,
}, },
success: function (result) { success: function (result) {
// console.log(result) // console.log(result)
if (result['code'] == 0) { if (result['code'] == 0) {
swal({ swal({
title: "", title: "",
...@@ -177,19 +201,83 @@ function saveruang() { ...@@ -177,19 +201,83 @@ function saveruang() {
}); });
} }
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 (lantai == data[x]['lantai']) {
if (nama_ruang == data[x]['nama_ruang']) {
exist = 1;
}
}
}
if (lantai == data[x]['lantai']) {
if (nama_ruang == data[x]['nama_ruang']) {
ruangcounter += 1;
if (ruangcounter > 1) {
exist = 2;
}
}
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () { $('#edit').on('click', function () {
let id_ruang = $('#id_ruang').val(); let id_ruang = $('#id_ruang').val();
let nama_ruang = $('#nama_ruangedt').val();
// if (validasieditnama() == true) { let lantai = $('#lantaiedt').val();
// alert("Nama Poli Harus Berbeda!") let poli = $("#poliedt option:selected").attr("value");
// } else { // console.log(poli)
editdataruang(id_ruang)
// } 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) == 2) {
bootbox.alert({ message: 'Nama ruang dan lantai harus berbeda!', centerVertical: true });
} else {
editdataruang(id_ruang)
}
}) })
function editdataruang(id_ruang) { function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value"); let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val(); let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val();
let condition = $("#condition option:selected").attr("value"); let condition = $("#condition option:selected").attr("value");
$.ajax({ $.ajax({
...@@ -200,12 +288,14 @@ function editdataruang(id_ruang) { ...@@ -200,12 +288,14 @@ function editdataruang(id_ruang) {
id: id_ruang, id: id_ruang,
inama_ruang: nama_ruang, inama_ruang: nama_ruang,
ipoli: poli, ipoli: poli,
ilantai: lantai,
icondition: condition, icondition: condition,
}, },
success: function (response) { success: function (response) {
//console.log(respoonse); //console.log(respoonse);
if (response['code'] == 0) { if (response['code'] == 0) {
swal({ swal({
title: "", title: "",
...@@ -272,7 +362,7 @@ function loadedit(id_ruang) { ...@@ -272,7 +362,7 @@ function loadedit(id_ruang) {
if (result['code'] == 0) { if (result['code'] == 0) {
console.log(result); // console.log(result);
var res = result['data']; var res = result['data'];
optionseg = ''; optionseg = '';
...@@ -303,6 +393,7 @@ function loadedit(id_ruang) { ...@@ -303,6 +393,7 @@ function loadedit(id_ruang) {
}); });
$('#id_ruang').val(data[0].id_ruang); $('#id_ruang').val(data[0].id_ruang);
$('#nama_ruangedt').val(data[0].nama_ruang); $('#nama_ruangedt').val(data[0].nama_ruang);
$('#lantaiedt').val(data[0].lantai);
} else { } else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true }); bootbox.alert({ message: 'Data Kosong', centerVertical: true });
...@@ -326,7 +417,7 @@ function Delete(param) { ...@@ -326,7 +417,7 @@ function Delete(param) {
id: param, id: param,
}, },
success: function (result) { success: function (result) {
console.log(result); // console.log(result);
let nama_ruang = result.data[0].nama_ruang; let nama_ruang = result.data[0].nama_ruang;
swal({ swal({
title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ", title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ",
...@@ -355,7 +446,12 @@ function Delete(param) { ...@@ -355,7 +446,12 @@ function Delete(param) {
location.reload(); location.reload();
}); });
} else { } else {
alert('gagal'); swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
} }
}, },
error: function (xhr) { error: function (xhr) {
......
...@@ -36,7 +36,7 @@ input, button { ...@@ -36,7 +36,7 @@ input, button {
input, select { input, select {
border: 1px solid #CCC; border: 1px solid #CCC;
width: 250px; } width: 20px; }
::-webkit-input-placeholder { ::-webkit-input-placeholder {
color: #BBB; } color: #BBB; }
......
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