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 {
return $this->getOutput($result->toJson());
}
public function savedataAction(){
public function savedatapasienAction(){
$result = new Result();
$request = $this->getRequest();
......@@ -63,28 +63,22 @@ class ApiController extends \Application\Master\GlobalActionController {
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;
$poli = $post->ipoli;
$dokter = $post->idokter;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$counter= $param->getMaxCounter();
// print_r($counter);die;
$dataArrayAntrianPasien = array (
'id_pasien' => $counter->data,
$dataArrayPasien = array (
'id_pasien' => $idpasien,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
'tempat_lahir' => $tempat_lahir,
......@@ -92,33 +86,131 @@ class ApiController extends \Application\Master\GlobalActionController {
'alamat' => $alamat,
'no_hp' => $no_hp,
'ktp' => $ktp,
'status_code' => 10,
);
$dataArrayPasien = array (
$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());
$param = new \Application\Model\Param($storage);
try{
$id = $post->iid;
$nama = $post->inama;
$tempat_lahir = $post->itempat_lahir;
$tanggal_lahir = $post->itanggal_lahir;
$alamat = $post->ialamat;
$no_hp = $post->ino_hp;
$poli = $post->ipoli;
$dokter = $post->idokter;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis;
// $counter= $param->getMaxCounter();
$dataArrayAntrianPasien = array (
'id_pasien' => $id,
'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_rekam_medis'=> $no_rekam_medis,
'no_hp' => $no_hp,
'ktp' => $ktp,
'status_code' => 10,
);
$table_antrianpasien = 'antrian_pasien';
$where = 'id_dokter='.$dokter.' and no_antrian='.$no_antrian;
// print_r ();die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $where);
$param->saveGlobal( $dataArrayPasien, $table_pasien);
$register = $param->loadregisterantrian($where);
$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->info = 'ok';
$result->data = $dataArrayAntrianPasien;
$result->data = $register->data;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
......@@ -548,7 +640,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = 0;
$result->info = 'ok';
$result->data = $dataArrayPoli->data;
$result->data = $dataArrayPoli;
}catch (\Exception $exc) {
......
......@@ -39,7 +39,23 @@ class QueueController extends \Application\Master\GlobalActionController
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();
......@@ -52,9 +68,32 @@ class QueueController extends \Application\Master\GlobalActionController
$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");
return $view;
......@@ -91,6 +130,23 @@ class QueueController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutQueue");
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()
{
......@@ -103,25 +159,31 @@ class QueueController extends \Application\Master\GlobalActionController
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
$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());
$param = new \Application\Model\Param($storage);
$id = $decodeid ;
// $iddok = $decodeiddok ;
/* generate counter number */
$codeCounter = $param->loadUser($id);
// print_r($codeCounter);die;
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;
$view->setVariable('no_rekam_medis', $result['no_rekam_medis']);
$view->setVariable('nama', $result['nama']);
$view->setVariable('nama_dokter', $result['nama_dokter']);
$view->setVariable('kode_poli', $result['nama_poli']);
......@@ -132,12 +194,13 @@ class QueueController extends \Application\Master\GlobalActionController
// print_r($result);die;
$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_dokter_cetak = "' . $result['nama_dokter'] . '"');
$this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"');
$this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-antrian.js');
$this->headScript->appendFile('/action-js/antrian-js/action-cetak.js');
$this->layout("layout/layoutQueue");
return $view;
......
......@@ -41,6 +41,11 @@ class Param extends Mapper {
$data = $this->_storage->saveGlobal($param, $table);
return $data;
}
public function loadregisterantrian($where){
$data = $this->_storage->getRegister($where);
return $data;
}
public function updateGlobal($tabel, $data, $where){
$data = $this->_storage->updateGlobal($tabel, $data, $where);
......@@ -52,10 +57,19 @@ class Param extends Mapper {
return $data;
}
public function loadUser($id = null){
$data = $this->_storage->loadUserData($id);
public function loadUser($id = null, $iddok = null){
$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;
}
public function loadRegisterPoli($id = null){
$data = $this->_storage->loadRegisterPoli($id);
return $data;
......
......@@ -318,22 +318,19 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
/* load data user */
public function loadUserData($id = null){
public function loadUserData($id){
$result = new Result();
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
-- INNER JOIN pasien
-- ON pasien.id_pasien = pasien.id_pasien
INNER JOIN dokter_to_poli
ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter
INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli";
ON antrian_pasien.id_poli = poli.id_poli
WHERE antrian_pasien.id_antrian = $id
";
//print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
......@@ -368,7 +365,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
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);
$resdata = $stmt->execute();
......@@ -397,6 +394,119 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result;
}
public function loaddatapasien($id){
$result = new Result();
try {
$sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
if ($listdata) {
$result->code = 0;
$result->info = 'OK';
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'nok';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
public function 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){
$result = new Result();
try {
......
......@@ -11,7 +11,7 @@
<p>Lorem ipsum dolor sit amet, consectetur adipiscing
elit sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Quis ipsum suspendisse ultrices gravida.Risus cmodo viverra </p>
<a href="<?php echo $this->basePath('queue/tambahantrian');?>"class="btn_2">Daftar Antrian</a>
<a href="<?php echo $this->basePath('queue/cekdatapasien');?>"class="btn_2">Registrai Antrian</a>
</div>
</div>
......
<!DOCTYPE html>
<hr>
<hr>
<hr>
<hr>
<br>
<br>
<br>
<br>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
......@@ -26,10 +25,22 @@
<div class="card" >
<div class="card-header">
<h1></h1>
<h2> Data Pasien</h2>
</div>
<div class="card-body">
<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="col-sm-2">
<h3>Nama pasien</h3>
......@@ -82,12 +93,12 @@
</div>
</div>
<div class="card-title" >
<div class="card-footer" >
<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>
</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 @@
->prependStylesheet($this->basePath('/tamplate/css/themify-icons.css'))
->prependStylesheet($this->basePath('/tamplate/css/flaticon.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/bootstrap.min.css'))
->prependStylesheet($this->basePath('/tamplate/css/bootstrap.min.css'))
......@@ -65,17 +66,18 @@
<a class="nav-link" href="<?php echo $this->basePath('queue/beranda') ?>">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/tambahantrian') ?>">Daftar Antrian</a>
<a class="nav-link" href="<?php echo $this->basePath('queue/cekdatapasien') ?>">Registrasi </a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/') ?>">Pilih Antrian</a>
</li> -->
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/dokter') ?>">Doctors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $this->basePath('queue/poli') ?>">Poli</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Tentang Kami</a>
</li>
</ul>
</div>
</nav>
......@@ -102,7 +104,7 @@
<div class="container">
<div class="row justify-content-between">
<div class="col-xl-2 col-md-4 col-sm-6 single-footer-widget">
<a href="#" class="footer_logo"> <img src="<?php $this->basePath('queue/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>
<div class="social_logo">
<a href="#"><i class="ti-facebook"></i></a>
......@@ -115,7 +117,7 @@
<h4>Quick Links</h4>
<ul>
<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="#">Poli</a></li>
<li><a href="#">Tentang Kami</a></li>
......@@ -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.validate.min.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/custom.js"></script> -->
......
$(document).ready(function () {
$("#tanggal_lahir").change(function () {
//console.log("berubah nih!");
var x = new Date($("#tanggal_lahir").val());
var Cnow = new Date();
if (Cnow.getFullYear() < x.getFullYear()) {
bootbox.alert({
title: "<span min-height='100px'></span>",
message: "Tanggal Lahir tidak Boleh Melebihi Tanggal Hari ini!",
callback: function () {
console.log('This was logged in the callback!');
},
centerVertical: true
})
//$("#tanggal_lahir").val('');
}
});
});
$('#cetak').on('click', function (e) {
//alert("kepanggil");
e.preventDefault();
var w = window.open('', '', 'width=300,height=400');
w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' +
'<th><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>' +
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
return false;
})
$('#tambah').on('click', function () {
SaveDataAja();
})
function SaveDataAja(param) {
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 poli = $("#poli option:selected").attr("value");
let dokter = $('#dokter option:selected').attr("value");
let ktp = $('#ktp').val();
let no_antrian = $("input[name=antrian]:checked").val();
// console.log(no_antrian);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savedata',
data: {
iktp: ktp,
//id_pasien: param,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
ipoli: poli,
idokter: dokter,
ino_antrian: no_antrian,
},
success: function (response) {
// alert("success");
// response[data];
if (response['code'] == 0) {
let $id = response.data.id_pasien;
// alert($id);
let $encodedId = btoa($id);
// console.log($encodedId);
window.location.href = ("cetakantrian/" + $encodedId);
} else {
bootbox.alert({ message: ' gagal', centerVertical: true });
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('dadas');
}
}
});
}
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');
}
}
}
});
}
}
});
}
$('#pilihno').on('click', function () {
// let nama = $('#nama').val();
// let tempat_lahir = $('#tempat_lahir').val();
// let tanggal_lahir = $('#tanggal_lahir').val();
// let alamat = $('#alamat').val();
// let no_hp = $('#no_hp').val();
// let poli = $("#poli option:selected").attr("value");
// let dokter = $('#dokter option:selected').attr("value");
// let ktp = $('#ktp').val();
// // let $kode_poli = $("#poli option:selected").attr("code");
// let $no_antrian = $('#no_antrian').val();
// // console.log(nama);
// 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 (poli == null || poli == "") {
// bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (dokter == null || dokter == "") {
// bootbox.alert({ message: 'Dokter 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;
// } else {
pilihAntrian()
// }
});
function pilihAntrian() {
var $dokter = $('#dokter option:selected').attr("value");
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadPilihAntrian',
data: {
iddok: $dokter,
},
success: function (response) {
console.log(response.data);
var $antrian = (response.data);
// console.log($antrian);
// console.log(response);
if ($antrian) {
var hour=0;;
var splithour=[];
splithour[0]= $antrian[0]['jam_mulai'].split(':');
hour += parseInt(splithour[0][0]);
minute = parseInt(splithour[0][1]);
for (var i = 0; i < $antrian.length; i++) {
if ($antrian[i]['id_pasien'] === null) {
let y = '';
var splittime=[];
splittime[i]= $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute/60);
minute = minute % 60;
}
if(minute.toString().length ===1){
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label style="text-align:center` + i + `">` + hour +':'+'0'+minute+ `</label>
</div>
</div > `;
$('.antrian').append(y);
}else{
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label style="text-align:center"` + i + `">` + hour +':'+minute+ `</label>
</div>
</div > `;
$('.antrian').append(y);
}
minute += parseInt(splittime[i][1]);
} else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] ==40 ){
var splittime=[];
splittime[i]= $antrian[i]['waktu_antrian'].split(':');
let y = '';
if (minute >= 60) {
hour += Math.floor(minute/60);
minute = minute % 60;
}
if(minute.toString().length ===1){
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label for="antrian` + i + `">` + hour +':'+'0'+minute+ `</label>
</div>
</div > `;
$('.antrian').append(y);
}else{
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label for="antrian` + i + `">` + hour +':'+minute+ `</label>
</div>
</div > `;
$('.antrian').append(y);
}
minute += parseInt(splittime[i][1]);
}
else if ( $antrian[i]['status_code']==60){
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
</div>
</div > `;
$('.antrian').append(y);
} else if ( $antrian[i]['status_code']==50){
var splittime=[];
splittime[i]= $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute/60);
minute = minute % 60;
}
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
</div>
</div > `;
$('.antrian').append(y);
minute += parseInt(splittime[i][1]);
}
}
} else {
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('Cannot load queue');
}
}
});
}
$(document).ready(function () {
$('#close').on('click', function () {
document.getElementById("seat").innerHTML = "";
})
});
// jQuery(document).ready(function () {
// $('[data-toggle="tooltip"]').tooltip();
// $('[data-toggle="popover"]').popover();
// $('#iInput').keyboard({
$('#cetak').on('click', function (e) {
//alert("kepanggil");
e.preventDefault();
var w = window.open('', '', 'width=300,height=400');
w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' +
'<th><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>' +
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
return false;
// //theme: 'default',
// //is_hidden: false,
// //close_speed: 1000,
// //enabled: false,
// //layout: 'en_US',
// // definimos un trigger al keyboard.
// // Al hacer click sobre el selector que tenga el id (#) o la clase (.) definida
// // se ocultara o mostrara el keyboard segun corresponda.
// trigger: '#buttom1'
// });
// // Guardo en la variable 'keyboard' (puede ser cualkier otro nombre), la instancia del plugin creada,
// // para asi acceder a los metodos publicos del plugin
// 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();
})
\ No newline at end of file
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 () {
})
$('#tambah').on('click', function () {
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() {
});
}
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;
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } else {
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)
// }
}
})
function editdatadokter(id_dokter) {
......@@ -195,7 +251,7 @@ function editdatadokter(id_dokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/editkeloladokter',
url: baseURL + '/api/loadkeloladokter',
data: {
id: id_dokter,
inama_dokter: nama_dokter,
......
......@@ -70,8 +70,17 @@ function Loadpoli() {
$('#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() {
},
success: function (response) {
// console.log(response)
if (response['code'] == 0) {
swal({
title: "",
......@@ -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 () {
let id_poli = $('#id_poli').val();
var nama_poli = document.getElementById("nama_poliEdt").value;
var kode_poli = document.getElementById("kode_poliEdt").value;
// if (validasieditnama() == true) {
// alert("Nama Poli Harus Berbeda!")
// } 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)
// }
}
})
function editdatapoli(id_poli) {
......@@ -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;
// }
......@@ -272,7 +272,7 @@ function loadedit(id_ruang) {
if (result['code'] == 0) {
console.log(result );
console.log(result);
var res = result['data'];
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