Commit 9ca9842f authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

Mengubah Controller, js dan tampilan pasien

parent 98b4b32f
...@@ -53,7 +53,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -53,7 +53,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function savedataAction(){ public function savedatapasienAction(){
$result = new Result(); $result = new Result();
$request = $this->getRequest(); $request = $this->getRequest();
...@@ -63,12 +63,113 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -63,12 +63,113 @@ class ApiController extends \Application\Master\GlobalActionController {
if ($request->isPost()) { if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
$counter = $param->getMaxCounter();
try{
$idpasien = $counter->data;
$nama = $post->inama;
$tempat_lahir = $post->itempat_lahir;
$tanggal_lahir = $post->itanggal_lahir;
$alamat = $post->ialamat;
$no_hp = $post->ino_hp;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$dataArrayPasien = array (
'id_pasien' => $idpasien,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir,
'alamat' => $alamat,
'no_hp' => $no_hp,
'ktp' => $ktp,
);
$param->saveGlobal( $dataArrayPasien, $table_pasien);
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPasien;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}
}
return $this->getOutput($result->toJson());
}
public function loaddatapasienAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
// print_r($load);die;
$load = $test->loaddatapasien($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 cekpasienAction(){
$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);
$no_rekam_medis = $post->ino_rekam_medis;
$cekpasien = $test->cekpasien($no_rekam_medis);
// print_r($cekpasien) ;die;
if($cekpasien->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $cekpasien->data ;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function savedataAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage); $param = new \Application\Model\Param($storage);
try{ try{
$id = $post->iid;
$nama = $post->inama; $nama = $post->inama;
$tempat_lahir = $post->itempat_lahir; $tempat_lahir = $post->itempat_lahir;
$tanggal_lahir = $post->itanggal_lahir; $tanggal_lahir = $post->itanggal_lahir;
...@@ -78,47 +179,38 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -78,47 +179,38 @@ class ApiController extends \Application\Master\GlobalActionController {
$dokter = $post->idokter; $dokter = $post->idokter;
$ktp = $post->iktp; $ktp = $post->iktp;
$no_antrian = $post->ino_antrian; $no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis;
// $counter= $param->getMaxCounter();
$counter= $param->getMaxCounter();
// print_r($counter);die;
$dataArrayAntrianPasien = array ( $dataArrayAntrianPasien = array (
'id_pasien' => $counter->data, 'id_pasien' => $id,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7), 'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama, 'nama' => $nama,
'tempat_lahir' => $tempat_lahir, 'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir, 'tanggal_lahir' => $tanggal_lahir,
'alamat' => $alamat, 'alamat' => $alamat,
'no_rekam_medis'=> $no_rekam_medis,
'no_hp' => $no_hp, 'no_hp' => $no_hp,
'ktp' => $ktp, 'ktp' => $ktp,
'status_code' => 10, 'status_code' => 10,
); );
$dataArrayPasien = array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir,
'alamat' => $alamat,
'no_hp' => $no_hp,
'ktp' => $ktp,
);
$table_antrianpasien = 'antrian_pasien'; $table_antrianpasien = 'antrian_pasien';
$where = 'id_dokter='.$dokter.' and no_antrian='.$no_antrian; $where = 'id_dokter='.$dokter.' and no_antrian='.$no_antrian;
// print_r ();die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $where); $register = $param->loadregisterantrian($where);
$param->saveGlobal( $dataArrayPasien, $table_pasien);
$id_antrian = $register->data[0]['id_antrian'];
$whereidantrian = 'id_antrian='.$id_antrian;
// print_r($id_antrian);die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian);
$result->code = 0; $result->code = 0;
$result->info = 'ok'; $result->info = 'ok';
$result->data = $dataArrayAntrianPasien; $result->data = $register->data;
}catch (\Exception $exc) { }catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString()); $result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
...@@ -548,7 +640,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -548,7 +640,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = 0; $result->code = 0;
$result->info = 'ok'; $result->info = 'ok';
$result->data = $dataArrayPoli->data; $result->data = $dataArrayPoli;
}catch (\Exception $exc) { }catch (\Exception $exc) {
......
...@@ -39,7 +39,23 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -39,7 +39,23 @@ class QueueController extends \Application\Master\GlobalActionController
return $view; return $view;
} }
public function tambahantrianAction() public function daftarpasienAction()
{
$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-daftarpasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function resumecekpasienAction()
{ {
$view = new ViewModel(); $view = new ViewModel();
...@@ -52,9 +68,32 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -52,9 +68,32 @@ class QueueController extends \Application\Master\GlobalActionController
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-antrian.js'); $this->headScript->appendFile('/action-js/antrian-js/action-datapasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function datapasienAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
$decodeid = base64_decode($getpath[3]);
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-datapasien.js');
$this->layout("layout/layoutQueue"); $this->layout("layout/layoutQueue");
return $view; return $view;
...@@ -91,6 +130,23 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -91,6 +130,23 @@ class QueueController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutQueue"); $this->layout("layout/layoutQueue");
return $view; return $view;
} }
public function cekdatapasienAction()
{
$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-cekdatapasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function cetakantrianAction() public function cetakantrianAction()
{ {
...@@ -99,29 +155,35 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -99,29 +155,35 @@ class QueueController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
//echo "<pre>"; //echo "<pre>";
//print_r($uri);die; //print_r($uri);die;
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath()); $getpath = explode("/",$uri->getPath());
$decodeid = base64_decode($getpath[3]); $decodeid = base64_decode($getpath[3]);
// print_r ($decodeid);die; // $a = $getpath[3];
$decodeiddok = base64_decode($getpath[4]);
// $decodeidpol = base64_decode($getpath[5]);
// $decodeidant = base64_decode($getpath[6]);
// print_r($decodeiddok );die;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage); $param = new \Application\Model\Param($storage);
$id = $decodeid ; $id = $decodeid ;
// $iddok = $decodeiddok ;
/* generate counter number */ /* generate counter number */
$codeCounter = $param->loadUser($id); $codeCounter = $param->loadUser($id);
// print_r($codeCounter);die; // print_r($codeCounter);die;
foreach($codeCounter->data as $result) { foreach($codeCounter->data as $result) {
// echo $result['id_pasien'], '<br>';
// echo $result['nama'], '<br>';
// echo $result['id_poli'], '<br>';
// echo $result['id_dokter'], '<br>';
} }
//print_r($codeCounter);die; //print_r($codeCounter);die;
$view->setVariable('no_rekam_medis', $result['no_rekam_medis']);
$view->setVariable('nama', $result['nama']); $view->setVariable('nama', $result['nama']);
$view->setVariable('nama_dokter', $result['nama_dokter']); $view->setVariable('nama_dokter', $result['nama_dokter']);
$view->setVariable('kode_poli', $result['nama_poli']); $view->setVariable('kode_poli', $result['nama_poli']);
...@@ -132,12 +194,13 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -132,12 +194,13 @@ class QueueController extends \Application\Master\GlobalActionController
// print_r($result);die; // print_r($result);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var no_rekam_medis_cetak = "' . $result['no_rekam_medis'] . '"');
$this->headScript->appendScript(' var nama_pasien_cetak = "' . $result['nama'] . '"'); $this->headScript->appendScript(' var nama_pasien_cetak = "' . $result['nama'] . '"');
$this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"'); $this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"');
$this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"'); $this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"');
$this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"'); $this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"'); $this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-antrian.js'); $this->headScript->appendFile('/action-js/antrian-js/action-cetak.js');
$this->layout("layout/layoutQueue"); $this->layout("layout/layoutQueue");
return $view; return $view;
......
...@@ -41,6 +41,11 @@ class Param extends Mapper { ...@@ -41,6 +41,11 @@ class Param extends Mapper {
$data = $this->_storage->saveGlobal($param, $table); $data = $this->_storage->saveGlobal($param, $table);
return $data; return $data;
} }
public function loadregisterantrian($where){
$data = $this->_storage->getRegister($where);
return $data;
}
public function updateGlobal($tabel, $data, $where){ public function updateGlobal($tabel, $data, $where){
$data = $this->_storage->updateGlobal($tabel, $data, $where); $data = $this->_storage->updateGlobal($tabel, $data, $where);
...@@ -52,10 +57,19 @@ class Param extends Mapper { ...@@ -52,10 +57,19 @@ class Param extends Mapper {
return $data; return $data;
} }
public function loadUser($id = null){ public function loadUser($id = null, $iddok = null){
$data = $this->_storage->loadUserData($id); $data = $this->_storage->loadUserData($id,$iddok);
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);
return $data; return $data;
} }
public function loadRegisterPoli($id = null){ public function loadRegisterPoli($id = null){
$data = $this->_storage->loadRegisterPoli($id); $data = $this->_storage->loadRegisterPoli($id);
return $data; return $data;
......
...@@ -318,22 +318,19 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -318,22 +318,19 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
/* load data user */ /* load data user */
public function loadUserData($id = null){ public function loadUserData($id){
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter $sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter,antrian_pasien.id_pasien, dokter_to_poli.id_dokter
FROM antrian_pasien FROM antrian_pasien
-- INNER JOIN pasien INNER JOIN dokter_to_poli
-- ON pasien.id_pasien = pasien.id_pasien ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter
INNER JOIN dokter_to_poli INNER JOIN poli
ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter ON antrian_pasien.id_poli = poli.id_poli
INNER JOIN poli WHERE antrian_pasien.id_antrian = $id
ON antrian_pasien.id_poli = poli.id_poli"; ";
//print_r($sql);die;
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -368,7 +365,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -368,7 +365,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT coalesce(MAX(id_pasien), 0) AS maxid FROM antrian_pasien "; $sql = " SELECT coalesce(MAX(id_pasien), 0) AS maxid FROM pasien";
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
$resdata = $stmt->execute(); $resdata = $stmt->execute();
...@@ -396,7 +393,120 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -396,7 +393,120 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
} }
return $result; return $result;
} }
public function loaddatapasien($id){
$result = new Result();
try {
$sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
if ($listdata) {
$result->code = 0;
$result->info = 'OK';
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'nok';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function getRegister($where){
$result = new Result();
try {
$sql = "SELECT id_antrian, id_dokter, no_antrian FROM antrian_pasien WHERE $where ";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
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 cekpasien($no_rekam_medis){
$result = new Result();
try {
$sql = " SELECT p.id_pasien, ap.no_rekam_medis, ap.status_code,ap.no_antrian ,ap.no_antrian, ap.id_antrian,ap.nama FROM pasien p
LEFT JOIN antrian_pasien ap
ON ap.id_pasien = p.id_pasien
WHERE p.no_rekam_medis='$no_rekam_medis' ";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
array_push($listdata, $val);
}
if ($listdata!=null) {
$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 loadRegisterPoli($id = null){ public function loadRegisterPoli($id = null){
$result = new Result(); $result = new Result();
try { try {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<p>Lorem ipsum dolor sit amet, consectetur adipiscing <p>Lorem ipsum dolor sit amet, consectetur adipiscing
elit sed do eiusmod tempor incididunt ut labore et dolore elit sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Quis ipsum suspendisse ultrices gravida.Risus cmodo viverra </p> magna aliqua. Quis ipsum suspendisse ultrices gravida.Risus cmodo viverra </p>
<a href="<?php echo $this->basePath('queue/tambahantrian');?>"class="btn_2">Daftar Antrian</a> <a href="<?php echo $this->basePath('queue/cekdatapasien');?>"class="btn_2">Registrai Antrian</a>
</div> </div>
</div> </div>
......
<!DOCTYPE html>
<hr>
<hr>
<hr>
<hr>
<br>
<br>
<br>
<br>
<section class="breadcrumb_part breadcrumb_bg"> <section class="breadcrumb_part breadcrumb_bg">
<div class="container"> <div class="container">
...@@ -26,10 +25,22 @@ ...@@ -26,10 +25,22 @@
<div class="card" > <div class="card" >
<div class="card-header"> <div class="card-header">
<h1></h1> <h2> Data Pasien</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="panel panel-white" id="print"> <div class="panel panel-white" id="print">
<div class="row">
<div class="col-sm-2">
<h3>No Rekam Medis</h3>
</div>
<div class="col-sm-1">
<h3>:</h3>
</div>
<div class="col-sm-6">
<h3><?php echo $this->no_rekam_medis ?></h3>
</div>
</div>
<br>
<div class="row"> <div class="row">
<div class="col-sm-2"> <div class="col-sm-2">
<h3>Nama pasien</h3> <h3>Nama pasien</h3>
...@@ -82,12 +93,12 @@ ...@@ -82,12 +93,12 @@
</div> </div>
</div> </div>
<div class="card-title" > <div class="card-footer" >
<p class="card-text"></p> <p class="card-text"></p>
<button id="cetak" class="btn btn-primary"> Cetak</button> <button id="cetak" class="btn btn-primary" style="float: right;"> Cetak</button>
</div> </div>
</div> </div>
</html> <br>
......
<!DOCTYPE html>
<html>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
.buttons input[type="radio"] {
display: none;
}
.buttons input[type="picked"] {
display: none;
}
.buttons input[type="done"] {
display: none;
}
input[type="radio"]:checked + label {
padding: 15px;
color: #fff;
font-size: 25px;
background: #7FFF00;
width : 55px;
text-align:center;
}
input[type="radioo"] + label {
padding: 15px;
background: #fff;
color: black;
font-size: 25px;
width: 1080px;
text-align: center;
}
input[type="radio"] + label {
padding: 15px;
background: #007bff;
color: #fff;
font-size: 25px;
width : 55px;
text-align:center;
}
input[type="picked"] + label {
padding: 15px;
background: #FF0000;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
input[type="done"] + label {
padding: 15px;
background: #808080;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
.table1 tr th{
background: #007bff;
color: #fff;
}
.table1, th, td {
padding: 10px 20px;
text-align: center;
}
.table2 tr th{
background: #7FFF00;
color: #fff;
}
.table2, th, td {
padding: 10px 20px;
text-align: center;
}
.table3 tr th{
background: #FF0000;
color: #fff;
}
.table3, th, td {
padding: 10px 20px;
text-align: center;
}
.table4 tr th{
background: #808080;
color: #fff;
}
.table4, th, td {
padding: 10px 20px;
text-align: center;
}
</style>
<body>
<!-- breadcrumb start-->
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Daftar </h2>
<h2>Antrian</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<div class="container">
<form id="myForm">
<input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group">
<label>KTP</label>
<input type="number" id="ktp" class="form-control"placeholder="KTP" minlength="8" maxlength="10" /></input>
</div>
<div class="form-group">
<label>Nama pasien</label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" required/></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="form-group">
<label>Pilih poli</label><br>
<select name="nama_poli" id="poli" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
<div class="form-group">
<label>Pilih dokter</label> <br>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
<br>
</div>
</form>
</div>
</div>
<div class="container">
<button type="button" id="pilihno" class="btn btn-primary" data-toggle="modal" data-target="#pilihantrian"> Daftar Antrian</button>
</div>
</div>
<!-- Trigger the modal with a button -->
<!-- Modal -->
<div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="-close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Daftar Antrian</h4>
</div>
<div class="modal-body">
<div class="row col-lg-12 antrian" id="seat">
</div>
<div class="modal-footer">
<div class="container" >
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Belum Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table1"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Yang Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table2"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Diisi</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table3"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Selesai</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table4"><tr><th></th></tr></table>
</div>
</div>
</div>
<button button type="button" class="btn btn-primary" id="tambah">Selesai</button>
<button type="button" id="close" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
->prependStylesheet($this->basePath('/tamplate/css/themify-icons.css')) ->prependStylesheet($this->basePath('/tamplate/css/themify-icons.css'))
->prependStylesheet($this->basePath('/tamplate/css/flaticon.css')) ->prependStylesheet($this->basePath('/tamplate/css/flaticon.css'))
->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css')) ->prependStylesheet($this->basePath('/tamplate/css/magnific-popup.css'))
->prependStylesheet($this->basePath('/tamplateadmin/css/swich-alert.css'))
->prependStylesheet($this->basePath('/tamplate/css/nice-select.css')) ->prependStylesheet($this->basePath('/tamplate/css/nice-select.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css')) ->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
...@@ -65,17 +66,18 @@ ...@@ -65,17 +66,18 @@
<a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a> <a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/tambahantrian') ?>">Daftar Antrian</a> <a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi </a>
</li> </li>
<!-- <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/') ?>">Pilih Antrian</a>
</li> -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a> <a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a> <a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Tentang Kami</a>
</li>
</ul> </ul>
</div> </div>
</nav> </nav>
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
<div class="container"> <div class="container">
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget"> <div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget">
<a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/listdata') ?>/tamplate/img/logo.png" alt="#"> </a> <a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/beranda') ?>/tamplate/img/logo.png" alt="#"> </a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor </p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor </p>
<div class="social_logo"> <div class="social_logo">
<a href="#"><i class="ti-facebook"></i></a> <a href="#"><i class="ti-facebook"></i></a>
...@@ -115,7 +117,7 @@ ...@@ -115,7 +117,7 @@
<h4>Quick Links</h4> <h4>Quick Links</h4>
<ul> <ul>
<li><a href="#">Beranda</a></li> <li><a href="#">Beranda</a></li>
<li><a href="#">Daftar Antrian</a></li> <li><a href="#">Registrasi Antrian</a></li>
<li><a href="#">Dokter</a></li> <li><a href="#">Dokter</a></li>
<li><a href="#">Poli</a></li> <li><a href="#">Poli</a></li>
<li><a href="#">Tentang Kami</a></li> <li><a href="#">Tentang Kami</a></li>
...@@ -171,6 +173,8 @@ ...@@ -171,6 +173,8 @@
<script src="<?php echo $this->basePath();?>/tamplate/js/jquery.form.js"></script> <script src="<?php echo $this->basePath();?>/tamplate/js/jquery.form.js"></script>
<script src="<?php echo $this->basePath();?>/tamplate/js/jquery.validate.min.js"></script> <script src="<?php echo $this->basePath();?>/tamplate/js/jquery.validate.min.js"></script>
<script src="<?php echo $this->basePath();?>/tamplate/js/mail-script.js"></script> <script src="<?php echo $this->basePath();?>/tamplate/js/mail-script.js"></script>
<script src="<?php $this->basePath();?>/tamplateadmin/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<!-- <script src="<?php echo $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script> --> <!-- <script src="<?php echo $this->basePath();?>/tamplate/js/bootbox.all.min.js"></script> -->
<!-- <script src="<?php echo $this->basePath();?>/tamplate/js/custom.js"></script> --> <!-- <script src="<?php echo $this->basePath();?>/tamplate/js/custom.js"></script> -->
......
This diff is collapsed.
// jQuery(document).ready(function () {
// $('[data-toggle="tooltip"]').tooltip();
// $('[data-toggle="popover"]').popover();
// $('#iInput').keyboard({ $('#cetak').on('click', function (e) {
//alert("kepanggil");
// //theme: 'default', e.preventDefault();
var w = window.open('', '', 'width=300,height=400');
// //is_hidden: false, w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
// //close_speed: 1000, '<tbody><tr>' +
'<th><h2>ANTRIAN</h2>' +
// //enabled: false, '<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' +
'<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' +
// //layout: 'en_US', '<h3>Poli : ' + kode_poli_cetak + '</h3>' +
'<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' +
// // definimos un trigger al keyboard. '</th></tr></tbody></table></body></html>');
// // Al hacer click sobre el selector que tenga el id (#) o la clase (.) definida w.window.print();
// // se ocultara o mostrara el keyboard segun corresponda. w.document.close();
// trigger: '#buttom1' return false;
// });
// // Guardo en la variable 'keyboard' (puede ser cualkier otro nombre), la instancia del plugin creada, })
// // para asi acceder a los metodos publicos del plugin \ No newline at end of file
// var keyboard = $('#iInput').data('pluginKeyboard');
// // A partir de aqui inicializo los valores del cajon de 'Configuration Options' que vemos,
// // para que los campos tengan los valores con los que se creo la instancia del plugin.
// $('#hiddenCheck').attr('checked', !keyboard.getHidden()); // CheckBox k oculta o muestra el keyboard
// $('#openSpeedInput').val(keyboard.getOpenSpeed()); // Valor en milisegundos de la velocidad con que se muestra el keyboard
// $('#closeSpeedInput').val(keyboard.getCloseSpeed()); // Valor en milisegundos de la velocidad con que se oculta el keyboard
// keyboard.SubmitKey = function () { // Definimos que accion realizar al presionar la tecla 'Submit'.
// //alert('Presionada la tecla Enter');
// };
// keyboard.EnterKey = function () { // Definimos que accion realizar al presionar la tecla 'Submit'.
// // alert('Presionada la tecla Enter');
// };
// // Cambiamos el tema del teclado de acuerdo al valor que este seleccionado en el campo 'Select' del Tema.
// // De momento solo tres temas, estoy trabajando en mejorarlos y agregar 2 temas más.
// $('#themeSelect').change(function () {
// $(this).find(':selected').each(function () {
// keyboard.setTheme($('#themeSelect').val());
// })
// });
// // Definimos que al hacer click en el checkbox de 'Habilitar Keyboard' se bloquee o desbloquee el keyboard
// $('#enabledCheck').change(function () {
// keyboard.setEnabled(!keyboard.getEnabled());
// });
// // Definimos que al hacer click en el checkbox de 'Mostrar Keyboard' se muestro u oculte el keyboard
// $('#hiddenCheck').change(function () {
// keyboard.setHidden($(this).is(':checked'));
// });
// // Cambiamos la velocidad con que se muestra el keyboard al cambiar el valor del campo 'Open Speed', el valor esta en milisegundos
// $('#openSpeedInput').change(function () {
// keyboard.setOpenSpeed($(this).val());
// });
// // Cambiamos la velocidad con que se oculta el keyboard al cambiar el valor del campo 'Close Speed', el valor esta en milisegundos
// $('#closeSpeedInput').change(function () {
// keyboard.setCloseSpeed($(this).val());
// });
// $('.enter').click(function () {
// var $valInput = $('#iInput').val();
// if ($valInput) {
// keyboard.setHidden($(this).is(':checked'));
// $('#idTemp').text($valInput);
// $('#content-insert').css('display', 'none');
// $('#content-service').css('display', 'block');
// } else {
// $('#content-service').css('display', 'none');
// $('#content-insert').css('display', 'block');
// }
// });
// $('#iInput').click(function () {
// //keyboard.setEnabled(!keyboard.getEnabled());
// })
// });
$('#cetak').on('click', function () {
CetakAntrian();
})
function CetakAntrian() {
let $ktp = $('#ktp').val();
let $no_antrian = $('#no_antrian').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/cetakantrian',
data: {
iktp: $ktp,
ino_antrian: $no_antrian,
},
success: function (result) {
alert("berhasil");
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
// success: function (result) { //console.log(result);
// swal({
// title: "<span style='color:#222'>Good job!</span>",
// text: "You clicked the button!",
// confirmButtonColor: "#66BB6A",
// html: true,
// type: "success"
// });
// },
// error: function (xhr) {
// //alert(xhr.status+'-'+xhr.statusText);
// if (xhr.status != 200) {
// swal({
// title: "<span style='color:#222'>Oh!</span>",
// text: "You clicked the button!",
// confirmButtonColor: "#66BB6A",
// html: true,
// type: "warning"
// });
// }
// }
});
}
\ No newline at end of file
...@@ -117,7 +117,18 @@ $('#tambahmodal').on('click', function () { ...@@ -117,7 +117,18 @@ $('#tambahmodal').on('click', function () {
}) })
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
savedokter() var nama_dokter = document.getElementById("nama_dokter").value;
var kode_dokter = document.getElementById("kode_dokter").value;
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Sudah Ada!', centerVertical: true });
}
else if (validasidokter(nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode Dokter Sudah Ada!', centerVertical: true });
} else {
savedokter()
}
}) })
...@@ -175,14 +186,59 @@ function savedokter() { ...@@ -175,14 +186,59 @@ function savedokter() {
}); });
} }
function validasidokter(nama_dokter, kode_dokter) {
var exist = 0;
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadkeloladokter',
async: false,
data: {
id: null,
},
success: function (result) {
console.log(result)
var data = result.data;
for (x in data) {
if (nama_dokter == data[x]['nama_dokter']) {
exist = 1;
}
if (kode_dokter == data[x]['kode_dokter']) {
exist = 2;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () { $('#edit').on('click', function () {
let id_dokter = $('#id_dokter').val(); let id_dokter = $('#id_dokter').val();
var nama_dokter = document.getElementById("nama_dokteredt").value;
var kode_dokter = document.getElementById("kode_dokteredt").value;
if (validasidokter(nama_dokter, kode_dokter) == 1) {
bootbox.alert({ message: 'Nama Dokter Harus Berbeda!', centerVertical: true });
}
else if (validasidokter(nama_dokter, kode_dokter) == 2) {
bootbox.alert({ message: 'Kode Dokter Harus Berbeda!', centerVertical: true });
} else {
editdatadokter(id_dokter)
}
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } else {
editdatadokter(id_dokter)
// }
}) })
function editdatadokter(id_dokter) { function editdatadokter(id_dokter) {
...@@ -195,7 +251,7 @@ function editdatadokter(id_dokter) { ...@@ -195,7 +251,7 @@ function editdatadokter(id_dokter) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/editkeloladokter', url: baseURL + '/api/loadkeloladokter',
data: { data: {
id: id_dokter, id: id_dokter,
inama_dokter: nama_dokter, inama_dokter: nama_dokter,
......
...@@ -70,8 +70,17 @@ function Loadpoli() { ...@@ -70,8 +70,17 @@ function Loadpoli() {
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
savedatapoli() var nama_poli = document.getElementById("nama_poli").value;
var kode_poli = document.getElementById("kode_poli").value;
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 });
} else {
savedatapoli();
}
}) })
...@@ -93,7 +102,7 @@ function savedatapoli() { ...@@ -93,7 +102,7 @@ function savedatapoli() {
}, },
success: function (response) { success: function (response) {
// console.log(response)
if (response['code'] == 0) { if (response['code'] == 0) {
swal({ swal({
title: "", title: "",
...@@ -126,14 +135,58 @@ function savedatapoli() { ...@@ -126,14 +135,58 @@ function savedatapoli() {
}); });
} }
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) {
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;
}
}
},
error: function (xhr) {
//alert(xhr.status+'-'+xhr.statusText);
}
});
return exist;
}
$('#edit').on('click', function () { $('#edit').on('click', function () {
let id_poli = $('#id_poli').val(); let id_poli = $('#id_poli').val();
var nama_poli = document.getElementById("nama_poliEdt").value;
// if (validasieditnama() == true) { var kode_poli = document.getElementById("kode_poliEdt").value;
// alert("Nama Poli Harus Berbeda!")
// } else { if (validasipoli(nama_poli, kode_poli) == 1) {
editdatapoli(id_poli) 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) { function editdatapoli(id_poli) {
...@@ -286,46 +339,4 @@ function Delete(param) { ...@@ -286,46 +339,4 @@ function Delete(param) {
} }
// function validasieditnama() {
// var exist = false;
// var nama_poliEdt = document.getElementById("nama_poliEdt").value;
// var nama_poli2 = document.getElementById("nama_poli2").value;
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loadkelolapoli',
// data: {
// id: null,
// },
// success: function (result) {
// // console.log(result.data[0].nama_poli);
// //let counterExist = 0;
// var data = result.data;
// let i = 0;
// for (i; i < data.length; i++) {
// if (nama_poliEdt === data[i].nama_poli) {
// //exist = true;
// //counterExist += 1;
// if (nama_poliEdt == nama_poli2) {
// exist = false;
// } else {
// exist = true;
// }
// }
// }
// },
// error: function (xhr) {
// //alert(xhr.status+'-'+xhr.statusText);
// }
// });
// // console.log(exist);
// return exist;
// }
...@@ -254,7 +254,7 @@ function loadedit(id_ruang) { ...@@ -254,7 +254,7 @@ function loadedit(id_ruang) {
id: id_ruang, id: id_ruang,
}, },
success: function (result) { success: function (result) {
// console.log(result); // console.log(result);
// $('.loaddata').empty(); // $('.loaddata').empty();
// console.log(result); // console.log(result);
...@@ -269,10 +269,10 @@ function loadedit(id_ruang) { ...@@ -269,10 +269,10 @@ function loadedit(id_ruang) {
async: false, async: false,
success: function (result) { success: function (result) {
if (result['code'] == 0) { if (result['code'] == 0) {
console.log(result ); console.log(result);
var res = result['data']; var res = result['data'];
optionseg = ''; optionseg = '';
......
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