Commit 17518758 authored by Indra Raja's avatar Indra Raja

mengubah mapping table pada database

parent eb3c1e11
...@@ -138,7 +138,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -138,7 +138,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$tb_register_antrian ='register_antrian'; $tb_register_antrian ='register_antrian';
$tb_register_dokter ='register_dokter'; $tb_register_dokter ='register_dokter';
$tb_dokter ='dokter'; $tb_dokter ='dokter_to_poli';
$tb_ruang ='ruang'; $tb_ruang ='ruang';
$tb_antrian ='antrian'; $tb_antrian ='antrian';
$tb_antrian_pasien ='antrian_pasien'; $tb_antrian_pasien ='antrian_pasien';
...@@ -380,7 +380,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -380,7 +380,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$request = $this->getRequest(); $request = $this->getRequest();
$post = $request->getPost(); $post = $request->getPost();
$tb_dokter ='dokter'; $tb_dokter ='dokter_to_poli';
$tb_ruang ='ruang'; $tb_ruang ='ruang';
...@@ -621,7 +621,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -621,7 +621,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$tabel = 'dokter'; $tabel = 'dokter_to_poli';
$where = 'id_poli='.$post->id; $where = 'id_poli='.$post->id;
$res = $test->deleteGlobal($tabel, $where); $res = $test->deleteGlobal($tabel, $where);
$tabel = 'ruang'; $tabel = 'ruang';
...@@ -673,6 +673,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -673,6 +673,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$request = $this->getRequest(); $request = $this->getRequest();
$post = $request->getPost(); $post = $request->getPost();
$table_dokter_to_poli= 'dokter_to_poli';
$table_dokter= 'dokter'; $table_dokter= 'dokter';
if ($request->isPost()) { if ($request->isPost()) {
...@@ -689,18 +690,28 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -689,18 +690,28 @@ class ApiController extends \Application\Master\GlobalActionController {
//print_r($poli);die; //print_r($poli);die;
$dataArraydokter = array ( $DokterPoli = array (
'nama_dokter' => $nama_dokter, 'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter, 'kode_dokter' =>$kode_dokter,
'id_poli' =>$poli, 'id_poli' =>$poli,
'id_condition' => 1 'id_condition' => 1,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
);
$Dokter = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
); );
// print_r($dataArraydokter);die; // print_r($dataArraydokter);die;
$param->saveGlobal($dataArraydokter, $table_dokter); $param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$param->saveGlobal($Dokter, $table_dokter);
$result->code = 0; $result->code = 0;
...@@ -737,7 +748,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -737,7 +748,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$poli = $post->ipoli; $poli = $post->ipoli;
$condition = $post->icondition; $condition = $post->icondition;
$dataArraydokter = array ( $DokterPoli = array (
'nama_dokter' => $nama_dokter, 'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter, 'kode_dokter' =>$kode_dokter,
...@@ -745,13 +756,28 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -745,13 +756,28 @@ class ApiController extends \Application\Master\GlobalActionController {
'id_condition' =>$condition, 'id_condition' =>$condition,
);
$Dokter = array (
'nama_dokter' => $nama_dokter,
'kode_dokter' =>$kode_dokter,
); );
$load = $param->loadkeloladokter($post->id); $load = $param->loadkeloladokter($post->id);
// print_r($dataArraydokter);die;
$table_dokter_to_poli= 'dokter_to_poli';
$where = 'id_dokter='.$id_dokter;
// print_r ($where);die;
$param->updateGlobal($table_dokter_to_poli, $DokterPoli, $where);
// print_r($dataArraydokter);die; // print_r($dataArraydokter);die;
$table_dokter= 'dokter'; $table_dokter= 'dokter';
$where = 'id_dokter='.$id_dokter; $where = 'id_dokter='.$id_dokter;
// print_r ($where);die; // print_r ($where);die;
$param->updateGlobal($table_dokter, $dataArraydokter, $where); $param->updateGlobal($table_dokter, $Dokter, $where);
$result->code = 0; $result->code = 0;
$result->info = 'ok'; $result->info = 'ok';
...@@ -778,10 +804,14 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -778,10 +804,14 @@ class ApiController extends \Application\Master\GlobalActionController {
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$tabel = 'dokter'; $tabel_dokter_to_poli = 'dokter_to_poli';
$where = 'id_dokter='.$post->id; $where = 'id_dokter='.$post->id;
$res = $test->deleteGlobal($tabel, $where);
$tabel_dokter = 'dokter';
$res_tabel_dokter_to_poli = $test->deleteGlobal($tabel_dokter_to_poli, $where);
$res_tabel_dokter = $test->deleteGlobal($tabel_dokter, $where);
if($load->code == 0){ if($load->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
......
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</div>
<!-- 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">Earnings (Monthly)</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">$40,000</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar 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">Earnings (Annual)</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">$215,000</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign 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">Pending Requests</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">18</div>
</div>
<div class="col-auto">
<i class="fas fa-comments fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Area Chart -->
<div class="col-xl-8 col-lg-7">
<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">Earnings Overview</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-area">
<canvas id="myAreaChart"></canvas>
</div>
</div>
</div>
</div>
<!-- Pie Chart -->
<div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Revenue Sources</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChart"></canvas>
</div>
<div class="mt-4 text-center small">
<span class="mr-2">
<i class="fas fa-circle text-primary"></i> Direct
</span>
<span class="mr-2">
<i class="fas fa-circle text-success"></i> Social
</span>
<span class="mr-2">
<i class="fas fa-circle text-info"></i> Referral
</span>
</div>
</div>
</div>
</div>
<p class="mb-0">Before working with this theme, you should become familiar with the Bootstrap framework, especially the utility classes.</p>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
...@@ -189,7 +189,7 @@ function tampilangka() { ...@@ -189,7 +189,7 @@ function tampilangka() {
$('#btnNext').prop('disabled', true); $('#btnNext').prop('disabled', true);
$('#btnCall').prop('disabled', true); $('#btnCall').prop('disabled', true);
$('#btnServed').prop('disabled', true); $('#btnServed').prop('disabled', true);
$('#btnMissed').prop('disabled', false); $('#btnMissed').prop('disabled', true);
$('#btnDone').prop('disabled', false); $('#btnDone').prop('disabled', false);
} else if (res['status_code'] == 10) { } else if (res['status_code'] == 10) {
$('#no_antrian').empty(); $('#no_antrian').empty();
......
...@@ -168,12 +168,6 @@ function editdatapoli(id_poli) { ...@@ -168,12 +168,6 @@ function editdatapoli(id_poli) {
location.reload(); location.reload();
}); });
//
//window.onload
//location.reload()
} else { } else {
swal({ swal({
title: "", title: "",
......
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