first commit
This commit is contained in:
29
application/controllers/login.php
Normal file
29
application/controllers/login.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class Login extends CI_Controller{
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
public function index($error = NULL){
|
||||
$data['error']=$error;
|
||||
$this->load->view('login/v_login',$data);
|
||||
}
|
||||
public function process(){
|
||||
$this->load->model('m_login');
|
||||
$result = $this->m_login->validate();
|
||||
if(! $result){
|
||||
$error = '<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
|
||||
Username atau Password Salah!
|
||||
</div>';
|
||||
$this->index($error);
|
||||
}else{
|
||||
redirect('index.php/ps_anjungan/admin_anjungan');
|
||||
}
|
||||
}
|
||||
public function logout(){
|
||||
$this->session->sess_destroy();
|
||||
redirect('index.php/login');
|
||||
}
|
||||
}
|
||||
?>
|
||||
429
application/controllers/ps_anjungan.php
Normal file
429
application/controllers/ps_anjungan.php
Normal file
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
//-------------ID Anjungan = 10
|
||||
|
||||
class Ps_anjungan extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
//$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
// private function check_isvalidated(){
|
||||
// if(! $this->session->userdata('validated')){
|
||||
// redirect('index.php/login');
|
||||
// }
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
// $this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
// $this->db->where('mum_menu_id', '9');
|
||||
// $cekMenu = $this->db->get('master_user_menu');
|
||||
// $rowcount = $cekMenu->num_rows();
|
||||
// if($rowcount==0){
|
||||
// redirect('index.php');
|
||||
// }else{
|
||||
// foreach ($cekMenu->result() as $cm)
|
||||
// {
|
||||
// $this->vartambah=$cm->mum_tambah;
|
||||
// $this->varedit=$cm->mum_ubah;
|
||||
// $this->vardelete=$cm->mum_hapus;
|
||||
// $this->varview=$cm->mum_lihat;
|
||||
// }
|
||||
// }
|
||||
//--------------end check access this form page-------------//
|
||||
// }
|
||||
|
||||
public function index($error = NULL) {
|
||||
//-----------------start untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->cek_shift_jam();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$cekanjungan = $this->m_anjungan->cekanjungan();
|
||||
//-----------------end untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'anjungan/v_anjungan';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->klinikasc();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$terlambat = $this->m_anjungan->anjunganterlambat();
|
||||
$this->load->vars('tr', $terlambat);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
|
||||
}
|
||||
|
||||
public function admin_anjungan(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
//-----------------start untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->cek_shift_jam();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$cekanjungan = $this->m_anjungan->cekanjungan();
|
||||
//-----------------end untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
|
||||
$data['title'] = 'Admin Anjungan';
|
||||
$data['main_content'] = 'anjungan/v_admin_anjungan';
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->klinikasc();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$terlambat = $this->m_anjungan->anjunganterlambat();
|
||||
$this->load->vars('tr', $terlambat);
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$fasttrack = $this->m_anjungan->batasallpasien();
|
||||
$this->load->vars('fs', $fasttrack);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->klinikasc();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function print_ulang($id,$ket){
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_print_ulang';
|
||||
$data['ket']=$ket;
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$fasttrack = $this->m_anjungan->cetakulang($id);
|
||||
$this->load->vars('cu', $fasttrack);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_print_ulang',$data);
|
||||
|
||||
}
|
||||
|
||||
public function sekarang($id,$shift,$pembayaran){
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_sekarang';
|
||||
$data['idklinik']=$id;
|
||||
$data['ket']="1";
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$sekarang = $this->m_anjungan->insert_sekarang($id,$shift,1,$pembayaran);
|
||||
|
||||
if($sekarang===FALSE){
|
||||
$this->session->set_flashdata('messagefalse', 'Anda gagal mendaftar, coba lagi!');
|
||||
redirect('index.php/ps_anjungan');
|
||||
}else{
|
||||
$this->load->model('m_anjungan');
|
||||
$getpas = $this->m_anjungan->datapengunjung($id);
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_sekarang',$data);
|
||||
//redirect('index.php/ps_anjungan');
|
||||
}
|
||||
}
|
||||
|
||||
public function print_pengantar($id,$ket){
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_pengantar';
|
||||
$data['ket']=$ket;
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$getpas = $this->m_anjungan->datapengunjungthis($id);
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_pengantar',$data);
|
||||
}
|
||||
|
||||
public function pesan(){
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_sekarang';
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->insert_pesan();
|
||||
|
||||
$idk = $this->input->post('idklinikpesan');
|
||||
$data['tglperiksa']=$this->input->post('tanggalpesan');
|
||||
$data['idklinik']=$idk;
|
||||
$data['ket']="2";
|
||||
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$getpas = $this->m_anjungan->datapengunjungpesan($idk,$this->input->post('tanggalpesan'),$this->input->post('shiftpesan'));
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_sekarang',$data);
|
||||
|
||||
//redirect('index.php/ps_anjungan');
|
||||
}
|
||||
|
||||
public function daftar_online(){
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_sekarang';
|
||||
$data['idklinik']=$this->input->post('klinik');
|
||||
$data['ket']="3";
|
||||
|
||||
$idk = $this->input->post('klinik');
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->insert_daftar_online();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$getpas = $this->m_anjungan->datapengunjung($idk);
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_sekarang',$data);
|
||||
//redirect('index.php/ps_anjungan');
|
||||
}
|
||||
|
||||
public function fasttrack(){
|
||||
$id=$this->input->post('idkliniksekarangFS');
|
||||
$shift=$this->input->post('shiftsekarangFS');
|
||||
$pembayaran=$this->input->post('pembayaranfs');
|
||||
|
||||
$data['title'] = 'Anjungan';
|
||||
$data['main_content'] = 'print/print_anjungan/p_sekarang';
|
||||
$data['idklinik']=$id;
|
||||
$data['ket']="4";
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->insert_sekarang($id,$shift,4,$pembayaran);
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$getpas = $this->m_anjungan->datapengunjung($id);
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_fasttrack',$data);
|
||||
}
|
||||
|
||||
function datashift_pesan($bulan,$tanggal,$tahun){
|
||||
$idk = $this->input->post('idk');
|
||||
$tanggalpesan = $tahun."-".$bulan."-".$tanggal;
|
||||
//$tanggalpesan = date("Y-m-d", strtotime($tanggalpesan));
|
||||
$jumshift;
|
||||
$jumquota;
|
||||
$jumpp=0;
|
||||
$jadwal;
|
||||
$jamshift;
|
||||
//---------------------start get data klinik--------------//
|
||||
$this->db->where('mk_id', $idk);
|
||||
$query_kl = $this->db->get('master_klinik');
|
||||
foreach ($query_kl->result() as $datklinik ){
|
||||
$jumshift=$datklinik->mk_shift;
|
||||
$jumquota=$datklinik->mk_quota;
|
||||
$jadwal=$datklinik->mk_jadwal;
|
||||
$jamshift=$datklinik->mk_jam_shift;
|
||||
}
|
||||
//---------------------end get data klinik--------------//
|
||||
|
||||
$pecahjamshift = explode("|",$jamshift);
|
||||
$numpecah = 0;
|
||||
|
||||
for($i=1;$i<=$jumshift;$i++){
|
||||
$jumpp=0;
|
||||
$aktif=0;
|
||||
$setaktifdb=0;
|
||||
$this->db->where('pp_tanggal_periksa', $tanggalpesan);
|
||||
$this->db->where('pp_klinik_id', $idk);
|
||||
$this->db->where('pp_shift', $i);
|
||||
$query_pp = $this->db->get('proses_pengunjung');
|
||||
$jumpp = $query_pp->num_rows();
|
||||
|
||||
//----------------start cek hari sekarang klinik buka atau tidak----------------//
|
||||
$hari = date("D", strtotime($tanggalpesan));
|
||||
switch($hari){
|
||||
case 'Sun':$hari_ini = "minggu";break;case 'Mon':$hari_ini = "senin";break;case 'Tue':$hari_ini = "selasa";break;
|
||||
case 'Wed':$hari_ini = "rabu";break;case 'Thu':$hari_ini = "kamis";break;case 'Fri':$hari_ini = "jumat";break;
|
||||
case 'Sat':$hari_ini = "sabtu";break;default:$hari_ini = "Tidak di ketahui";break;
|
||||
}
|
||||
$pecahjadwal = explode("|",$jadwal);
|
||||
$jumdat = count($pecahjadwal);
|
||||
for ($x = 0; $x <= $jumdat; $x++){
|
||||
if(isset($pecahjadwal[$x])){
|
||||
if($pecahjadwal[$x]==$hari_ini){$aktif=$aktif+1;}
|
||||
}
|
||||
}
|
||||
if($aktif==0){$setaktifdb=1;}
|
||||
//----------------end cek hari sekarang klinik buka atau tidak----------------//
|
||||
|
||||
if($jumpp>=$jumquota){
|
||||
$data[] = ['datashiftpesan'=>"<option disabled='' id='delshiftpesan$i' value=''>Shift $i penuh</option>"];
|
||||
}elseif($setaktifdb==1){
|
||||
$data[] = ['datashiftpesan'=>"<option disabled='' id='delshiftpesan$i' value=''>Klinik Tutup</option>"];
|
||||
}
|
||||
else{
|
||||
$data[] = ['datashiftpesan'=>"<option id='delshiftpesan$i' value='$i'>Shift $i ± Mulai Pukul $pecahjamshift[$numpecah] </option>"];
|
||||
}
|
||||
$numpecah++;
|
||||
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
function data_shift_klinik(){
|
||||
$id = $this->input->post('klinik');
|
||||
$query = $this->db->query("select * from master_klinik where mk_id='$id'");
|
||||
foreach ($query->result() as $row){
|
||||
$data[] = $row;
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------START ANTRIAN PENDAFTARAN 1--------------------------------//
|
||||
function info_anjungan(){
|
||||
$data['title'] = 'Antrian Pendaftaran';
|
||||
$data['main_content'] = 'anjungan/v_info_anjungan';
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->info_pengunjung();
|
||||
$this->load->vars('ip', $info_pengunjung);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
//-----------------start untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->cek_shift_jam();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$cekanjungan = $this->m_anjungan->cekanjungan();
|
||||
//-----------------end untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
//--------------------------------------------------------END ANTRIAN PENDAFTARAN--------------------------------//
|
||||
//--------------------------------------------------------START ANTRIAN PENDAFTARAN 2--------------------------------//
|
||||
function info_anjungan2(){
|
||||
$data['title'] = 'Antrian Pendaftaran';
|
||||
$data['main_content'] = 'anjungan/v_info_anjungan2';
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->info_pengunjung();
|
||||
$this->load->vars('ip', $info_pengunjung);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
//--------------------------------------------------------END ANTRIAN PENDAFTARAN--------------------------------//
|
||||
//--------------------------------------------------------START ANTRIAN PENDAFTARAN 2--------------------------------//
|
||||
function info_anjungan3(){
|
||||
$data['title'] = 'Antrian Pendaftaran';
|
||||
$data['main_content'] = 'anjungan/v_info_anjungan3';
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->info_pengunjung();
|
||||
$this->load->vars('ip', $info_pengunjung);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
//--------------------------------------------------------END ANTRIAN PENDAFTARAN--------------------------------//
|
||||
//--------------------------------------------------------START BARCODE------------------------------------------------//
|
||||
function barcode($barcode){
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->barcode($barcode);
|
||||
|
||||
redirect('index.php/ps_anjungan/admin_anjungan');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------END BARCODE------------------------------------------------//
|
||||
function proses_datang($id){
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->datang($id);
|
||||
redirect('index.php/ps_anjungan/admin_anjungan');
|
||||
}
|
||||
//--------------------------------------------------------START ANTRIAN KLINIK----------------------------------------------------------//
|
||||
function proses_bypass($id){
|
||||
$this->load->model('m_anjungan');
|
||||
$this->m_anjungan->bypass($id);
|
||||
redirect('index.php/ps_anjungan/admin_anjungan');
|
||||
}
|
||||
|
||||
function info_klinik(){
|
||||
$data['title'] = 'Antrian Klinik';
|
||||
$data['main_content'] = 'anjungan/v_info_klinik';
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->info_klinik();
|
||||
$this->load->vars('ip', $info_pengunjung);
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$info_panggil = $this->m_anjungan->panggilpasien();
|
||||
$this->load->vars('pg', $info_panggil);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
//-----------------start untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
$this->load->model('m_anjungan');
|
||||
$info_pengunjung = $this->m_anjungan->cek_shift_jam();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$cekanjungan = $this->m_anjungan->cekanjungan();
|
||||
//-----------------end untuk cek jam shift, jam shift, dan aktif klinik------------------//
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
//--------------------------------------------------------END ANTRIAN KLINIK----------------------------------------------------------//
|
||||
public function panggil_anjungan_null($idpp){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses_panggil_anjungan_null($idpp);
|
||||
|
||||
redirect('index.php/ps_anjungan/info_anjungan');
|
||||
}
|
||||
|
||||
public function panggil_admin_null($idpp){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses_panggil_null($idpp);
|
||||
|
||||
redirect('index.php/ps_anjungan/info_klinik');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
93
application/controllers/ps_fasttrack.php
Normal file
93
application/controllers/ps_fasttrack.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
//-------------ID fast track = 14
|
||||
|
||||
class Ps_fasttrack extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '14');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Fast Track';
|
||||
$data['main_content'] = 'fasttrack/v_fasttrack';
|
||||
//$data['main_content'] = 'maintenance';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_fasttrack');
|
||||
$fasttrack = $this->m_fasttrack->index();
|
||||
$this->load->vars('fs', $fasttrack);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function set_fasttrack() {
|
||||
//----start validate page tambah-------//
|
||||
//if($this->vartambah==null){redirect('index.php/ps_fasttrack');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('penanggungjawab','Nama Penanggung Jawab','required');
|
||||
$this->form_validation->set_rules('ket','Alasan Fast Track','required');
|
||||
$id = $this->input->post('idpengunjung');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Fast Track';
|
||||
$data['main_content'] = 'fasttrack/v_fasttrack';
|
||||
$this->load->model('m_fasttrack');
|
||||
$fasttrack = $this->m_fasttrack->index();
|
||||
$this->load->vars('fs', $fasttrack);
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_fasttrack');
|
||||
$this->m_fasttrack->setfastrack();
|
||||
|
||||
$this->load->model('m_anjungan');
|
||||
$fasttrack = $this->m_anjungan->cetakulang($id);
|
||||
$this->load->vars('cu', $fasttrack);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$getloket = $this->m_loket->index();
|
||||
$this->load->vars('lk', $getloket);
|
||||
|
||||
$this->load->view('print/print_anjungan/p_fasttrack2');
|
||||
|
||||
//$this->session->set_flashdata('message', 'Anda berhasil melakukan fast track');
|
||||
//redirect('index.php/ps_fasttrack');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
212
application/controllers/ps_hakakses.php
Normal file
212
application/controllers/ps_hakakses.php
Normal file
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
//-------------ID hak akses = 3
|
||||
|
||||
class Ps_hakakses extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '3');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Hak Akses';
|
||||
$data['main_content'] = 'setting/hakakses/v_hakakses';
|
||||
$data['error']=$error;
|
||||
$this->load->model('m_tipeuser');
|
||||
$hakakses = $this->m_tipeuser->index();
|
||||
$this->load->vars('ha', $hakakses);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function add() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Tipe User';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/hakakses/form_tipeuser';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk memproses penambahan dengan memanggil model
|
||||
public function prosesadd() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('namatipeuser','Nama Tipe User','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Tipe User';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/hakakses/form_tipeuser';
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_tipeuser');
|
||||
$this->m_tipeuser->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Tipe User baru');
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Tipe User';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/hakakses/form_tipeuser';
|
||||
$this->load->model('m_tipeuser');
|
||||
$hakakses = $this->m_tipeuser->edit($id);
|
||||
$this->load->vars('ha', $hakakses);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('namatipeuser','Nama Tipe User','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Tipe User';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/hakakses/form_tipeuser';
|
||||
$this->load->model('m_tipeuser');
|
||||
$hakakses = $this->m_tipeuser->edit($id);
|
||||
$this->load->vars('ha', $hakakses);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Tipe User');
|
||||
$this->load->model('m_tipeuser');
|
||||
$this->m_tipeuser->prosesedit();
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($id) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Tipe User';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'setting/hakakses/form_tipeuser';
|
||||
$this->load->model('m_tipeuser');
|
||||
$hakakses = $this->m_tipeuser->view($id);
|
||||
$this->load->vars('ha', $hakakses);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Tipe User');
|
||||
$this->load->model('m_tipeuser');
|
||||
$this->m_tipeuser->delete($id);
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
|
||||
//--------------------------------------------------HAK AKSES---------------------------------------------------------//
|
||||
public function edithakakses($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Hak Akses Menu';
|
||||
$data['actionform'] = 'prosesedithakakses';
|
||||
$data['main_content'] = 'setting/hakakses/form_hakakses';
|
||||
$data['iduserpost']=$id;
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->edit($id);
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_menu');
|
||||
$menu = $this->m_menu->urutan();
|
||||
$this->load->vars('mn', $menu);
|
||||
|
||||
$this->load->model('m_menu');
|
||||
$hakakses = $this->m_menu->hakakses($id);
|
||||
$this->load->vars('um', $hakakses);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data karyawan
|
||||
public function prosesedithakakses() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_hakakses');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->edit($id);
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_menu');
|
||||
$menu = $this->m_menu->index();
|
||||
$this->load->vars('mn', $menu);
|
||||
|
||||
$this->load->model('m_menu');
|
||||
$hakakses = $this->m_menu->hakakses($id);
|
||||
$this->load->vars('um', $hakakses);
|
||||
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit hakakses');
|
||||
$this->load->model('m_hakakses');
|
||||
$this->m_hakakses->prosesedithakakses();
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
156
application/controllers/ps_klinik.php
Normal file
156
application/controllers/ps_klinik.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
//-------------ID master klinik = 6
|
||||
|
||||
class Ps_klinik extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '6');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Master Klinik';
|
||||
$data['main_content'] = 'setting/klinik/v_klinik';
|
||||
$data['error']=$error;
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function add() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Klinik';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/klinik/form_klinik';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk memproses penambahan dengan memanggil model
|
||||
public function prosesadd() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Klinik','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Klinik';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/klinik/form_klinik';
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Klinik baru');
|
||||
redirect('index.php/ps_klinik');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Klinik';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/klinik/form_klinik';
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->edit($id);
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Klinik','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Klinik';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/klinik/form_klinik';
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->edit($id);
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Klinik');
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->prosesedit();
|
||||
redirect('index.php/ps_klinik');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($id) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Klinik';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'setting/klinik/form_klinik';
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->view($id);
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_klinik');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Klinik');
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->delete($id);
|
||||
redirect('index.php/ps_klinik');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
169
application/controllers/ps_klinik_admin.php
Normal file
169
application/controllers/ps_klinik_admin.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
//-------------ID Klinik Admin = 8
|
||||
|
||||
class Ps_klinik_admin extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '8');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Loket';
|
||||
$data['main_content'] = 'klinik/v_klinik_admin';
|
||||
$data['error']=$error;
|
||||
$data['quotabangkuklinik']=0;
|
||||
$data['shiftbuka']=0;
|
||||
$data['jumshift']=0;
|
||||
$data['idklinik']=0;
|
||||
$data['autoshift']=0;
|
||||
$data['namaklinik']="";
|
||||
|
||||
$idklinik=0;
|
||||
|
||||
$iduser = $this->session->userdata('s_ID_User');
|
||||
|
||||
//----------------set hari------------------//
|
||||
$hari = date("D");
|
||||
switch($hari){
|
||||
case 'Sun':$hari_ini = "Minggu";break;case 'Mon':$hari_ini = "Senin";break;case 'Tue':$hari_ini = "Selasa";break;
|
||||
case 'Wed':$hari_ini = "Rabu";break;case 'Thu':$hari_ini = "Kamis";break;case 'Fri':$hari_ini = "Jumat";break;
|
||||
case 'Sat':$hari_ini = "Sabtu";break;default:$hari_ini = "Tidak di ketahui";break;
|
||||
}
|
||||
//----------------set bulan------------------//
|
||||
$bulan = date("m");
|
||||
switch($bulan){
|
||||
case '01':$bulan_ini = "Januari";break;case '02':$bulan_ini = "Februari";break;case '03':$bulan_ini = "Maret";break;
|
||||
case '04':$bulan_ini = "April";break;case '05':$bulan_ini = "Mei";break;case '06':$bulan_ini = "Juni";break;
|
||||
case '07':$bulan_ini = "Juli";break;case '08':$bulan_ini = "Agustus";break;case '09':$bulan_ini = "September";break;
|
||||
case '10':$bulan_ini = "Oktober";break;case '11':$bulan_ini = "November";break;case '12':$bulan_ini = "Desember";break;
|
||||
|
||||
default:$bulan_ini = "Tidak di ketahui";break;
|
||||
}
|
||||
|
||||
$this->db->join('master_klinik', 'mk_id = mu_klinik_id');
|
||||
$this->db->where('mu_id', $iduser);
|
||||
$user = $this->db->get('master_user');
|
||||
foreach ($user->result() as $datuser){
|
||||
$data['title'] = "KLINIK <code>".$datuser->mk_nama."</code> | ".$hari_ini.", ".date("d")." ".$bulan_ini." ".date("Y");
|
||||
$data['quotabangkuklinik']=$datuser->mk_quota_bangku;
|
||||
$data['shiftbuka']=$datuser->mk_shift_buka;
|
||||
$data['jumshift']=$datuser->mk_shift;
|
||||
$data['idklinik']=$datuser->mk_id;
|
||||
$data['autoshift']=$datuser->mk_auto_shift;
|
||||
$idklinik=$datuser->mk_id;
|
||||
$data['namaklinik']=$datuser->mk_nama;
|
||||
}
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$infopengunjung = $this->m_klinik->infopengunjung($idklinik);
|
||||
$this->load->vars('ip', $infopengunjung);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('kl', $klinik);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$pengunjung = $this->m_klinik->pengunjungklinik($idklinik);
|
||||
$this->load->vars('pk', $pengunjung);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$datpeng = $this->m_klinik->datapengunjung($idklinik);
|
||||
$this->load->vars('dp', $datpeng);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function panggilpengunjung($jumlah,$klinik){
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->panggil($jumlah,$klinik);
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Memanggil Pengunjung Sebanyak '.$jumlah.' Orang, Tunggu Beberapa Saat');
|
||||
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}
|
||||
|
||||
public function proses_admin($pengunjung, $kode){
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->proses($pengunjung, $kode);
|
||||
if($kode==6){
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Melakukan Proses Datang');
|
||||
}elseif($kode==7){
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Melakukan Proses');
|
||||
}elseif($kode==8){
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Melakukan Proses Pending');
|
||||
}elseif($kode==9){
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Melakukan Proses Selesai');
|
||||
}
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}
|
||||
|
||||
public function ubahklinik(){
|
||||
|
||||
$ket = $this->input->post('ket');//ket 1 = Ubah Klinik, ket 2 = Konsul
|
||||
|
||||
if($ket==1){
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->ubahklinik();
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Mengubah Klinik Pengunjung');
|
||||
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}else{
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->konsul();
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Melakukan Konsultasi');
|
||||
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function autoshift($id,$kode){
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->autoshift($id,$kode);
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Mengubah Otomatis Shift');
|
||||
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}
|
||||
|
||||
public function aktif($id){
|
||||
$this->load->model('m_klinik');
|
||||
$this->m_klinik->aktif($id);
|
||||
$this->session->set_flashdata('message', 'Anda Berhasil Mengaktifkan kembali pasien');
|
||||
|
||||
redirect('index.php/ps_klinik_admin');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
103
application/controllers/ps_listpasien.php
Normal file
103
application/controllers/ps_listpasien.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
//-------------ID list pasien = 20
|
||||
|
||||
class Ps_listpasien extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '20');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'List Pasien';
|
||||
$data['main_content'] = 'listpasien/v_listpasien';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_listpasien');
|
||||
$listpasien = $this->m_listpasien->index();
|
||||
$this->load->vars('lp', $listpasien);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function search() {
|
||||
$data['title'] = 'List Pasien';
|
||||
$data['main_content'] = 'listpasien/v_listpasien';
|
||||
|
||||
$data['tglset'] = $this->input->post('tglperiksa');
|
||||
$data['ketset'] = $this->input->post('ketkunjungan');
|
||||
|
||||
$this->load->model('m_listpasien');
|
||||
$listpasien = $this->m_listpasien->search();
|
||||
$this->load->vars('lp', $listpasien);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function laporanpasien() {
|
||||
$data['title'] = 'List Pasien';
|
||||
$data['main_content'] = 'listpasien/v_laporanpasien';
|
||||
|
||||
$data['bulanset'] = $this->input->post('bulankunjungan');
|
||||
$data['tahunset'] = $this->input->post('tahunkunjungan');
|
||||
|
||||
$this->load->model('m_listpasien');
|
||||
$listpasien = $this->m_listpasien->laporanpasien();
|
||||
$this->load->vars('lp', $listpasien);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function laporanpasienperklinik() {
|
||||
$data['title'] = 'List Pasien';
|
||||
$data['main_content'] = 'listpasien/v_laporanpasienperklinik';
|
||||
|
||||
$data['bulanset'] = $this->input->post('bulankunjungan');
|
||||
$data['tahunset'] = $this->input->post('tahunkunjungan');
|
||||
|
||||
//$this->load->model('m_listpasien');
|
||||
//$listpasien = $this->m_listpasien->laporanpasien();
|
||||
//$this->load->vars('lp', $listpasien);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
184
application/controllers/ps_loket.php
Normal file
184
application/controllers/ps_loket.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
//-------------ID master loket = 5
|
||||
|
||||
class Ps_loket extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '5');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Master Loket';
|
||||
$data['main_content'] = 'setting/loket/v_loket';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$masterloket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $masterloket);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function add() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Loket';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/loket/form_loket';
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk memproses penambahan dengan memanggil model
|
||||
public function prosesadd() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Loket','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Loket';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/loket/form_loket';
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Loket baru');
|
||||
redirect('index.php/ps_loket');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Loket';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/loket/form_loket';
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$masterloket = $this->m_loket->edit($id);
|
||||
$this->load->vars('ml', $masterloket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Loket','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Loket';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/loket/form_loket';
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$masterloket = $this->m_loket->edit($id);
|
||||
$this->load->vars('ml', $masterloket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Loket');
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->prosesedit();
|
||||
redirect('index.php/ps_loket');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($id) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Loket';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'setting/loket/form_loket';
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$masterloket = $this->m_loket->view($id);
|
||||
$this->load->vars('ml', $masterloket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$masterklinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $masterklinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_loket');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Loket');
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->delete($id);
|
||||
redirect('index.php/ps_loket');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
283
application/controllers/ps_loket_admin.php
Normal file
283
application/controllers/ps_loket_admin.php
Normal file
@@ -0,0 +1,283 @@
|
||||
<?php
|
||||
//-------------ID Loket Admin = 7
|
||||
|
||||
class Ps_loket_admin extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '7');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] ='Loket';
|
||||
$data['main_content'] ='loket/v_loket_admin';
|
||||
$data['error'] =$error;
|
||||
$data['klinik'] ="";
|
||||
$data['quotaloket'] =0;
|
||||
|
||||
$data['idklinik'] ="";
|
||||
$data['shiftbuka'] ="";
|
||||
$data['namaklinik'] ="";
|
||||
$data['aktifklinik'] ="";
|
||||
$data['namaloket'] ="";
|
||||
$data['idloket'] ="";
|
||||
$data['shiftpenuh'] ="";
|
||||
$data['online'] ="";
|
||||
|
||||
|
||||
$iduser = $this->session->userdata('s_ID_User');
|
||||
$this->db->join('master_loket', 'ml_id = mu_loket_id');
|
||||
$this->db->where('mu_id', $iduser);
|
||||
$user = $this->db->get('master_user');
|
||||
foreach ($user->result() as $datuser){
|
||||
$klinikpecah = explode(",",$datuser->ml_pelayanan);
|
||||
$pembayaran = $datuser->ml_pembayaran;
|
||||
$online = $datuser->ml_online;
|
||||
$hasilklinik = "";
|
||||
$idklinik = "";
|
||||
$shiftbuka = "";
|
||||
$namaklinik = "";
|
||||
$aktifklinik = "";
|
||||
$jumshift = "";
|
||||
$shiftpenuh = "";
|
||||
$quotaklinik = "";
|
||||
$jumlah = count($klinikpecah);
|
||||
|
||||
for($i=0;$i<$jumlah;$i++){
|
||||
$this->db->where('mk_id', $klinikpecah[$i]);
|
||||
$klinik = $this->db->get('master_klinik');
|
||||
foreach ($klinik->result() as $datklinik){
|
||||
if($jumlah<=5){$hasilklinik = $hasilklinik."<code>".$datklinik->mk_nama."</code> ";}
|
||||
$idklinik = $idklinik.$datklinik->mk_id."|";
|
||||
$shiftbuka = $shiftbuka.$datklinik->mk_shift_buka."|";
|
||||
$namaklinik = $namaklinik.$datklinik->mk_nama."|";
|
||||
$aktifklinik = $aktifklinik.$datklinik->mk_aktif."|";
|
||||
$jumshift = $jumshift.$datklinik->mk_shift."|";
|
||||
$shiftpenuh = $shiftpenuh.$datklinik->mk_shift_penuh."|";
|
||||
$quotaklinik = $quotaklinik.$datklinik->mk_quota."|";
|
||||
}
|
||||
}
|
||||
|
||||
$data['idklinik'] = $idklinik;
|
||||
$data['shiftbuka'] = $shiftbuka;
|
||||
$data['namaklinik'] = $namaklinik;
|
||||
$data['aktifklinik']= $aktifklinik;
|
||||
$data['jumshift'] = $jumshift;
|
||||
$data['namaloket'] = $datuser->ml_nama;
|
||||
$data['idloket'] = $datuser->ml_id;
|
||||
$data['shiftpenuh'] = $shiftpenuh;
|
||||
$data['quotaklinik']= $quotaklinik;
|
||||
$data['pembayaran'] = $pembayaran;
|
||||
|
||||
$data['online'] = $online;
|
||||
|
||||
$data['quotaloket']=$datuser->ml_quota_bangku;
|
||||
$data['klinik']=$datuser->ml_pelayanan;
|
||||
|
||||
//----------------set hari------------------//
|
||||
$hari = date("D");
|
||||
switch($hari){
|
||||
case 'Sun':$hari_ini = "Minggu";break;case 'Mon':$hari_ini = "Senin";break;case 'Tue':$hari_ini = "Selasa";break;
|
||||
case 'Wed':$hari_ini = "Rabu";break;case 'Thu':$hari_ini = "Kamis";break;case 'Fri':$hari_ini = "Jumat";break;
|
||||
case 'Sat':$hari_ini = "Sabtu";break;default:$hari_ini = "Tidak di ketahui";break;
|
||||
}
|
||||
//----------------set bulan------------------//
|
||||
$bulan = date("m");
|
||||
switch($bulan){
|
||||
case '01':$bulan_ini = "Januari";break;case '02':$bulan_ini = "Februari";break;case '03':$bulan_ini = "Maret";break;
|
||||
case '04':$bulan_ini = "April";break;case '05':$bulan_ini = "Mei";break;case '06':$bulan_ini = "Juni";break;
|
||||
case '07':$bulan_ini = "Juli";break;case '08':$bulan_ini = "Agustus";break;case '09':$bulan_ini = "September";break;
|
||||
case '10':$bulan_ini = "Oktober";break;case '11':$bulan_ini = "November";break;case '':$bulan_ini = "Desember";break;
|
||||
|
||||
default:$bulan_ini = "Tidak di ketahui";break;
|
||||
}
|
||||
|
||||
$data['title'] = $datuser->ml_nama." | ".$hari_ini.", ".date("d")." ".$bulan_ini." ".date("Y")." - Pelayanan : ".$hasilklinik;
|
||||
}
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$infopengunjung = $this->m_loket->infopengunjung();
|
||||
$this->load->vars('ip', $infopengunjung);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$pengunjungklinik = $this->m_loket->pengunjungklinik();
|
||||
$this->load->vars('pk', $pengunjungklinik);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$pengunjung = $this->m_loket->pengunjung();
|
||||
$this->load->vars('pg', $pengunjung);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$terlambat = $this->m_loket->kunjunganterlambat();
|
||||
$this->load->vars('tr', $terlambat);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('kl', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function panggilpengunjung($jumlah){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->panggil($jumlah);
|
||||
|
||||
$this->session->set_flashdata('message', 'Anda berhasil memanggil pengunjung sebanyak '.$jumlah.' orang, tunggu beberapa saat');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
public function proses_admin($pengunjung, $kode){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses($pengunjung, $kode);
|
||||
if($kode==2){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil melakukan proses');
|
||||
}elseif($kode==3){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil melakukan proses pending');
|
||||
}elseif($kode==4){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil selesai');
|
||||
}
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
public function barcode($pengunjung){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->barcode($pengunjung);
|
||||
$this->session->set_flashdata('message', 'Anda berhasil melakukan tindakan barcode');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
public function terlambat($pengunjung){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->terlambat($pengunjung);
|
||||
$this->session->set_flashdata('message', 'Anda berhasil melakukan tindakan terlambat');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
public function aktif($pengunjung){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->aktif($pengunjung);
|
||||
$this->session->set_flashdata('message', 'Anda berhasil melakukan tindakan aktif');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
public function ubahklinik(){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->ubahklinik();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengubah klinik pengunjung');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
|
||||
public function proses_pengunjung(){
|
||||
$this->load->model('m_loket');
|
||||
$inputpengunjung = $this->m_loket->proses_pengunjung();
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$pengunjung = $this->m_loket->data_pengunjung($this->input->post('idpp_proses'));
|
||||
|
||||
if($inputpengunjung===FALSE){
|
||||
$this->session->set_flashdata('messagefalse', 'Anda gagal menyelesaikan pasien, coba lagi!');
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}else{
|
||||
$data['title'] = 'Loket Admin';
|
||||
$data['main_content'] = 'print/print_loket/p_tiket_baru';
|
||||
$data['idpp']=$this->input->post('idpp_proses');
|
||||
$data['namaloket']=$this->input->post('loket_proses');
|
||||
|
||||
$this->load->vars('pp', $pengunjung);
|
||||
$this->session->set_flashdata('message', 'Anda berhasil selesai');
|
||||
|
||||
//redirect('index.php/ps_loket_admin');
|
||||
|
||||
$this->load->view('print/print_loket/p_tiket_baru',$data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function proses_pengunjung_berkas($id,$loket){
|
||||
$data['title'] = 'Loket Admin';
|
||||
$data['main_content'] = 'print/print_loket/p_tiket_baru_berkas';
|
||||
$data['namaloket']=$loket;
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$pengunjung = $this->m_loket->data_pengunjung($id);
|
||||
$this->load->vars('pp', $pengunjung);
|
||||
|
||||
$this->load->view('print/print_loket/p_tiket_baru_berkas',$data);
|
||||
}
|
||||
|
||||
public function cetakulang($id){
|
||||
$data['title'] = 'Loket Admin';
|
||||
$data['main_content'] = 'print/print_loket/p_tiket_baru';
|
||||
$data['idpp']=$id;
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$pengunjung = $this->m_loket->data_pengunjung($id);
|
||||
$this->load->vars('pp', $pengunjung);
|
||||
|
||||
$this->load->view('print/print_loket/p_ulang_tiket_baru',$data);
|
||||
}
|
||||
|
||||
public function panggil_admin($idprt, $idpp, $loket){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses_panggil($idpp, $loket);
|
||||
//$this->session->set_flashdata('message', 'Anda berhasil memanggil tunggu beberapa saat');
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
|
||||
public function panggil_admin_awal($idprt, $idpp, $loket){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses_panggil($idpp, $loket);
|
||||
|
||||
$this->proses_admin($idprt, "2");
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
|
||||
public function panggil_anjungan_admin($idprt, $idpp){
|
||||
$this->load->model('m_loket');
|
||||
$this->m_loket->proses_panggil_anjungan($idpp);
|
||||
|
||||
redirect('index.php/ps_loket_admin');
|
||||
}
|
||||
|
||||
// public function panggil_admin_null($idpp){
|
||||
// $this->load->model('m_loket');
|
||||
// $this->m_loket->proses_panggil_null($idpp);
|
||||
//
|
||||
// redirect('index.php/ps_anjungan/info_klinik');
|
||||
// }
|
||||
}
|
||||
|
||||
?>
|
||||
168
application/controllers/ps_pasien.php
Normal file
168
application/controllers/ps_pasien.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
//-------------ID pasien = 18
|
||||
|
||||
class Ps_pasien extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '18');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Data Pasien';
|
||||
$data['main_content'] = 'pasien/v_pasien';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$ppdata = $this->m_pasien->index();
|
||||
$this->load->vars('mp', $ppdata);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_pasien');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Pasien';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$ppdata = $this->m_pasien->edit($id);
|
||||
$this->load->vars('mp', $ppdata);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_pasien');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
// $this->load->library('form_validation');
|
||||
// $this->form_validation->set_rules('klinik','Klinik','required');
|
||||
// $this->form_validation->set_rules('shift','Shift Periksa','required');
|
||||
// $this->form_validation->set_rules('pembayaran','Jenis Pembayaran','required');
|
||||
//
|
||||
// if($this->form_validation->run()==FALSE){
|
||||
// $data['title'] = 'Edit Pasien';
|
||||
// $data['actionform'] = 'prosesedit';
|
||||
// $data['main_content'] = 'pasien/form_pasien';
|
||||
//
|
||||
// $this->load->model('m_pasien');
|
||||
// $ppdata = $this->m_pasien->edit($id);
|
||||
// $this->load->vars('mp', $ppdata);
|
||||
//
|
||||
// $this->load->model('m_klinik');
|
||||
// $klinik = $this->m_klinik->index();
|
||||
// $this->load->vars('mk', $klinik);
|
||||
//
|
||||
// $this->load->view('includes/template', $data);
|
||||
// }
|
||||
// else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pasien');
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->prosesedit();
|
||||
redirect('index.php/ps_pasien');
|
||||
// }
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($id) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_pasien');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Pasien';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$ppdata = $this->m_pasien->edit($id);
|
||||
$this->load->vars('mp', $ppdata);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
// function delete($id) {
|
||||
// //----start validate page delete-------//
|
||||
// if($this->vardelete==null){redirect('index.php/ps_pasien');}
|
||||
// //----end validate page delete---------//
|
||||
// $this->session->set_flashdata('message', 'Anda berhasil menghapus pasien');
|
||||
// $this->load->model('m_paien');
|
||||
// $this->m_paien->delete($id);
|
||||
// redirect('index.php/ps_pasien');
|
||||
// }
|
||||
|
||||
function datashift(){
|
||||
$idk = $this->input->post('idklinik');
|
||||
$jumshift;
|
||||
$jamshift;
|
||||
//---------------------start get data klinik--------------//
|
||||
$this->db->where('mk_id', $idk);
|
||||
$query_kl = $this->db->get('master_klinik');
|
||||
foreach ($query_kl->result() as $datklinik ){
|
||||
$jumshift=$datklinik->mk_shift;
|
||||
$jamshift=$datklinik->mk_jam_shift;
|
||||
}
|
||||
//---------------------end get data klinik--------------//
|
||||
|
||||
$pecahjamshift = explode("|",$jamshift);
|
||||
$numpecah = 0;
|
||||
|
||||
for($i=1;$i<=$jumshift;$i++){
|
||||
$data[] = ['datashift'=>"<option value='$i'>Shift $i ± Mulai Pukul $pecahjamshift[$numpecah] </option>"];
|
||||
$numpecah++;
|
||||
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
164
application/controllers/ps_ranap_admin.php
Normal file
164
application/controllers/ps_ranap_admin.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
//-------------ID loket ranap admin = 23
|
||||
|
||||
class Ps_ranap_admin extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '23');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'Ranap Admin';
|
||||
$data['main_content'] = 'ranap/v_ranapadmin';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$loketranap = $this->m_loketranap->index();
|
||||
$this->load->vars('rn', $loketranap);
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$loketsearch = $this->m_loketranap->searchloket();
|
||||
$this->load->vars('sl', $loketsearch);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function prosesadd() {
|
||||
|
||||
$no_antrian;
|
||||
$hasil_nomor = "";
|
||||
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
||||
$this->db->order_by('ppr_nomor_antrian', 'ASC');
|
||||
//$this->db->where('ppr_tanggal_periksa', date("Y-m-d"));
|
||||
$query = $this->db->get('proses_pengunjung_ranap');
|
||||
foreach ($query->result() as $datpengunjung){
|
||||
$no_antrian = $datpengunjung->ppr_nomor_antrian;
|
||||
}
|
||||
|
||||
if(isset($no_antrian)){
|
||||
$hasil_nomor = $no_antrian+1;
|
||||
$nomjum = strlen($hasil_nomor);$nol="";
|
||||
if($nomjum=="1"){$nol="00";}
|
||||
elseif($nomjum=="2"){$nol="0";}
|
||||
$hasil_nomor=$nol.$hasil_nomor;
|
||||
}else {
|
||||
$hasil_nomor="001";
|
||||
}
|
||||
|
||||
$insert = array(
|
||||
'ppr_nomor_antrian' => $hasil_nomor,
|
||||
'ppr_tanggal_periksa' => date("Y-m-d H:i:s"),
|
||||
'ppr_status' => "0",
|
||||
);
|
||||
$this->db->insert('proses_pengunjung_ranap', $insert);
|
||||
$last_insert_id = $this->db->insert_id();
|
||||
|
||||
redirect('index.php/ps_ranap_admin/print_ranap/'.$last_insert_id);
|
||||
}
|
||||
|
||||
public function print_ranap($id){
|
||||
$data['title'] = 'Ranap';
|
||||
$data['main_content'] = 'print/print_ranap/print_ranap';
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$getpas = $this->m_loketranap->datapengunjung($id);
|
||||
$this->load->vars('dp', $getpas);
|
||||
|
||||
$this->load->view('print/print_ranap/print_ranap',$data);
|
||||
}
|
||||
|
||||
public function next(){
|
||||
$pengunjung="";
|
||||
|
||||
$this->db->where('ppr_status', "0");
|
||||
$this->db->where('ppr_loket is NULL', NULL, TRUE);
|
||||
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
||||
$this->db->order_by('ppr_tanggal_periksa', 'DESC');
|
||||
$query = $this->db->get('proses_pengunjung_ranap');
|
||||
foreach ($query->result() as $datpengunjung){
|
||||
$pengunjung = $datpengunjung->ppr_id;
|
||||
}
|
||||
|
||||
$update = array(
|
||||
'ppr_loket' => $this->session->userdata('s_loket'),
|
||||
'ppr_panggil' => date("Y-m-d H:i:s"),
|
||||
'ppr_callsound' => date("Y-m-d H:i:s"),
|
||||
'ppr_callstatus'=> "1",
|
||||
'ppr_status' => "1",
|
||||
);
|
||||
$this->db->where('ppr_id', $pengunjung);
|
||||
$this->db->update('proses_pengunjung_ranap', $update);
|
||||
|
||||
redirect('index.php/ps_ranap_admin');
|
||||
}
|
||||
|
||||
public function selesai($id){
|
||||
$update = array(
|
||||
'ppr_loket' => null,
|
||||
'ppr_callsound' => null,
|
||||
'ppr_status' => "3",
|
||||
);
|
||||
$this->db->where('ppr_id', $id);
|
||||
$this->db->update('proses_pengunjung_ranap', $update);
|
||||
|
||||
redirect('index.php/ps_ranap_admin');
|
||||
}
|
||||
|
||||
public function callsound($id){
|
||||
$update = array(
|
||||
//'ppr_panggil' => date("Y-m-d H:i:s"),
|
||||
'ppr_callsound' => date("Y-m-d H:i:s"),
|
||||
'ppr_callstatus'=> "1",
|
||||
);
|
||||
$this->db->where('ppr_id', $id);
|
||||
$this->db->update('proses_pengunjung_ranap', $update);
|
||||
|
||||
redirect('index.php/ps_ranap_admin');
|
||||
}
|
||||
|
||||
public function pending($id){
|
||||
$update = array(
|
||||
'ppr_loket' => null,
|
||||
'ppr_callsound' => null,
|
||||
'ppr_status' => "2",
|
||||
);
|
||||
$this->db->where('ppr_id', $id);
|
||||
$this->db->update('proses_pengunjung_ranap', $update);
|
||||
|
||||
redirect('index.php/ps_ranap_admin');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
140
application/controllers/ps_screen.php
Normal file
140
application/controllers/ps_screen.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
//-------------ID screen = 19
|
||||
|
||||
class Ps_screen extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
//redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '19');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
//redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
$data['title'] = 'Screen';
|
||||
$data['main_content'] = 'setting/screen/v_screen';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_screen');
|
||||
$screen = $this->m_screen->index();
|
||||
$this->load->vars('ms', $screen);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
|
||||
function info_klinik_split($layar){
|
||||
$data['title'] = 'Antrian Klinik Layar '.$layar;
|
||||
$data['main_content'] = 'screen/v_info_klinik_split';
|
||||
|
||||
$this->load->model('m_screen');
|
||||
$info_pp = $this->m_screen->info_pp($layar);
|
||||
$this->load->vars('ip', $info_pp);
|
||||
|
||||
$this->load->model('m_screen');
|
||||
$klinik = $this->m_screen->master_klinik($layar);
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
|
||||
public function edit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_screen');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Screen';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/screen/form_screen';
|
||||
//$data['ketscr'] = $ketscr;
|
||||
|
||||
$this->load->model('m_screen');
|
||||
$screen = $this->m_screen->index();
|
||||
$this->load->vars('ms', $screen);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_screen');}
|
||||
//----end validate page edit---------//
|
||||
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Screen');
|
||||
$this->load->model('m_screen');
|
||||
$this->m_screen->prosesedit();
|
||||
redirect('index.php/ps_screen');
|
||||
}
|
||||
|
||||
public function view() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_screen');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'View Screen';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'setting/screen/form_screen';
|
||||
|
||||
$this->load->model('m_screen');
|
||||
$screen = $this->m_screen->index();
|
||||
$this->load->vars('ms', $screen);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------START INFO LOKET-----------------------------------------------------------//
|
||||
public function screenloket($loket){
|
||||
$data['title'] = 'Loket '.$loket;
|
||||
$data['main_content'] = 'screen/v_info_loket';
|
||||
|
||||
$this->db->where('ml_id', $loket);
|
||||
$datlok = $this->db->get('master_loket');
|
||||
foreach ($datlok->result() as $datuser){
|
||||
$data['klinik']=$datuser->ml_pelayanan;
|
||||
$data['pembayaran'] = $datuser->ml_pembayaran;
|
||||
}
|
||||
|
||||
$data['idloket']=$loket;
|
||||
$this->load->model('m_screen');
|
||||
$pengunjung = $this->m_screen->pengunjung($loket);
|
||||
$this->load->vars('pg', $pengunjung);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
}
|
||||
//-------------------------------------------------------END INFO LOKET-----------------------------------------------------------//
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
62
application/controllers/ps_screenranap.php
Normal file
62
application/controllers/ps_screenranap.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
//-------------ID Anjungan = 10
|
||||
|
||||
class Ps_screenranap extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
|
||||
$data['title'] = 'Screen Ranap';
|
||||
$data['main_content'] = 'screen/v_ranap';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$datloket = $this->m_loketranap->dataloket();
|
||||
$this->load->vars('dl', $datloket);
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$datpanggil = $this->m_loketranap->datapanggil();
|
||||
$this->load->vars('dp', $datpanggil);
|
||||
|
||||
// $this->load->model('m_loketranap');
|
||||
// $datsetpang = $this->m_loketranap->datasetpang();
|
||||
// $this->load->vars('dsp', $datsetpang);
|
||||
|
||||
$this->load->model('m_loketranap');
|
||||
$datpangsuara = $this->m_loketranap->datapanggilsuara();
|
||||
$this->load->vars('dps', $datpangsuara);
|
||||
//
|
||||
// $this->load->model('m_anjungan');
|
||||
// $terlambat = $this->m_anjungan->anjunganterlambat();
|
||||
// $this->load->vars('tr', $terlambat);
|
||||
|
||||
$this->load->view('includes3/template', $data);
|
||||
|
||||
}
|
||||
|
||||
public function set_null($id){
|
||||
$update = array(
|
||||
//'ppr_loket' => null,
|
||||
'ppr_callstatus' => null,
|
||||
//'ppr_status' => "2",
|
||||
);
|
||||
$this->db->where('ppr_id', $id);
|
||||
$this->db->update('proses_pengunjung_ranap', $update);
|
||||
|
||||
redirect('index.php/ps_screenranap');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
230
application/controllers/ps_userlogin.php
Normal file
230
application/controllers/ps_userlogin.php
Normal file
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
//-------------ID user login = 4
|
||||
|
||||
class Ps_userlogin extends CI_Controller {
|
||||
|
||||
//-----------start variables for check action access----------//
|
||||
public $vartambah = null;
|
||||
public $varedit = null;
|
||||
public $vardelete = null;
|
||||
public $varview = null;
|
||||
//-----------start variables for check action access----------//
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
$this->load->helper(array('form', 'date'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser'));
|
||||
$this->db->where('mum_menu_id', '4');
|
||||
$cekMenu = $this->db->get('master_user_menu');
|
||||
$rowcount = $cekMenu->num_rows();
|
||||
if($rowcount==0){
|
||||
redirect('index.php');
|
||||
}else{
|
||||
foreach ($cekMenu->result() as $cm)
|
||||
{
|
||||
$this->vartambah=$cm->mum_tambah;
|
||||
$this->varedit=$cm->mum_ubah;
|
||||
$this->vardelete=$cm->mum_hapus;
|
||||
$this->varview=$cm->mum_lihat;
|
||||
}
|
||||
}
|
||||
//--------------end check access this form page-------------//
|
||||
}
|
||||
|
||||
public function index($error = NULL) {
|
||||
$data['title'] = 'User Login';
|
||||
$data['main_content'] = 'setting/userlogin/v_userlogin';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_userlogin');
|
||||
$userlogin = $this->m_userlogin->index();
|
||||
$this->load->vars('ul', $userlogin);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function add() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah User Login';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/userlogin/form_userlogin';
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->index();
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk memproses penambahan dengan memanggil model
|
||||
public function prosesadd() {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('namauser','Nama User','required');
|
||||
$this->form_validation->set_rules('passworduser','Password User','required');
|
||||
$this->form_validation->set_rules('repassworduser', 'Retype Password', 'required|matches[passworduser]');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah User Login';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'setting/userlogin/form_userlogin';
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->index();
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_userlogin');
|
||||
$this->m_userlogin->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan user login baru');
|
||||
redirect('index.php/ps_userlogin');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit User Login';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/userlogin/form_userlogin';
|
||||
|
||||
$this->load->model('m_userlogin');
|
||||
$userlogin = $this->m_userlogin->edit($id);
|
||||
$this->load->vars('ul', $userlogin);
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->index();
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//funsi untuk memproses update data
|
||||
public function prosesedit() {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$setpass = $this->input->post('passworduser');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('namauser','Nama User','required');
|
||||
if(!empty($setpass)){
|
||||
$this->form_validation->set_rules('passworduser','Password User','required');
|
||||
$this->form_validation->set_rules('repassworduser', 'Retype Password', 'required|matches[passworduser]');
|
||||
}
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit User Login';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'setting/userlogin/form_userlogin';
|
||||
|
||||
$this->load->model('m_userlogin');
|
||||
$userlogin = $this->m_userlogin->edit($id);
|
||||
$this->load->vars('ul', $userlogin);
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->index();
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit User Login');
|
||||
$this->load->model('m_userlogin');
|
||||
$this->m_userlogin->prosesedit();
|
||||
redirect('index.php/ps_userlogin');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($id) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View User Login';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'setting/userlogin/form_userlogin';
|
||||
|
||||
$this->load->model('m_userlogin');
|
||||
$userlogin = $this->m_userlogin->edit($id);
|
||||
$this->load->vars('ul', $userlogin);
|
||||
|
||||
$this->load->model('m_tipeuser');
|
||||
$tipeuser = $this->m_tipeuser->index();
|
||||
$this->load->vars('tu', $tipeuser);
|
||||
|
||||
$this->load->model('m_loket');
|
||||
$loket = $this->m_loket->index();
|
||||
$this->load->vars('ml', $loket);
|
||||
|
||||
$this->load->model('m_klinik');
|
||||
$klinik = $this->m_klinik->index();
|
||||
$this->load->vars('mk', $klinik);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_userlogin');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus User Login');
|
||||
$this->load->model('m_userlogin');
|
||||
$this->m_userlogin->delete($id);
|
||||
redirect('index.php/ps_userlogin');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
35
application/controllers/welcome.php
Normal file
35
application/controllers/welcome.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) {
|
||||
exit('No direct script access allowed');
|
||||
}
|
||||
|
||||
class Welcome extends CI_Controller
|
||||
{
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->check_isvalidated();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'App Antrian RSSA';
|
||||
$data['main_content'] = 'home/v_home';
|
||||
|
||||
$this->load->model('m_listpasien');
|
||||
$listpasien = $this->m_listpasien->datenow();
|
||||
$this->load->vars('lp', $listpasien);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
}
|
||||
public function do_logout(){
|
||||
$this->session->sess_destroy();
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user