Commit 99e27bb8 authored by Indra Raja's avatar Indra Raja

Merge branch 'v.1.1' into 'v1.2'

integrasi

See merge request !1
parents 31f7f095 83b55dfa
......@@ -33,7 +33,10 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-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");
return $view;
......@@ -70,7 +73,7 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolapasienAction()
public function antrianterlewatAction()
{
$this->isLoggedIn();
$view = new ViewModel();
......@@ -81,7 +84,23 @@ class AdminController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-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");
return $view;
......@@ -118,6 +137,22 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolapasienAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolapasien.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolaruanganAction()
{
$this->isLoggedIn();
......@@ -150,22 +185,7 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function cobainAction()
{
//$this->isLoggedIn();
// $view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
// $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
// $this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function tampilanumumAction()
{
$this->isLoggedIn();
......
......@@ -137,19 +137,24 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$no_rekam_medis = $post->ino_rekam_medis;
$ktp = $post->iktp;
$cekpasien = $test->cekpasien($no_rekam_medis);
$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){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $cekpasien->data ;
$result->data = $array;
}else{
$result->code = 1;
$result->info = 'Not Found';
......@@ -607,43 +612,76 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function savekelolapoliAction(){
if($this->isLoggedIn()){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$table_poli= 'poli';
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
try{
try{
$fileupload = $_FILES['fileupload']['tmp_name'];
// print_r($fileupload);die;
$nama_poli = $post->inama_poli;
$kode_poli = $post->ikode_poli;
$deskripsi_poli = $post->ideskripsi_poli;
$dataArrayPoli = array (
'nama_poli' => $nama_poli,
'kode_poli' =>$kode_poli,
'deskripsi_poli'=>$deskripsi_poli,
if (!empty($fileupload)){
$ImageName = $_FILES['fileupload']['name'];
$tipes = $_FILES['fileupload']['type'];
$size = $_FILES['fileupload']['size'];
$uploaddir = './public/tamplate/img/poli/'; // directory file
);
$alamatfile = $uploaddir.$ImageName;
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
// print_r('berhasil');die;
/* jika upload berhasil ke folder sever */
$dataAtt = array(
'nama_poli' => $nama_poli,
'image_poli' => $ImageName,
'deskripsi_poli' => $deskripsi_poli,
'kode_poli' => $kode_poli,
);
$param->saveGlobal($dataAtt, $table_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPoli->data;
}else{
$result->code = 17;
$result->info = 'FAILED UPLOAD FILE to SERVER';
}
}else{
$result->info = 'File tidak boleh kosong';
}
// print_r($dataArrayPoli);die;
$param->saveGlobal($dataArrayPoli, $table_poli);
// $param->saveGlobal($dataArrayPoli, $table_poli);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPoli;
// $result->code = 0;
// $result->info = 'ok';
// $result->data = $dataArrayPoli;
}catch (\Exception $exc) {
......@@ -656,6 +694,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function editkelolapoliAction(){
if($this->isLoggedIn()){
$result = new Result();
......@@ -775,6 +814,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
try{
$nama_dokter = $post->inama_dokter;
......@@ -808,7 +848,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArraydokter->data;
$result->data = $DokterPoli->data;
}catch (\Exception $exc) {
......@@ -957,11 +997,13 @@ class ApiController extends \Application\Master\GlobalActionController {
try{
$nama_ruang = $post->inama_ruang;
$lantai = $post->ilantai;
$poli = $post->ipoli;
//print_r($poli);die;
$dataArrayruang = array (
'nama_ruang' =>'R '.$nama_ruang,
'nama_ruang' =>$nama_ruang,
'lantai' =>$lantai,
'id_poli' =>$poli,
'id_condition' => 1
);
......@@ -1002,6 +1044,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_ruang = $post->id;
$nama_ruang = $post->inama_ruang;
$poli = $post->ipoli;
$lantai = $post->ilantai;
$condition = $post->icondition;
......@@ -1010,6 +1053,7 @@ class ApiController extends \Application\Master\GlobalActionController {
'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli,
'lantai' =>$lantai,
'id_condition' =>$condition,
);
......@@ -1063,18 +1107,182 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadkelolaantrianAction(){
public function loadantrianmissAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
//$n
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadantrianmiss($post->id);
// print_r($load);die;
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;
$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){
$result->code = $result::CODE_SUCCESS;
......@@ -1463,6 +1671,52 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function updateunregisterAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$id_pasien= $post->id_pasien;
$dataarray = array(
'id_pasien' => null,
'create_date' => null,
'nama' => null,
'tempat_lahir' => null,
'tanggal_lahir' => null,
'alamat' => null,
'no_rekam_medis'=> null,
'no_hp' => null,
'ktp' => null,
'status_code' => null,
);
// $loadunreg = $test->loadantrianunregis($id_pasien);
$table = 'antrian_pasien';
$where = 'id_pasien='.$id_pasien;
$test->updateGlobal($table, $dataarray, $where);
// print_r($where);
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $dataarray->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function tampildokterAction(){
$result = new Result();
......@@ -1491,4 +1745,156 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function tampilpoliAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$loadpoli = $test->tampilpoli($post->id);
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loadpoli->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function tampildatapoliAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$loaddatapoli = $test->tampildatapoli($post->id);
// print_r($loaddatapoli);die;
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $loaddatapoli->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadjumlahpasienAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadjumlahpasien();
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadpasiendalamantrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadpasiendalamantrian();
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadpasienterlewatAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadpasienterlewat();
// print_r($load);die;
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function loadterlayaniAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
$load = $test->loadterlayani();
// print_r($load);die;
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
}
\ No newline at end of file
......@@ -116,7 +116,7 @@ class QueueController extends \Application\Master\GlobalActionController
}
public function poliAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
......@@ -124,8 +124,30 @@ class QueueController extends \Application\Master\GlobalActionController
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = null');
$this->headScript->appendFile('/action-js/antrian-js/action-poli.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function datapoliAction()
{
$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->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");
return $view;
......@@ -161,15 +183,7 @@ class QueueController extends \Application\Master\GlobalActionController
// print_($getpath);die;
$decodeid = base64_decode($getpath[3]);
$decodeiddok = base64_decode($getpath[4]);
// $decodeidpol = base64_decode($getpath[5]);
// $decodeidant = base64_decode($getpath[6]);
// print_r($decodeiddok );die;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
......
......@@ -61,12 +61,20 @@ class Param extends Mapper {
$data = $this->_storage->loadUserData($id,$iddok);
return $data;
}
public function loadpasien($id = null){
$data = $this->_storage->loadpasien($id);
return $data;
}
public function loaddatapasien($id){
$data = $this->_storage->loaddatapasien($id);
return $data;
}
public function cekpasien($no_rekam_medis = null){
$data = $this->_storage->cekpasien($no_rekam_medis);
public function cekpasien($no_rekam_medis = null,$ktp = null ){
$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;
}
......@@ -98,6 +106,10 @@ class Param extends Mapper {
$data = $this->_storage->loadkelolapoli($id);
return $data;
}
public function loadkelolapasien($id = null){
$data = $this->_storage->loadkelolapasien($id);
return $data;
}
public function loadkeloladokter($id = null){
$data = $this->_storage->loadkeloladokter($id);
return $data;
......@@ -110,8 +122,12 @@ class Param extends Mapper {
$data = $this->_storage->updatekelolaantrian($idpasien,$iddok);
return $data;
}
public function loadkelolaantrian($id){
$data = $this->_storage->loadkelolaantrian($id);
public function loadantrianmiss($id){
$data = $this->_storage->loadantrianmiss($id);
return $data;
}
public function loadantrianunregis($id){
$data = $this->_storage->loadantrianunregis($id);
return $data;
}
public function loadPoli($id_poli = null){
......@@ -143,8 +159,30 @@ class Param extends Mapper {
$data = $this->_storage->loadAntrian($id_poli);
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(){
$data = $this->_storage->tampildokter();
return $data;
......
......@@ -359,6 +359,47 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result->info = 'ERROR : ' . $ex->getMessage();
}
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(){
......@@ -431,6 +472,155 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
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){
$result = new Result();
try {
......@@ -471,7 +661,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
public function cekpasien($no_rekam_medis){
$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
LEFT JOIN antrian_pasien ap
......@@ -506,6 +696,57 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function cekktp($no_rekam_medis, $ktp){
$result = new Result();
try {
$sql = "SELECT no_rekam_medis FROM pasien WHERE no_rekam_medis = '$no_rekam_medis' ";
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
array_push($listdata, $val);
}
if ($listdata) {
$sqlktp = "SELECT ktp, no_rekam_medis FROM pasien WHERE no_rekam_medis = '$no_rekam_medis' AND ktp = '$ktp'";
$stmtktp = $this->_db->query($sqlktp);
$resdataktp = $stmtktp->execute();
$listdataktp = array();
foreach($resdataktp as $val){
array_push($listdataktp, $val);
}
if($listdataktp){
$result->code = 0;
$result->info = 'OK';
$result->data = $listdataktp;
}else{
$result->code = 1;
$result->info = 'your ktp wrong';
$result->data = $listdata;
}
}else{
$result->code = 2;
$result->info = 'Your no_rekam_medis wrong';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function loadRegisterPoli($id = null){
$result = new Result();
......@@ -685,6 +926,49 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql .= " ORDER BY poli.nama_poli asc , register_dokter.create_date";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
if ($listdata) {
$result->code = 0;
$result->info = 'OK';
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'nok';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function loadkelolapasien($id = null){
$result = new Result();
try {
$sql = " SELECT * FROM pasien";
if($id){
$sql .= " WHERE id_pasien = $id ";
}
$sql .= " ORDER BY no_rekam_medis ASC";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
......@@ -813,7 +1097,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition
$sql = "SELECT ruang.id_ruang, ruang.nama_ruang, poli.nama_poli,poli.id_poli, condition.condition,condition.id_condition, ruang.lantai
FROM RUANG
INNER JOIN poli
ON ruang.id_poli = poli.id_poli
......@@ -857,7 +1141,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function loadkelolaantrian($id){
public function loadantrianmiss($id){
$result = new Result();
try {
......@@ -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;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
......@@ -965,16 +1296,9 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql = " SELECT poli.id_poli, poli.nama_poli
FROM antrian_pasien
INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli ";
if($id){
$sql .=" WHERE poli.id_poli=$id";
}
$sql .= " GROUP BY poli.id_poli";
ON antrian_pasien.id_poli = poli.id_poli
GROUP BY poli.id_poli
ORDER BY nama_poli asc";
......@@ -1054,11 +1378,52 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
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
INNER JOIN poli
ON dokter.id_poli = poli.id_poli
ORDER BY nama_poli ASC ";
ON dokter_to_poli.id_poli = poli.id_poli
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";
......@@ -1094,6 +1459,61 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function tampilpoli($id= null){
$result = new Result();
try {
if ($id){
$sql = "SELECT poli.nama_poli, poli.kode_poli, poli.deskripsi_poli ,poli.id_poli, poli.image_poli, dokter_to_poli.nama_dokter, dokter_to_poli.id_dokter, dokter_to_poli.kode_dokter, dokter_to_poli.image_dokter
FROM poli
INNER JOIN dokter_to_poli
ON dokter_to_poli.id_poli = poli.id_poli" ;
$sql .= " where poli.id_poli = $id";
$sql .= " ORDER BY poli.nama_poli ASC";
} else {
$sql = "SELECT * FROM poli";
}
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
// print_r($listdata);die;
if ($listdata) {
$result->code = 0;
$result->info = 'OK';
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'nok';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function loadPilihAntrian($iddok ){
$result = new Result();
......
<!-- 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" id="poli"></a>
<select name="poli" id="poli" class="form-control" >
<option disable selected> Pilih </option>
</select>
</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="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
......@@ -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>
<br>
<br>
<table class="table table-bordered" id="dataTable">
<thead>
<tr>
<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">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
......@@ -53,7 +51,7 @@
<div class="form-group">
<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>
</select>
......@@ -138,6 +136,3 @@
</div>
</div>
</body>
</html>
......@@ -3,31 +3,19 @@
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Antrian Pasien</h1>
<!-- <form class="form-inline">
<div class="form-group form-control-lg ">
<label >Pilih poli </label>
<select name="nama_poli" id="poli" class="form-control" >
<option disabled selected>Pilih </option>
</select>
</div>
<div class="form-group form-control-lg">
<label>Pilih dokter</label> <br>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form> -->
<br>
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Kelola Pasien</h1>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<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 Dokter</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Status</th>
<th colspan="" class=" thLeftText">Tempat Lahir </th>
<th colspan="" class=" thLeftText">Tanggal Lahir</th>
<th colspan="" class=" thLeftText">Alamat</th>
<th colspan="" class=" thLeftText">No Hp</th>
<th colspan="" class=" thLeftText">Tanggal Pendaftaran</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
......@@ -40,3 +28,65 @@
</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,33 +53,29 @@
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<form id="myForm" >
<form id="myForm" method="POST" action="<?php $this->basePath('/api/savekelolapoli') ?>" enctype="multipart/form-data">
<div class="form-group">
<label>Nama Poli</label>
<input type="input" id="nama_poli" name="nama_poli" class="form-control" placeholder="Nama Poli" required /></input>
<input type="input" id="nama_poli" name="nama_poli" class="form-control" placeholder="Nama Poli" required ></input>
</select>
</div>
<div class="form-group">
<label>Kode Poli</label>
<input type="input" id="kode_poli" name="kode_poli" class="form-control" placeholder="Kode Poli" required /></input>
<input type="input" id="kode_poli" name="kode_poli" class="form-control" placeholder="Kode Poli" required ></input>
</div>
<div class="form-group">
<label>Deskripsi Poli</label>
<textarea type="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 class="form-group ">
<div class="form-group " >
<label>Gambar Poli</label>
<input type="file" name="uploadimage" id="uploadimage" class="form-control">
</div> -->
<input type="file" name="gambar_poli" id="gambar_poli" class="form-control-file">
</div>
<div class="modal-footer">
<button button type="button" class="btn btn-primary" id="tambah">Add</button>
<button button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="tambah">Add</button>
<button type="button" class="btn btn-danger" onclick="reset()">Reset</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</div>
......@@ -106,23 +102,23 @@
<div class="form-group">
<label>Nama Poli</label>
<input type="input" id="nama_poliEdt" name="nama_poli" class="form-control" placeholder="Nama Poli" required /></input>
<input type="input" id="nama_poliEdt" name="nama_poli" class="form-control" placeholder="Nama Poli" required ></input>
</select>
</div>
<div class="form-group">
<label>Kode Poli</label>
<input type="input" id="kode_poliEdt" name="kode_poli" class="form-control" placeholder="Kode Poli" required /></input>
<input type="input" id="kode_poliEdt" name="kode_poli" class="form-control" placeholder="Kode Poli" required></input>
</div>
<div class="form-group">
<label>Deskripsi Poli</label>
<textarea type="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 class="form-group ">
<div class="form-group ">
<label>Gambar Poli</label>
<input type="file" name="uploadimage" id="uploadimage" class="form-control">
</div> -->
<input type="file" name="image_poli" id="image_poliedt" class="form-control-file"></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>
......@@ -136,3 +132,4 @@
</div>
......@@ -26,6 +26,7 @@
<th style="width: 70px">NO</th>
<!-- <th colspan="" class=" thLeftText">Id Poli</th> -->
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Lantai</th>
<th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Kondisi Ruang</th>
<th colspan="" class=" thLeftText">Action</th>
......@@ -62,13 +63,17 @@
<option disable selected> Pilih </option>
</select>
</div>
<div class="form-group">
<label>Lantai</label>
<input type="input" id="lantai" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan" required /></input>
</div>
<div class="form-group">
<label>Ruangan</label>
<input type="input" id="nama_ruang" name="nama_ruang" class="form-control" placeholder="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 class="modal-footer">
<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-primary" id="tambah">Add</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>
......@@ -96,6 +101,10 @@
</select>
</div >
<div class="form-group">
<label>Lantai</label>
<input type="input" id="lantaiedt" name="lantai" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
</div>
<div class="form-group">
<label>Ruangan</label>
<input type="input" id="nama_ruangedt" name="nama_ruang" class="form-control" placeholder="Lantai Ruangan & Nama Ruangan" required /></input>
......
......@@ -12,7 +12,7 @@
<thead>
<tr class="table-infos">
<th style="">NO</th>
<th colspan="" class=" thLeftText">Jenis Layanan (Poli)</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th>
......
......@@ -42,7 +42,12 @@ input::-webkit-inner-spin-button {
<div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" 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>
<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>
......
......@@ -5,6 +5,7 @@ input::-webkit-inner-spin-button {
margin: 0;
}
</style>
......@@ -41,14 +42,22 @@ input::-webkit-inner-spin-button {
<input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group">
<label><h5>No Induk KTP</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk KTP" max="9999999999999999" maxlength="16"></input>
<label><h5>No Induk Kependudukan (NIK)</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk Kependudukan (NIK)" max="9999999999999999" maxlength="16"></input>
</div>
<div class="form-group">
<label><h5>Nama Pasien</h5></label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input>
</div>
<!-- <div class="form-group">
<label><h5>Jenis Kelamin</h5></label> <br>
<input type="radio" id="male" name="gender" value="male">
<label for="male"><h5>Laki-laki </h5></label>
<input type="radio" id="female" name="gender" value="female">
<label for="female"><h5>Perempuan </h5></label>
</div> -->
<div class="form-group ">
<label><h5>Tempat Lahir</h5></label>
......@@ -68,6 +77,8 @@ input::-webkit-inner-spin-button {
<label><h5>No HP</h5></label>
<input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input>
</div>
</form>
......
......@@ -63,9 +63,6 @@ input[type="picked"] + label {
width : 55px;
cursor:not-allowed;
text-align:center;
}
......
......@@ -20,7 +20,7 @@
<!-- breadcrumb 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="row justify-content-center">
<div class="col-xl-8">
......@@ -34,26 +34,5 @@
<div class="row dokter">
</div>
<!-- <div class="row">
<div class="col-sm-6 col-lg-3">
<div class="single_blog_item">
<div class="single_blog_img">
<img src="<?php $this->basePath('samss/') ?>/tamplate/img/doctor/doctor_1.png" alt="doctor">
</div>
<div class="single_text">
<div class="single_blog_text">
<h3>DR Adam Billiard</h3>
<p> Spesialis Umum</p>
</div>
</div>
</div>
</div>
</div> -->
</div>
</section>
<!--::doctor_part end::-->
\ No newline at end of file
......@@ -20,46 +20,18 @@
<!-- breadcrumb start-->
<!-- feature_part start-->
<section class="feature_part">
<section class="doctor_part single_page_doctor_part" style="padding:0px;">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8">
<div class="section_tittle text-center">
<h2>Poli Kami</h2>
<h2> Poli Kami </h2>
</div>
</div>
</div>
<div class="row justify-content-between align-items-center">
<div class="col-lg-3 col-md-4 col-xs-6 thumb">
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/gigi.png" alt=""></span>
<h4>Poli Gigi</h4>
<p>Poli gigi adalah...</p>
</div>
</div>
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/mata.png" alt=""></span>
<h4>Poli Mata</h4>
<p>Poli mata adalah...</p>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12">
<div class="single_feature_img">
<img src="<?php $this->basePath('') ?>/tamplate/img/service.png" alt="">
</div>
</div>
<div class="col-lg-3 col-sm-12">
<div class="single_feature">
<div class="single_feature_part">
<span class="single_feature_icon"><img src="<?php $this->basePath('') ?>/tamplate/img/icon/umum.png" alt=""></span>
<h4>Poli Umum</h4>
<p>Poli umum adalah...</p>
</div>
</div>
</div>
<div class="row poli">
</div>
</div>
</section>
......
......@@ -57,7 +57,7 @@
<script src="<?php $this->basePath();?>/tamplateadmin/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<script src="<?php $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script>
<!-- Page level custom scripts -->
<!-- <script src="<?php $this->basePath();?>/tamplateadmin/js/demo/datatables-demo.js"></script> -->
<script src="<?php $this->basePath();?>/tamplateadmin/vendor/chart.js/Chart.min.js"></script>
<body id="page-top">
......@@ -120,13 +120,24 @@
<div class="sidebar-heading" >
Feature
</div>
<li class="nav-item">
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages" aria-expanded="true" aria-controls="collapsePages">
<i class="fas fa-fw fa-table"></i>
<span>Kelola Antrian Pasien</span>
</a>
<div id="collapsePages" class="collapse" aria-labelledby="headingPages" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item"href="<?php echo $this->basePath('admin/antrianterlewat') ?>">Antrian Terlewat</a>
<a class="collapse-item"href="<?php echo $this->basePath('admin/antrianunregister') ?>">Antrian Unregister</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link collapsed" href="<?php echo $this->basePath('admin/kelolapasien') ?>">
<i class="fas fa-fw fa-table"></i>
<span>Kelola Antrian </span>
<span>Kelola Pasien </span>
</a>
</li>
......
......@@ -43,6 +43,15 @@
float:left; margin:5px;
margin-bottom:1px;
}
#h6a {
display: block;
margin-block-start: 0em;
margin-block-end: 0em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
</style>
<body>
......@@ -54,9 +63,7 @@
<div class="col-lg-12">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="<?php echo $this->basePath('queue/beranda');?>"> <img src="<?php echo $this->basePath();?> /tamplate/img/logo.png" alt="logo"> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse main-menu-item justify-content-center"
......@@ -66,18 +73,20 @@
<a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi </a>
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi Antrian </a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/') ?>">Pilih Antrian</a>
</li> -->
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link " href="<?php echo $this->basePath('user/login') ?>">Login</a>
</li>
-->
</ul>
</div>
</nav>
......@@ -106,21 +115,17 @@
<div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget">
<a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/beranda') ?>/tamplate/img/logo.png" alt="#"> </a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor </p>
<div class="social_logo">
<a href="#"><i class="ti-facebook"></i></a>
<a href="#"> <i class="ti-twitter"></i> </a>
<a href="#"><i class="ti-instagram"></i></a>
<a href="#"><i class="ti-skype"></i></a>
</div>
</div>
<div class="col-xl-9 col-sm-6 col-md-4 single-footer-widget">
<h4>Quick Links</h4>
<ul>
<li><a href="#">Beranda</a></li>
<li><a href="#">Registrasi Antrian</a></li>
<li><a href="#">Dokter</a></li>
<li><a href="#">Poli</a></li>
<li><a href="#">Tentang Kami</a></li>
<li><a href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a></li>
<li><a href="<?php echo $this->basePath('queue/pocekdatapasienli') ?>">Registrasi Antrian</a></li>
<li><a href="<?php echo $this->basePath('queue/dokter') ?>">Dokter</a></li>
<li><a href="<?php echo $this->basePath('queue/poli') ?>">Poli</a></li>
<li><a href="<?php echo $this->basePath('user/login') ?>">Login</a></li>
</ul>
</div>
......@@ -143,13 +148,8 @@
is made with <i class="ti-heart" aria-hidden="true"></i> by <a href="https://colorlib.com"
target="_blank">Colorlib</a>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
</p>
<div class="col-lg-4 col-md-12 text-center text-lg-right footer-social">
<a href="#"><i class="ti-facebook"></i></a>
<a href="#"> <i class="ti-twitter"></i> </a>
<a href="#"><i class="ti-instagram"></i></a>
<a href="#"><i class="ti-skype"></i></a>
</div>
</div>
</div>
</div>
......
$('#cekdata').on('click', function () {
let no_rekam_medis = $('#no_rekam_medis').val();
cekpasien(no_rekam_medis);
let ktp = $('#ktp').val();
cekpasien(no_rekam_medis, ktp);
})
function cekpasien() {
let no_rekam_medis = $('#no_rekam_medis').val();
// alert(no_rekam_medis);
function cekpasien(no_rekam_medis, ktp) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/cekpasien',
data: {
ino_rekam_medis: no_rekam_medis,
iktp: ktp,
},
success: function (result) {
// let data = result.data['datapasien'][0]['no_rekam_medis'];
// let validasi = result.data['validasiinput'];
console.log(result);
if (result.code != 0) {
if (result.code == 0) {
console.log(result.data);
if (result.data[0]['no_rekam_medis'] == null) {
let $id = result.data[0]['id_pasien'];
bootbox.alert({ message: "No rekam medis atau NIK tidak sesuai!", centerVertical: true });
}
else if (result.data['validasiinput'] == 0) {
console.log(result.data['datapasien'][0]['no_rekam_medis']);
// alert('berhasil');
if (result.data['datapasien'][0]['no_rekam_medis'] == null) {
let $id = result.data['datapasien'][0]['id_pasien'];
let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId);
}
if (result.data[0]['no_rekam_medis'] != null && (result.data[0]['status_code'] == 10)) {
let $idantrian = result.data[0]['id_antrian'];
if (result.data['datapasien'][0]['no_rekam_medis'] != null && (result.data['datapasien'][0]['status_code'] == 10)) {
let $idantrian = result.data['datapasien'][0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let no_rekam_medis = result.data[0]['no_rekam_medis'];
let nama = result.data[0]['nama'];
let no_rekam_medis = result.data['datapasien'][0]['no_rekam_medis'];
let nama = result.data['datapasien'][0]['nama'];
swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
......@@ -41,40 +50,27 @@ function cekpasien() {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else if (result.data[0]['status_code'] == 20) {
} else if (result.data['datapasien'][0]['status_code'] == 20) {
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 });
} 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 });
} 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 });
} 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 });
}
// $('#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 if (result.data['validasiinput'] == 1) {
bootbox.alert({ message: "No Induk Kependudukan tidak sesuai", centerVertical: true });
} else {
bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
// bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
}
},
......@@ -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) {
w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<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>' +
'<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' +
'<h3>Poli : ' + kode_poli_cetak + '</h3>' +
'<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' +
'<h4>Nama Pasien : ' + nama_pasien_cetak + '</h4>' +
'<h4>Poli : ' + kode_poli_cetak + '</h4>' +
'<h5>Nama Dokter : ' + nama_dokter_cetak + '</h5>' +
'<div class="h6a" style="text-align:right;font-size: 11px;";>No rekam medis tidak boleh hilang</div>' +
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
......
......@@ -24,12 +24,52 @@ $(document).ready(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() {
let id_pasien = $('#nama').val();
let no_rekam_medis = $('#nama').val();
let id_pasien = $('#id_pasien').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
......@@ -47,7 +87,6 @@ function SaveDataAja() {
url: baseURL + '/api/savedatapasien',
data: {
id_pasien: id_pasien,
ino_rekam_medis: no_rekam_medis,
iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
......@@ -60,35 +99,7 @@ function SaveDataAja() {
// alert("success");
// response[data];
// if (ktp == null || ktp == "") {
// bootbox.alert({ message: 'Ktp tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (nama == null || nama == "") {
// bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tempat_lahir == null || tempat_lahir == "") {
// bootbox.alert({ message: 'Tempat lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tanggal_lahir == null || tanggal_lahir == "") {
// bootbox.alert({ message: 'Tanggal lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (alamat == null || alamat == "") {
// bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
// return false;
// } else if (no_hp == null || no_hp == "") {
// bootbox.alert({ message: 'No hp tidak boleh kosong', centerVertical: true });
// return false;
// } else if (ktp.toString().length > 16) {
// bootbox.alert({ message: 'KTP tidak boleh lebih dari 16 angka', centerVertical: true });
// return false;
// } else if (ktp.toString().length < 16) {
// bootbox.alert({ message: 'KTP tidak boleh kurang dari 16 angka', centerVertical: true });
// return false;
// } else if (no_hp.toString().length > 13) {
// bootbox.alert({ message: 'No HP tidak boleh lebih dari 13 angka', centerVertical: true });
// return false;
// }
if (response['code'] == 0) {
console.log(response);
let $id = response.data['id_pasien'];
......@@ -97,7 +108,7 @@ function SaveDataAja() {
window.location.href = ("datapasien/" + $encodedId);
} else {
bootbox.alert({ message: ' gagal', centerVertical: true });
bootbox.alert({ message: 'Gagal Ditambahkan', centerVertical: true });
}
}, error: function (xhr) {
......@@ -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 = [];
$(function () {
$("#ktp").each(function (i) {
......
......@@ -30,7 +30,7 @@ function loaddatapasien(param) {
} else {
alert(result.info);
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
}
},
error: function (xhr) {
......@@ -345,7 +345,7 @@ function pilihAntrian() {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('Cannot load queue');
bootbox.alert({ message: 'Cannot load queue', centerVertical: true });
}
}
});
......
......@@ -20,9 +20,10 @@ function loaddokter() {
y += ` <div class="col">
<div class="card-hide" style="height:330px;width:200px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:180px; height:200px;" src="/tamplate/img/doctor/`+ data[counter]['image'] + `" ></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>
<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>
......
......@@ -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 () {
loadpoli()
})
$('#tambah').on('click', function () {
var nama_dokter = document.getElementById("nama_dokter").value;
var kode_dokter = document.getElementById("kode_dokter").value;
let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value");
console.log(poli)
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Sudah Ada!', centerVertical: true });
if (nama_dokter == null || nama_dokter == "") {
bootbox.alert({ message: 'Nama dokter tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasidokter(nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode Dokter Sudah Ada!', centerVertical: true });
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) == 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 {
savedokter()
}
console.log(validasidokter(poli, nama_dokter, kode_dokter));
})
function savedokter() {
let nama_dokter = $('#nama_dokter').val();
let kode_dokter = $('#kode_dokter').val();
let poli = $("#poli option:selected").attr("value");
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -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 () {
let id_dokter = $('#id_dokter').val();
var nama_dokter = document.getElementById("nama_dokteredt").value;
var kode_dokter = document.getElementById("kode_dokteredt").value;
let nama_dokter = $('#nama_dokteredt').val();
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) {
bootbox.alert({ message: 'Kode Dokter Harus Berbeda!', centerVertical: true });
else if (validasidokter(poli, nama_dokter, kode_dokter) == 4) {
bootbox.alert({ message: 'Kode dokter harus berbeda!', centerVertical: true });
} else {
editdatadokter(id_dokter)
}
......@@ -251,7 +297,7 @@ function editdatadokter(id_dokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkeloladokter',
url: baseURL + '/api/editkeloladokter',
data: {
id: id_dokter,
inama_dokter: nama_dokter,
......@@ -262,7 +308,7 @@ function editdatadokter(id_dokter) {
},
success: function (response) {
console.log(response);
// console.log(response);
if (response['code'] == 0) {
swal({
title: "",
......@@ -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);
$('#nama_dokteredt').val(data[0].nama_dokter);
$('#kode_dokteredt').val(data[0].kode_dokter);
// $('#condition').val(data[0].condition);
} else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
......@@ -391,7 +431,7 @@ function Delete(param) {
id: param,
},
success: function (result) {
console.log(result);
// console.log(result.data[0].nama_dokter);
let nama_dokter = result.data[0].nama_dokter;
swal({
title: "Apakah yakin mengahapus dokter '" + nama_dokter + "'? ",
......@@ -422,7 +462,12 @@ function Delete(param) {
} else {
alert('gagal');
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
......
// 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();
// });
Loadpasien()
function Loadpasien() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolaantrian',
url: baseURL + '/api/loadkelolapasien',
data: {
// id: iddokter
},
success: function (result) {
// console.log(result.data);
// console.log(result);
$('table.table-bordered > tbody').empty();
// console.log(result);
......@@ -119,14 +26,17 @@ function Loadpasien() {
var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
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_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].status_name + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="actionqueue(' + data[x].id_pasien + "," + data[x].id_dokter + ')">Update</span></div> </td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tempat_lahir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].tanggal_lahir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].alamat + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_hp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_pasien + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_pasien + ')">Delete</span></div></td>';
console.log(data[x].id_pasien);
// console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
......@@ -145,12 +55,15 @@ function Loadpasien() {
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 50, targets: 1 },
{ width: 80, targets: 1 },
{ width: 130, targets: 2 },
{ width: 130, targets: 3 },
{ width: 130, targets: 4 },
{ 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() {
});
}
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({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateantrianmiss',
url: baseURL + '/api/editkelolapasien',
data: {
iddok: iddokter,
iidpasien: idpasien,
id_pasien: id_pasien,
iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
},
success: function (result) {
console.log()
if (result.code == 0) {
success: function (response) {
console.log(response);
if (response['code'] == 0) {
swal({
title: "",
text: "Data Berhasil Diupdate!",
text: "Data Berhasil DiUbah!",
icon: "succes",
button: "ok",
}, function () {
......@@ -183,10 +164,157 @@ function actionqueue(idpasien, iddokter) {
});
} 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);
}
});
}
);
}
});
}
......@@ -69,274 +69,317 @@ function Loadpoli() {
}
$('#tambah').on('click', function () {
var nama_poli = document.getElementById("nama_poli").value;
var kode_poli = document.getElementById("kode_poli").value;
$('#tambah').on('click', function (e) {
e.preventDefault();
let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama Poli Sudah Ada!', centerVertical: true });
if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli == null || kode_poli == "") {
bootbox.alert({ message: 'Kode poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (deskripsi_poli == null || deskripsi_poli == "") {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama poli sudah ada!', centerVertical: true });
}
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 {
savedatapoli();
}
})
function savedatapoli() {
let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
// let image = $('#kode_poli').val();
function savedatapoli() {
let nama_poli = $('#nama_poli').val();
let kode_poli = $('#kode_poli').val();
let deskripsi_poli = $('#deskripsi_poli').val();
const fileupload = $('#gambar_poli').prop('files')[0];
let formData = new FormData();
formData.append('inama_poli', nama_poli);
formData.append('ikode_poli', kode_poli);
formData.append('ideskripsi_poli', deskripsi_poli);
formData.append('fileupload', fileupload); // set file ke tipe data binary
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savekelolapoli',
data: {
inama_poli: nama_poli,
ikode_poli: kode_poli,
ideskripsi_poli: deskripsi_poli,
},
success: function (response) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savekelolapoli',
if (response['code'] == 0) {
swal({
title: "",
text: "Data Berhasil Ditambahkan!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
data:
// inama_poli: nama_poli,
// ikode_poli: kode_poli,
// ideskripsi_poli: deskripsi_poli,
formData,
} else {
swal({
title: "",
text: "Data Gagal Ditambahkan!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
cache: false,
processData: false,
contentType: false,
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
}
}
success: function (response) {
});
}
if (response['code'] == 0) {
swal({
title: "",
text: "Data Berhasil Ditambahkan!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Ditambahkan!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
function validasipoli(nama_poli, kode_poli) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
}
}
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
async: false,
data: {
id: null,
},
success: function (result) {
});
}
var data = result.data;
for (x in data) {
if (nama_poli == data[x]['nama_poli']) {
exist = 1;
}
if (kode_poli == data[x]['kode_poli']) {
exist = 2;
}
}
function validasipoli(nama_poli, kode_poli) {
var exist = 0;
},
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
async: false,
data: {
id: null,
},
success: function (result) {
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
var data = result.data;
}
for (x in data) {
if (nama_poli == data[x]['nama_poli']) {
exist = 1;
}
if (kode_poli == data[x]['kode_poli']) {
exist = 2;
}
}
},
$('#edit').on('click', function () {
let id_poli = $('#id_poli').val();
var nama_poli = document.getElementById("nama_poliEdt").value;
var kode_poli = document.getElementById("kode_poliEdt").value;
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama Poli Harus Berbeda!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode Poli Harus Berbeda!', centerVertical: true });
} else {
editdatapoli(id_poli)
}
})
function editdatapoli(id_poli) {
let nama_poli = $('#nama_poliEdt').val();
let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
// let image = $('#kode_poli').val();
$('#edit').on('click', function () {
let id_poli = $('#id_poli').val();
let nama_poli = $('#nama_poliEdt').val();
let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkelolapoli',
async: false,
data: {
id: id_poli,
inama_poli: nama_poli,
ikode_poli: kode_poli,
ideskripsi_poli: deskripsi_poli,
},
if (nama_poli == null || nama_poli == "") {
bootbox.alert({ message: 'Nama poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (kode_poli == null || kode_poli == "") {
bootbox.alert({ message: 'Kode poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (deskripsi_poli == null || deskripsi_poli == "") {
bootbox.alert({ message: 'Deskripsi poli tidak boleh kosong', centerVertical: true });
return false;
}
else if (validasipoli(nama_poli, kode_poli) == 1) {
bootbox.alert({ message: 'Nama poli harus berbeda!', centerVertical: true });
}
else if (validasipoli(nama_poli, kode_poli) == 2) {
bootbox.alert({ message: 'Kode poli harus berbeda!', centerVertical: true });
} else {
editdatapoli(id_poli)
}
success: function (response) {
//console.log(respoonse);
if (response['code'] == 0) {
swal({
title: "",
text: "Data Berhasil DiUbah!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
})
function editdatapoli(id_poli) {
let nama_poli = $('#nama_poliEdt').val();
let kode_poli = $('#kode_poliEdt').val();
let deskripsi_poli = $('#deskripsi_poliEdt').val();
// let image = $('#kode_poli').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkelolapoli',
async: false,
data: {
id: id_poli,
inama_poli: nama_poli,
ikode_poli: kode_poli,
ideskripsi_poli: deskripsi_poli,
},
} else {
swal({
title: "",
text: "Data Gagal Ditambahkan!",
icon: "succes",
button: "ok",
});
success: function (response) {
//console.log(respoonse);
if (response['code'] == 0) {
swal({
title: "",
text: "Data Berhasil DiUbah!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
}
} else {
swal({
title: "",
text: "Data Gagal Ditambahkan!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
}
}
}
});
}
});
}
function loadedit(param) {
function loadedit(param) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
data: {
id: param,
},
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
data: {
id: param,
},
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result.code == 0) {
if (result.code == 0) {
let data = result.data;
let data = result.data;
$('#id_poli').val(data[0].id_poli);
$('#nama_poliEdt').val(data[0].nama_poli);
$('#nama_poli2').val(data[0].nama_poli);
$('#kode_poliEdt').val(data[0].kode_poli);
$('#deskripsi_poliEdt').val(data[0].deskripsi_poli);
$('#id_poli').val(data[0].id_poli);
$('#nama_poliEdt').val(data[0].nama_poli);
$('#nama_poli2').val(data[0].nama_poli);
$('#kode_poliEdt').val(data[0].kode_poli);
$('#deskripsi_poliEdt').val(data[0].deskripsi_poli);
} else {
alert(result.info);
} else {
alert(result.info);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
});
}
function Delete(param) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
data: {
id: param,
},
success: function (result) {
// console.log(result.data[0].nama_poli);
let nama_poli = result.data[0].nama_poli;
swal({
title: "Apakah yakin mengahapus poli '" + nama_poli + "'? \nJika anda menghapus Poli ini \nmaka Dokter Dan Ruangan \ndengan nama poli '" + nama_poli + "' akan terhapus",
type: "error",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!",
showCancelButton: true,
function Delete(param) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkelolapoli',
data: {
id: param,
},
function () {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/deletekelolapoli',
data: {
id: param,
},
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);
}
});
success: function (result) {
// console.log(result.data[0].nama_poli);
let nama_poli = result.data[0].nama_poli;
swal({
title: "Apakah yakin mengahapus poli '" + nama_poli + "'? \nJika anda menghapus Poli ini \nmaka Dokter Dan Ruangan \ndengan nama poli '" + nama_poli + "' akan terhapus",
type: "error",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
// This function will run if the user clicked "cancel"
window.location.href = "<?php echo Yii::$app->request->baseUrl;?>/todo/index/";
}
);
function () {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/deletekelolapoli',
data: {
id: param,
},
success: function (result) {
// console.log(result)
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Dihapus!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
},
function () {
// This function will run if the user clicked "cancel"
window.location.href = "<?php echo Yii::$app->request->baseUrl;?>/todo/index/";
}
);
}
});
}
});
}
}
......@@ -8,9 +8,9 @@ function reset() {
}
function closeWin() {
myWindow.close();
}
// function closeWin() {
// myWindow.close();
// }
function loadpoli() {
......@@ -51,7 +51,7 @@ function loadpoli() {
});
}
Loadruang(null);
Loadruang();
function Loadruang() {
/* save data */
......@@ -77,9 +77,10 @@ function Loadruang() {
cols += '<td class="">' + counter + '</td>';
// cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].id_poli + '</td>'
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].lantai + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_ruang + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].condition + '</td>';
// cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].image + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="padding: 7px;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#Editdata" onClick="loadedit(' + data[x].id_ruang + ')">Edit</span> <span style="padding: 7px;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_ruang + ')">Delete</span></div></td>';
......@@ -100,10 +101,11 @@ function Loadruang() {
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 215, targets: 1 },
{ width: 215, targets: 2 },
{ width: 215, targets: 3 },
{ width: 107, targets: 4 },
{ width: 180, targets: 1 },
{ width: 140, targets: 2 },
{ width: 140, targets: 3 },
{ width: 140, targets: 4 },
{ width: 100, targets: 5 },
],
});
......@@ -122,12 +124,30 @@ $('#tambahmodal').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() {
let nama_ruang = $('#nama_ruang').val();
let lantai = $('#lantai').val();
let poli = $("#poli option:selected").attr("value");
......@@ -139,12 +159,16 @@ function saveruang() {
url: baseURL + '/api/savekelolaruang',
data: {
inama_ruang: nama_ruang,
ilantai: lantai,
ipoli: poli,
},
success: function (result) {
// console.log(result)
if (result['code'] == 0) {
swal({
title: "",
......@@ -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 () {
let id_ruang = $('#id_ruang').val();
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } else {
editdataruang(id_ruang)
// }
let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val();
let poli = $("#poliedt option:selected").attr("value");
// console.log(poli)
if (nama_ruang == null || nama_ruang == "") {
bootbox.alert({ message: 'Nama Ruang tidak boleh kosong', centerVertical: true });
return false;
}
else if (lantai == null || lantai == "") {
bootbox.alert({ message: 'Lantai tidak boleh kosong', centerVertical: true });
return false;
} else if (validasiruang(lantai, nama_ruang) == 2) {
bootbox.alert({ message: 'Nama ruang dan lantai harus berbeda!', centerVertical: true });
} else {
editdataruang(id_ruang)
}
})
function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val();
let lantai = $('#lantaiedt').val();
let condition = $("#condition option:selected").attr("value");
$.ajax({
......@@ -200,12 +288,14 @@ function editdataruang(id_ruang) {
id: id_ruang,
inama_ruang: nama_ruang,
ipoli: poli,
ilantai: lantai,
icondition: condition,
},
success: function (response) {
//console.log(respoonse);
if (response['code'] == 0) {
swal({
title: "",
......@@ -272,7 +362,7 @@ function loadedit(id_ruang) {
if (result['code'] == 0) {
console.log(result);
// console.log(result);
var res = result['data'];
optionseg = '';
......@@ -303,6 +393,7 @@ function loadedit(id_ruang) {
});
$('#id_ruang').val(data[0].id_ruang);
$('#nama_ruangedt').val(data[0].nama_ruang);
$('#lantaiedt').val(data[0].lantai);
} else {
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
......@@ -326,7 +417,7 @@ function Delete(param) {
id: param,
},
success: function (result) {
console.log(result);
// console.log(result);
let nama_ruang = result.data[0].nama_ruang;
swal({
title: "Apakah yakin mengahapus ruang '" + nama_ruang + "'? ",
......@@ -355,7 +446,12 @@ function Delete(param) {
location.reload();
});
} else {
alert('gagal');
swal({
title: "",
text: "Data Gagal Dihapus!",
icon: "succes",
button: "ok",
});
}
},
error: function (xhr) {
......
......@@ -36,7 +36,7 @@ input, button {
input, select {
border: 1px solid #CCC;
width: 250px; }
width: 20px; }
::-webkit-input-placeholder {
color: #BBB; }
......
......@@ -4,6 +4,7 @@ Chart.defaults.global.defaultFontColor = '#858796';
// Pie Chart Example
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
type: 'doughnut',
data: {
......@@ -33,3 +34,44 @@ var myPieChart = new Chart(ctx, {
cutoutPercentage: 80,
},
});
loadpoli()
function loadpoli() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadRegisterpoli',
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');
}
}
}
});
}
}
});
}
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