add rssa-pintar to git
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
use chriskacerguis\RestServer\RestController;
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Api_rssa extends RestController
|
||||
{
|
||||
var $module = 'api/login'; //ini nama module
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
Modules::run('security/common_security', $this->module);
|
||||
}
|
||||
public function index_get()
|
||||
{
|
||||
|
||||
//$this->api_login("meninjar@simrs", "dibawahmejasaya");
|
||||
$this->api_connect("pasien", "Y1hLd2tUeTdBSGt6c05sOWxoWmVwV1B6SllkYVhZaHBlTXpJZWNxUw==", "10026543");
|
||||
exit;
|
||||
//$data = $this->db->get('master_user')->result();
|
||||
$array_query = [
|
||||
'select' => 'master_user.*',
|
||||
'from' => 'master_user',
|
||||
'order_by' => 'master_user.mu_id, ASC'
|
||||
];
|
||||
$get_all_data = Modules::run('database/get', $array_query)->result();
|
||||
|
||||
$get_data = Modules::run('database/get', ['from' => 'master_user', 'order_by' => 'mu_id'])->result();
|
||||
//$data = 'Data Berhasil Load Data';
|
||||
$this->response($get_data, RestController::HTTP_OK);
|
||||
}
|
||||
|
||||
public function login_post()
|
||||
{
|
||||
$request = $this->post();
|
||||
$response = null;
|
||||
$method = $this->_detect_method();
|
||||
|
||||
try {
|
||||
$username = isset($request['username']) ? $request['username'] : '';
|
||||
$password = isset($request['password']) ? $request['password'] : '';
|
||||
|
||||
if ($username == "" || $password == "") {
|
||||
$response = response_error("Username dan password harus diisi");
|
||||
$this->set_response($response, RestController::HTTP_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
$where = array(
|
||||
"username" => $username
|
||||
);
|
||||
|
||||
$user_data = $this->m_common->get('user', $where)->row();
|
||||
|
||||
$response = response_error("Username atau password salah");
|
||||
|
||||
if (isset($user_data)) {
|
||||
$is_password_valid = verify_password($password, $user_data->password);
|
||||
unset($user_data->password);
|
||||
if ($is_password_valid)
|
||||
$response = response_success();
|
||||
}
|
||||
|
||||
if (!$response['success']) {
|
||||
$this->set_response($response, RestController::HTTP_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
|
||||
$response = response_success("Login berhasil");
|
||||
$this->set_response($response, RestController::HTTP_OK);
|
||||
} catch (Exception $ex) {
|
||||
|
||||
$response = response_error($ex->getMessage());
|
||||
// $this->set_response($response, RestController::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function api_connect($param, $token, $value)
|
||||
{
|
||||
|
||||
//$url = "http://10.10.123.63:9000/api/pasien/10026543";
|
||||
$url = "http://10.10.123.63:9000/api/" . $param . "/" . $value;
|
||||
|
||||
//print_r($url);
|
||||
$authorization = "x-token:" . $token;
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTPHEADER => [$authorization],
|
||||
CURLOPT_URL => $url
|
||||
]);
|
||||
|
||||
$return = curl_exec($ch);
|
||||
|
||||
$result = array();
|
||||
$api_array = json_decode($return, TRUE);
|
||||
print_r($api_array);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function api_login($username, $password)
|
||||
{
|
||||
// http://10.10.123.63:9000/api/login?email=ragil@simrs&password=gantenggantengserigala2022
|
||||
|
||||
$url = "http://10.10.123.63:9000/api/login?email=" . $username . "&password=" . $password;
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_URL => $url
|
||||
]);
|
||||
|
||||
$return = curl_exec($ch);
|
||||
|
||||
$result = array();
|
||||
$api_array = json_decode($return, TRUE);
|
||||
print_r($api_array);
|
||||
//print_r($api_array['code']);
|
||||
/*if ($api_array['code'] == '200') {
|
||||
$result['status'] = TRUE;
|
||||
$result['content'] = $api_array['content'];
|
||||
} else {
|
||||
$result['status'] = FALSE;
|
||||
$result['content'] = "connect api failed, try again";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
class Apiconection extends CI_Controller{
|
||||
public function api_connect($param, $token, $value)
|
||||
{
|
||||
|
||||
//$url = "http://10.10.123.63:9000/api/pasien/10026543";
|
||||
$url = "http://10.10.123.63:9000/api/" . $param . "/" . $value;
|
||||
|
||||
//print_r($url);
|
||||
$authorization = "x-token:" . $token;
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTPHEADER => [$authorization],
|
||||
CURLOPT_URL => $url
|
||||
]);
|
||||
|
||||
$return = curl_exec($ch);
|
||||
|
||||
$result = array();
|
||||
$api_array = json_decode($return, TRUE);
|
||||
print_r($api_array);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function api_login($username, $password)
|
||||
{
|
||||
// http://10.10.123.63:9000/api/login?email=ragil@simrs&password=gantenggantengserigala2022
|
||||
|
||||
$url = "http://10.10.123.63:9000/api/login?email=" . $username . "&password=" . $password;
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_URL => $url
|
||||
]);
|
||||
|
||||
$return = curl_exec($ch);
|
||||
|
||||
$result = array();
|
||||
$api_array = json_decode($return, TRUE);
|
||||
print_r($api_array);
|
||||
//print_r($api_array['code']);
|
||||
/*if ($api_array['code'] == '200') {
|
||||
$result['status'] = TRUE;
|
||||
$result['content'] = $api_array['content'];
|
||||
} else {
|
||||
$result['status'] = FALSE;
|
||||
$result['content'] = "connect api failed, try again";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -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>
|
||||
<i class="icon fa fa-ban"></i> Username atau Password Salah!
|
||||
</div>';
|
||||
$this->index($error);
|
||||
}else{
|
||||
redirect('index.php');
|
||||
}
|
||||
}
|
||||
public function logout(){
|
||||
$this->session->sess_destroy();
|
||||
redirect('index.php/login');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
//-------------ID user login = 18
|
||||
|
||||
class Ps_datapenunjang 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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 Penunjang';
|
||||
$data['main_content'] = 'datapenunjang/v_datapenunjang';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_datapenunjang');
|
||||
$datapenunjang = $this->m_datapenunjang->index();
|
||||
$this->load->vars('dp', $datapenunjang);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->index();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->index();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->index();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dpjp = $this->m_dokter->index();
|
||||
$this->load->vars('dpjp', $dpjp);
|
||||
|
||||
$this->load->model('m_datapenunjang');
|
||||
$ro = $this->m_datapenunjang->radiologi();
|
||||
$this->load->vars('rolist', $ro);
|
||||
|
||||
$this->load->model('m_datapenunjang');
|
||||
$lb = $this->m_datapenunjang->lab();
|
||||
$this->load->vars('lablist', $lb);
|
||||
|
||||
$this->load->model('m_datapenunjang');
|
||||
$lbpa = $this->m_datapenunjang->labpa();
|
||||
$this->load->vars('labpalist', $lbpa);
|
||||
|
||||
$this->load->model('m_datapenunjang');
|
||||
$lbm = $this->m_datapenunjang->labmikro();
|
||||
$this->load->vars('labmikrolist', $lbm);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
//-------------ID user login = 19
|
||||
|
||||
class Ps_dataresume 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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) {
|
||||
$data['title'] = 'Data Resume';
|
||||
$data['main_content'] = 'dataresume/v_dataresume';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_dataresume');
|
||||
$dataresume = $this->m_dataresume->index();
|
||||
$this->load->vars('dr', $dataresume);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->index();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->index();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->index();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dpjp = $this->m_dokter->index();
|
||||
$this->load->vars('dpjp', $dpjp);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
//-------------ID user login = 7
|
||||
|
||||
class Ps_dokter 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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'] = 'Dokter';
|
||||
$data['main_content'] = 'master/dokter/v_dokter';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->index();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$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_dokter');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Dokter';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/dokter/form_dokter';
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_dokter');}
|
||||
//----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 Dokter';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/dokter/form_dokter';
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_dokter');
|
||||
$this->m_dokter->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Dokter baru');
|
||||
redirect('index.php/ps_dokter');
|
||||
}
|
||||
}
|
||||
|
||||
//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_dokter');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Dokter';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/dokter/form_dokter';
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->edit($id);
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_dokter');}
|
||||
//----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 Dokter';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/dokter/form_dokter';
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->edit($id);
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Dokter');
|
||||
$this->load->model('m_dokter');
|
||||
$this->m_dokter->prosesedit();
|
||||
redirect('index.php/ps_dokter');
|
||||
}
|
||||
}
|
||||
|
||||
//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_dokter');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Dokter';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/dokter/form_dokter';
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->edit($id);
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_dokter');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Dokter');
|
||||
$this->load->model('m_dokter');
|
||||
$this->m_dokter->delete($id);
|
||||
redirect('index.php/ps_dokter');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_dokter');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Dokter');
|
||||
$this->load->model('m_dokter');
|
||||
$this->m_dokter->disabled($id);
|
||||
redirect('index.php/ps_dokter');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_dokter');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Dokter');
|
||||
$this->load->model('m_dokter');
|
||||
$this->m_dokter->aktif($id);
|
||||
redirect('index.php/ps_dokter');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,232 @@
|
||||
<?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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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->index();
|
||||
$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');
|
||||
}
|
||||
|
||||
function disabled($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 disabled Tipe User');
|
||||
$this->load->model('m_tipeuser');
|
||||
$this->m_tipeuser->disabled($id);
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
|
||||
function aktif($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 aktifkan Tipe User');
|
||||
$this->load->model('m_tipeuser');
|
||||
$this->m_tipeuser->aktif($id);
|
||||
redirect('index.php/ps_hakakses');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
//-------------ID user login = 13
|
||||
|
||||
class Ps_jadwaldokter 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '13');
|
||||
$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'] = 'Jadwal Dokter';
|
||||
$data['main_content'] = 'jadwaldokter/v_jadwaldokter';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$jadwaldokter = $this->m_jadwaldokter->index();
|
||||
$this->load->vars('jd', $jadwaldokter);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function add($bulan,$tahun) {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_jadwaldokter');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Jadwal Dokter';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'jadwaldokter/form_jadwaldokter';
|
||||
|
||||
$data['databulan'] = $bulan;
|
||||
$data['datatahun'] = $tahun;
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$jadwaldokter = $this->m_jadwaldokter->index();
|
||||
$this->load->vars('jd', $jadwaldokter);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$spesialis = $this->m_jadwaldokter->spesialisstatus();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$dokter = $this->m_jadwaldokter->dokterstatus();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$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_jadwaldokter');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$this->m_jadwaldokter->prosesedit();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Jadwal Dokter');
|
||||
redirect('index.php/ps_jadwaldokter');
|
||||
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($bulan,$tahun) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_jadwaldokter');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Jadwal Dokter';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'jadwaldokter/form_jadwaldokter';
|
||||
|
||||
$data['databulan'] = $bulan;
|
||||
$data['datatahun'] = $tahun;
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$jadwaldokter = $this->m_jadwaldokter->index();
|
||||
$this->load->vars('jd', $jadwaldokter);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$spesialis = $this->m_jadwaldokter->spesialisstatus();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$dokter = $this->m_jadwaldokter->dokterstatus();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$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_jadwaldokter');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Jadwal Dokter');
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$this->m_jadwaldokter->prosesedit();
|
||||
redirect('index.php/ps_jadwaldokter');
|
||||
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form view data dengan data terpilih
|
||||
public function view($bulan,$tahun) {
|
||||
//----start validate page view-------//
|
||||
if($this->varview==null){redirect('index.php/ps_jadwaldokter');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Jadwal Dokter';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'jadwaldokter/form_jadwaldokter';
|
||||
|
||||
$data['databulan'] = $bulan;
|
||||
$data['datatahun'] = $tahun;
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$jadwaldokter = $this->m_jadwaldokter->index();
|
||||
$this->load->vars('jd', $jadwaldokter);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$spesialis = $this->m_jadwaldokter->spesialisstatus();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$dokter = $this->m_jadwaldokter->dokterstatus();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($bulan,$tahun) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_jadwaldokter');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Jadwal Dokter');
|
||||
$this->load->model('m_jadwaldokter');
|
||||
$this->m_jadwaldokter->delete($bulan,$tahun);
|
||||
redirect('index.php/ps_jadwaldokter');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
//-------------ID user login = 16
|
||||
|
||||
class Ps_laboratorium 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '16');
|
||||
$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'] = 'Laboratorium';
|
||||
$data['main_content'] = 'master/laboratorium/v_laboratorium';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->index();
|
||||
$this->load->vars('la', $laboratorium);
|
||||
|
||||
$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_laboratorium');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Laboratorium';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/laboratorium/form_laboratorium';
|
||||
|
||||
$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_laboratorium');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Pemeriksaan','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Laboratorium';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/laboratorium/form_laboratorium';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Pemeriksaan Laboratorium baru');
|
||||
redirect('index.php/ps_laboratorium');
|
||||
}
|
||||
}
|
||||
|
||||
//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_laboratorium');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Laboratorium';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/laboratorium/form_laboratorium';
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->edit($id);
|
||||
$this->load->vars('la', $laboratorium);
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->editdetail($id);
|
||||
$this->load->vars('lad', $laboratorium);
|
||||
|
||||
$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_laboratorium');}
|
||||
//----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 Pemeriksaan','required');
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Laboratorium';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/laboratorium/form_laboratorium';
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->edit($id);
|
||||
$this->load->vars('la', $laboratorium);
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->editdetail($id);
|
||||
$this->load->vars('lad', $laboratorium);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Laboratorium');
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->prosesedit();
|
||||
redirect('index.php/ps_laboratorium');
|
||||
}
|
||||
}
|
||||
|
||||
//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_laboratorium');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Laboratorium';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/laboratorium/form_laboratorium';
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->edit($id);
|
||||
$this->load->vars('la', $laboratorium);
|
||||
|
||||
$this->load->model('m_laboratorium');
|
||||
$laboratorium = $this->m_laboratorium->editdetail($id);
|
||||
$this->load->vars('lad', $laboratorium);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_laboratorium');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Pemeriksaan Laboratorium');
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->delete($id);
|
||||
redirect('index.php/ps_laboratorium');
|
||||
}
|
||||
|
||||
function deletedetail($id,$mlid) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_laboratorium');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Detail Pemeriksaan Laboratorium');
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->deletedetail($id);
|
||||
redirect('index.php/ps_laboratorium/edit/'.$mlid);
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_laboratorium');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Pemeriksaan Laboratorium');
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->disabled($id);
|
||||
|
||||
redirect('index.php/ps_laboratorium');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_laboratorium');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Pemeriksaan Laboratorium');
|
||||
$this->load->model('m_laboratorium');
|
||||
$this->m_laboratorium->aktif($id);
|
||||
|
||||
redirect('index.php/ps_laboratorium');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
//-------------ID user login = 6
|
||||
|
||||
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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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'] = 'Pasien';
|
||||
$data['main_content'] = 'master/pasien/v_pasien';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->index();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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_pasien');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Pasien';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$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_pasien');}
|
||||
//----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 Pasien';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan pasien baru');
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
}
|
||||
|
||||
//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'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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');
|
||||
$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 Pasien';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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_pasien');
|
||||
$this->m_pasien->delete($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
|
||||
function disabled($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 disabled Pasien');
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->disabled($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
|
||||
function aktif($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 aktifkan Pasien');
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->aktif($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,404 @@
|
||||
<?php
|
||||
//-------------ID user login = 11
|
||||
|
||||
class Ps_pemeriksaan 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', 'url'));
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '11');
|
||||
$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'] = 'Pemeriksaan Penunjang';
|
||||
$data['main_content'] = 'pemeriksaan/v_pemeriksaan';
|
||||
$data['error']=$error;
|
||||
if(! $this->input->post('reservation')){
|
||||
$date1 = date("m/d/Y");
|
||||
$date2 = date("m/d/Y");
|
||||
}else{
|
||||
$datemya = explode("-",$this->input->post('reservation'));
|
||||
$date1 = $datemya[0];
|
||||
$date2 = $datemya[1];
|
||||
}
|
||||
$data['daterange'] = $date1." - ".$date2;
|
||||
$data['spnya'] = $this->input->post('spesialis');
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$pemeriksaan = $this->m_pemeriksaan->search();
|
||||
$this->load->vars('pm', $pemeriksaan);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function addpermin($ket) {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_pemeriksaan');}
|
||||
//----end validate page tambah---------//
|
||||
$data['ket'] = "1";
|
||||
$data['pelayanan'] = $ket;
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'pemeriksaan/form_permin_pemeriksaan';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->pelayanan($ket);
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_pemeriksaan');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('pasien','Nama Pasien','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['ket'] = "1";
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'pemeriksaan/form_permin_pemeriksaan';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Permintaan Pem. Penunjang baru');
|
||||
redirect('index.php/ps_pemeriksaan');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id,$ket) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_pemeriksaan');}
|
||||
//----end validate page edit---------//
|
||||
$data['ket'] = $ket;
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'pemeriksaan/form_permin_pemeriksaan';
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$pemeriksaan = $this->m_pemeriksaan->edit($id);
|
||||
$this->load->vars('pm', $pemeriksaan);
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$ro = $this->m_pemeriksaan->radiologi($id);
|
||||
$this->load->vars('rolist', $ro);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$la = $this->m_pemeriksaan->lab($id);
|
||||
$this->load->vars('lalist', $la);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$lp = $this->m_pemeriksaan->labpa($id);
|
||||
$this->load->vars('lapalist', $lp);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$lm = $this->m_pemeriksaan->labmikro($id);
|
||||
$this->load->vars('lamklist', $lm);
|
||||
|
||||
$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_pemeriksaan');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$ket= $this->input->post('keter');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
if($ket=="2"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit permintaan Pememeriksaan Penunjang');
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->proseseditpermin();
|
||||
redirect('index.php/ps_pemeriksaan');
|
||||
}else{
|
||||
$namafile = $this->input->post('setnorm')."_".date('ymdhis');
|
||||
|
||||
if($this->session->userdata('s_petugas_rssapintar')==1){
|
||||
$config['upload_path'] = './document/radiologi';
|
||||
$config['allowed_types'] = 'jpg|pdf';
|
||||
$config['overwrite'] = TRUE;
|
||||
$config['max_size'] = 2000;
|
||||
$config['file_name'] = $namafile;
|
||||
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if ( !$this->upload->do_upload('fileradiologi')){
|
||||
$this->session->set_flashdata('messagedanger', $this->upload->display_errors());
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}else{
|
||||
if($ket=="4"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengisi Pemeriksaan Penunjang Radiologi');
|
||||
}elseif($ket=="3"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Penunjang Radiologi');
|
||||
}
|
||||
$filenya = explode("/",$_FILES['fileradiologi']['type']);
|
||||
if($filenya[1]=="jpeg"){
|
||||
$filenya[1]="jpg";
|
||||
}
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->proseseditupload($namafile.".".$filenya[1]);
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==2){
|
||||
$config['upload_path'] = './document/lab';
|
||||
$config['allowed_types'] = 'jpg|pdf';
|
||||
$config['overwrite'] = TRUE;
|
||||
$config['max_size'] = 2000;
|
||||
$config['file_name'] = $namafile;
|
||||
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if ( !$this->upload->do_upload('filelab')){
|
||||
$this->session->set_flashdata('messagedanger', $this->upload->display_errors());
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}else{
|
||||
if($ket=="4"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengisi Pemeriksaan Penunjang Lab');
|
||||
}elseif($ket=="3"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Penunjang Lab');
|
||||
}
|
||||
$filenya = explode("/",$_FILES['filelab']['type']);
|
||||
if($filenya[1]=="jpeg"){
|
||||
$filenya[1]="jpg";
|
||||
}
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->proseseditupload($namafile.".".$filenya[1]);
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==3){
|
||||
$config['upload_path'] = './document/labpa';
|
||||
$config['allowed_types'] = 'jpg|pdf';
|
||||
$config['overwrite'] = TRUE;
|
||||
$config['max_size'] = 2000;
|
||||
$config['file_name'] = $namafile;
|
||||
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if ( !$this->upload->do_upload('filelabpa')){
|
||||
$this->session->set_flashdata('messagedanger', $this->upload->display_errors());
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}else{
|
||||
if($ket=="4"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengisi Pemeriksaan Penunjang Lab PA');
|
||||
}elseif($ket=="3"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Penunjang Lab PA');
|
||||
}
|
||||
$filenya = explode("/",$_FILES['filelabpa']['type']);
|
||||
if($filenya[1]=="jpeg"){
|
||||
$filenya[1]="jpg";
|
||||
}
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->proseseditupload($namafile.".".$filenya[1]);
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==4){
|
||||
$config['upload_path'] = './document/labmikro';
|
||||
$config['allowed_types'] = 'jpg|pdf';
|
||||
$config['overwrite'] = TRUE;
|
||||
$config['max_size'] = 2000;
|
||||
$config['file_name'] = $namafile;
|
||||
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if ( !$this->upload->do_upload('filelabmikro')){
|
||||
$this->session->set_flashdata('messagedanger', $this->upload->display_errors());
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}else{
|
||||
if($ket=="4"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengisi Pemeriksaan Penunjang Lab Mikro');
|
||||
}elseif($ket=="3"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Penunjang Lab Mikro');
|
||||
}
|
||||
$filenya = explode("/",$_FILES['filelabmikro']['type']);
|
||||
if($filenya[1]=="jpeg"){
|
||||
$filenya[1]="jpg";
|
||||
}
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->proseseditupload($namafile.".".$filenya[1]);
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deletefile($idpfp,$idpp,$ket) {
|
||||
//----start validate page delete-------//
|
||||
//if($this->vardelete==null){redirect('index.php/ps_pemeriksaan');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus file penunjang');
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$this->m_pemeriksaan->deletefile($idpfp);
|
||||
redirect('index.php/ps_pemeriksaan/edit/'.$idpp.'/'.$ket);
|
||||
}
|
||||
|
||||
//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_pemeriksaan');}
|
||||
//----end validate page view---------//
|
||||
$data['ket'] = "5";
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'pemeriksaan/form_permin_pemeriksaan';
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$pemeriksaan = $this->m_pemeriksaan->edit($id);
|
||||
$this->load->vars('pm', $pemeriksaan);
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$ro = $this->m_pemeriksaan->radiologi($id);
|
||||
$this->load->vars('rolist', $ro);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$la = $this->m_pemeriksaan->lab($id);
|
||||
$this->load->vars('lalist', $la);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$lp = $this->m_pemeriksaan->labpa($id);
|
||||
$this->load->vars('lapalist', $lp);
|
||||
|
||||
$this->load->model('m_pemeriksaan');
|
||||
$lm = $this->m_pemeriksaan->labmikro($id);
|
||||
$this->load->vars('lamklist', $lm);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
function deletedokter($id,$ket) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Resume Dokter');
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->deletedokter($id);
|
||||
redirect('index.php/ps_resume/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Resume');
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->delete($id);
|
||||
redirect('index.php/ps_resume');
|
||||
}
|
||||
|
||||
function datapasien(){
|
||||
$id = $this->input->post('pasien');
|
||||
$query = $this->db->query("select * from master_user
|
||||
where mu_id='$id'");
|
||||
foreach ($query->result() as $row){
|
||||
$data[] = $row;
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
//-------------ID user login = 15
|
||||
|
||||
class Ps_petugas 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '15');
|
||||
$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'] = 'Petugas';
|
||||
$data['main_content'] = 'master/petugas/v_petugas';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_petugas');
|
||||
$petugas = $this->m_petugas->index();
|
||||
$this->load->vars('pt', $petugas);
|
||||
|
||||
$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_petugas');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Petugas';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/petugas/form_petugas';
|
||||
|
||||
$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_petugas');}
|
||||
//----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 Petugas';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/petugas/form_petugas';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_petugas');
|
||||
$this->m_petugas->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Petugas baru');
|
||||
redirect('index.php/ps_petugas');
|
||||
}
|
||||
}
|
||||
|
||||
//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_petugas');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Petugas';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/petugas/form_petugas';
|
||||
|
||||
$this->load->model('m_petugas');
|
||||
$petugas = $this->m_petugas->edit($id);
|
||||
$this->load->vars('pt', $petugas);
|
||||
|
||||
$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_petugas');}
|
||||
//----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 Petugas';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/petugas/form_petugas';
|
||||
|
||||
$this->load->model('m_petugas');
|
||||
$petugas = $this->m_petugas->edit($id);
|
||||
$this->load->vars('pt', $petugas);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Petugas');
|
||||
$this->load->model('m_petugas');
|
||||
$this->m_petugas->prosesedit();
|
||||
redirect('index.php/ps_petugas');
|
||||
}
|
||||
}
|
||||
|
||||
//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_petugas');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Petugas';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/petugas/form_petugas';
|
||||
|
||||
$this->load->model('m_petugas');
|
||||
$petugas = $this->m_petugas->edit($id);
|
||||
$this->load->vars('pt', $petugas);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_petugas');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Petugas');
|
||||
$this->load->model('m_petugas');
|
||||
$this->m_petugas->delete($id);
|
||||
redirect('index.php/ps_petugas');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_petugas');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Petugas');
|
||||
$this->load->model('m_petugas');
|
||||
$this->m_petugas->disabled($id);
|
||||
redirect('index.php/ps_petugas');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_petugas');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Petugas');
|
||||
$this->load->model('m_petugas');
|
||||
$this->m_petugas->aktif($id);
|
||||
redirect('index.php/ps_petugas');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
//-------------ID user login = 14
|
||||
|
||||
class Ps_profile 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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'] = 'Profile';
|
||||
$data['main_content'] = 'profile/v_profile';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_profile');
|
||||
$profile = $this->m_profile->index();
|
||||
$this->load->vars('pf', $profile);
|
||||
|
||||
$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_pasien');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Pasien';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$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_pasien');}
|
||||
//----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 Pasien';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan pasien baru');
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
}
|
||||
|
||||
//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'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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');
|
||||
$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 Pasien';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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'] = 'master/pasien/form_pasien';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->edit($id);
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$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_pasien');
|
||||
$this->m_pasien->delete($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
|
||||
function disabled($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 disabled Pasien');
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->disabled($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
|
||||
function aktif($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 aktifkan Pasien');
|
||||
$this->load->model('m_pasien');
|
||||
$this->m_pasien->aktif($id);
|
||||
redirect('index.php/ps_pasien');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
//-------------ID user login = 17
|
||||
|
||||
class Ps_radiologi 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '17');
|
||||
$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'] = 'Radiologi';
|
||||
$data['main_content'] = 'master/radiologi/v_radiologi';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->index();
|
||||
$this->load->vars('ro', $radiologi);
|
||||
|
||||
$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_radiologi');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Radiologi';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/radiologi/form_radiologi';
|
||||
|
||||
$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_radiologi');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Pemeriksaan','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Radiologi';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/radiologi/form_radiologi';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Pemeriksaan Radiologi baru');
|
||||
redirect('index.php/ps_radiologi');
|
||||
}
|
||||
}
|
||||
|
||||
//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_radiologi');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Radiologi';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/radiologi/form_radiologi';
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->edit($id);
|
||||
$this->load->vars('ro', $radiologi);
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->editdetail($id);
|
||||
$this->load->vars('rod', $radiologi);
|
||||
|
||||
$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_radiologi');}
|
||||
//----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 Pemeriksaan','required');
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Radiologi';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/radiologi/form_radiologi';
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->edit($id);
|
||||
$this->load->vars('ro', $radiologi);
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->editdetail($id);
|
||||
$this->load->vars('rod', $radiologi);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Pemeriksaan Radiologi');
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->prosesedit();
|
||||
redirect('index.php/ps_radiologi');
|
||||
}
|
||||
}
|
||||
|
||||
//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_radiologi');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Radiologi';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/radiologi/form_radiologi';
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->edit($id);
|
||||
$this->load->vars('ro', $radiologi);
|
||||
|
||||
$this->load->model('m_radiologi');
|
||||
$radiologi = $this->m_radiologi->editdetail($id);
|
||||
$this->load->vars('rod', $radiologi);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_radiologi');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Pemeriksaan Radiologi');
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->delete($id);
|
||||
redirect('index.php/ps_radiologi');
|
||||
}
|
||||
|
||||
function deletedetail($id,$mroid) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_radiologi');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Detail Pemeriksaan Radiologi');
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->deletedetail($id);
|
||||
redirect('index.php/ps_radiologi/edit/'.$mroid);
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_radiologi');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Pemeriksaan Radiologi');
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->disabled($id);
|
||||
|
||||
redirect('index.php/ps_radiologi');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_radiologi');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Pemeriksaan Radiologi');
|
||||
$this->load->model('m_radiologi');
|
||||
$this->m_radiologi->aktif($id);
|
||||
|
||||
redirect('index.php/ps_radiologi');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
//-------------ID user login = 10
|
||||
|
||||
class Ps_resume 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$this->db->where('mum_menu_id', '10');
|
||||
$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'] = 'Resume';
|
||||
$data['main_content'] = 'resume/v_resume';
|
||||
$data['error']=$error;
|
||||
if(! $this->input->post('reservation')){
|
||||
$date1 = date("m/d/Y");
|
||||
$date2 = date("m/d/Y");
|
||||
}else{
|
||||
$datemya = explode("-",$this->input->post('reservation'));
|
||||
$date1 = $datemya[0];
|
||||
$date2 = $datemya[1];
|
||||
}
|
||||
$data['daterange'] = $date1." - ".$date2;
|
||||
$data['spnya'] = $this->input->post('spesialis');
|
||||
|
||||
$this->load->model('m_resume');
|
||||
$resume = $this->m_resume->search();
|
||||
$this->load->vars('rs', $resume);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
// fungsi untuk menampilkan form tambah data
|
||||
public function addpetugas($ket) {
|
||||
//----start validate page tambah-------//
|
||||
if($this->vartambah==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page tambah---------//
|
||||
$data['ket'] = "1";
|
||||
$data['pelayanan'] = $ket;
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'resume/form_petugas_resume';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->pelayanan($ket);
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_resume');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('pasien','Nama Pasien','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['ket'] = "1";
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'resume/form_petugas_resume';
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->insert_petugas();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Permintaan Resume baru');
|
||||
redirect('index.php/ps_resume');
|
||||
}
|
||||
}
|
||||
|
||||
//fungsi untuk menampilkan form edit data dengan data terpilih
|
||||
public function edit($id,$ket) {
|
||||
//----start validate page edit-------//
|
||||
if($this->varedit==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page edit---------//
|
||||
$data['ket'] = $ket;
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'resume/form_petugas_resume';
|
||||
|
||||
$this->load->model('m_resume');
|
||||
$resume = $this->m_resume->edit_petugas($id);
|
||||
$this->load->vars('rs', $resume);
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_resume');}
|
||||
//----end validate page edit---------//
|
||||
$id = $this->input->post('id');
|
||||
$ket= $this->input->post('keter');
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
if($ket=="2"){
|
||||
$this->form_validation->set_rules('pasien','Pasien','required');
|
||||
}else{
|
||||
$this->form_validation->set_rules('dpjp','DPJP','required');
|
||||
}
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['ket'] = $ket;
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'resume/form_petugas_resume';
|
||||
|
||||
$this->load->model('m_resume');
|
||||
$resume = $this->m_resume->edit_petugas($id);
|
||||
$this->load->vars('rs', $resume);
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
if($ket=="2"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit permintaan Resume');
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->proseseditpetugas();
|
||||
redirect('index.php/ps_resume');
|
||||
}else{
|
||||
if($ket=="3"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Resume');
|
||||
}elseif($ket=="4"){
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengisi Resume');
|
||||
}
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->proseseditdokter();
|
||||
redirect('index.php/ps_resume');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//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_resume');}
|
||||
//----end validate page view---------//
|
||||
$data['ket'] = "5";
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'resume/form_petugas_resume';
|
||||
|
||||
$this->load->model('m_resume');
|
||||
$resume = $this->m_resume->edit_petugas($id);
|
||||
$this->load->vars('rs', $resume);
|
||||
|
||||
$this->load->model('m_pasien');
|
||||
$pasien = $this->m_pasien->statusaktif();
|
||||
$this->load->vars('ps', $pasien);
|
||||
|
||||
$this->load->model('m_dokter');
|
||||
$dokter = $this->m_dokter->statusaktif();
|
||||
$this->load->vars('dk', $dokter);
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruang = $this->m_ruangan->status();
|
||||
$this->load->vars('ru', $ruang);
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->status();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
function deletedokter($id,$ket) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Resume Dokter');
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->deletedokter($id);
|
||||
redirect('index.php/ps_resume/edit/'.$id.'/'.$ket);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_resume');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Resume');
|
||||
$this->load->model('m_resume');
|
||||
$this->m_resume->delete($id);
|
||||
redirect('index.php/ps_resume');
|
||||
}
|
||||
|
||||
function datapasien(){
|
||||
$id = $this->input->post('pasien');
|
||||
$query = $this->db->query("select * from master_user
|
||||
where mu_id='$id'");
|
||||
foreach ($query->result() as $row){
|
||||
$data[] = $row;
|
||||
}
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
//-------------ID user login = 9
|
||||
|
||||
class Ps_ruangan 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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) {
|
||||
$data['title'] = 'Ruang';
|
||||
$data['main_content'] = 'master/ruangan/v_ruangan';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruangan = $this->m_ruangan->index();
|
||||
$this->load->vars('ru', $ruangan);
|
||||
|
||||
$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_ruangan');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Ruang';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/ruangan/form_ruangan';
|
||||
|
||||
$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_ruangan');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Ruang','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Ruang';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/ruangan/form_ruangan';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_ruangan');
|
||||
$this->m_ruangan->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Ruang baru');
|
||||
redirect('index.php/ps_ruangan');
|
||||
}
|
||||
}
|
||||
|
||||
//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_ruangan');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Ruang';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/ruangan/form_ruangan';
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruangan = $this->m_ruangan->edit($id);
|
||||
$this->load->vars('ru', $ruangan);
|
||||
|
||||
$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_ruangan');}
|
||||
//----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 Ruang','required');
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Ruang';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/ruangan/form_ruangan';
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruangan = $this->m_ruangan->edit($id);
|
||||
$this->load->vars('ru', $ruangan);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Ruang');
|
||||
$this->load->model('m_ruangan');
|
||||
$this->m_ruangan->prosesedit();
|
||||
redirect('index.php/ps_ruangan');
|
||||
}
|
||||
}
|
||||
|
||||
//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_ruangan');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Ruang';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/ruangan/form_ruangan';
|
||||
|
||||
$this->load->model('m_ruangan');
|
||||
$ruangan = $this->m_ruangan->edit($id);
|
||||
$this->load->vars('ru', $ruangan);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_ruangan');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Ruang');
|
||||
$this->load->model('m_ruangan');
|
||||
$this->m_ruangan->delete($id);
|
||||
redirect('index.php/ps_ruangan');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_ruangan');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Ruang');
|
||||
$this->load->model('m_ruangan');
|
||||
$this->m_ruangan->disabled($id);
|
||||
redirect('index.php/ps_ruangan');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_ruangan');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Ruang');
|
||||
$this->load->model('m_ruangan');
|
||||
$this->m_ruangan->aktif($id);
|
||||
redirect('index.php/ps_ruangan');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
//-------------ID user login = 8
|
||||
|
||||
class Ps_spesialis 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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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'] = 'Spesialis';
|
||||
$data['main_content'] = 'master/spesialis/v_spesialis';
|
||||
$data['error']=$error;
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->index();
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_spesialis');}
|
||||
//----end validate page tambah---------//
|
||||
$data['title'] = 'Tambah Spesialis';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/spesialis/form_spesialis';
|
||||
|
||||
$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_spesialis');}
|
||||
//----end validate page tambah---------//
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('nama','Nama Spesialis','required');
|
||||
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Tambah Spesialis';
|
||||
$data['actionform'] = 'prosesadd';
|
||||
$data['main_content'] = 'master/spesialis/form_spesialis';
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}else{
|
||||
$this->load->model('m_spesialis');
|
||||
$this->m_spesialis->insert();
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menambahkan Spesialis baru');
|
||||
redirect('index.php/ps_spesialis');
|
||||
}
|
||||
}
|
||||
|
||||
//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_spesialis');}
|
||||
//----end validate page edit---------//
|
||||
$data['title'] = 'Edit Spesialis';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/spesialis/form_spesialis';
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->edit($id);
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$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_spesialis');}
|
||||
//----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 Spesialis','required');
|
||||
if($this->form_validation->run()==FALSE){
|
||||
$data['title'] = 'Edit Spesialis';
|
||||
$data['actionform'] = 'prosesedit';
|
||||
$data['main_content'] = 'master/spesialis/form_spesialis';
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->edit($id);
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
else{
|
||||
$this->session->set_flashdata('message', 'Anda berhasil mengedit Spesialis');
|
||||
$this->load->model('m_spesialis');
|
||||
$this->m_spesialis->prosesedit();
|
||||
redirect('index.php/ps_spesialis');
|
||||
}
|
||||
}
|
||||
|
||||
//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_spesialis');}
|
||||
//----end validate page view---------//
|
||||
$data['title'] = 'View Spesialis';
|
||||
$data['actionform'] = 'prosesview';
|
||||
$data['main_content'] = 'master/spesialis/form_spesialis';
|
||||
|
||||
$this->load->model('m_spesialis');
|
||||
$spesialis = $this->m_spesialis->edit($id);
|
||||
$this->load->vars('sp', $spesialis);
|
||||
|
||||
$this->load->view('includes/template', $data);
|
||||
}
|
||||
|
||||
//fungsi untuk delete
|
||||
function delete($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_spesialis');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil menghapus Spesialis');
|
||||
$this->load->model('m_spesialis');
|
||||
$this->m_spesialis->delete($id);
|
||||
redirect('index.php/ps_spesialis');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_spesialis');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil disabled Spesialis');
|
||||
$this->load->model('m_spesialis');
|
||||
$this->m_spesialis->disabled($id);
|
||||
redirect('index.php/ps_spesialis');
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
//----start validate page delete-------//
|
||||
if($this->vardelete==null){redirect('index.php/ps_spesialis');}
|
||||
//----end validate page delete---------//
|
||||
$this->session->set_flashdata('message', 'Anda berhasil aktifkan Spesialis');
|
||||
$this->load->model('m_spesialis');
|
||||
$this->m_spesialis->aktif($id);
|
||||
redirect('index.php/ps_spesialis');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,210 @@
|
||||
<?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_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
|
||||
//--------------start check access this form page-------------//
|
||||
$this->db->where('mum_tipeuser_id', $this->session->userdata('s_FK_TipeUser_rssapintar'));
|
||||
$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->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->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->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->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->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');
|
||||
}
|
||||
|
||||
function disabled($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 disabled User Login');
|
||||
$this->load->model('m_userlogin');
|
||||
$this->m_userlogin->disabled($id);
|
||||
redirect('index.php/ps_userlogin');
|
||||
}
|
||||
|
||||
function aktif($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 aktifkan User Login');
|
||||
$this->load->model('m_userlogin');
|
||||
$this->m_userlogin->aktif($id);
|
||||
redirect('index.php/ps_userlogin');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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'] = 'Themplate AdminLTE3';
|
||||
$data['main_content'] = 'home/v_home';
|
||||
$this->load->view('includes/template', $data);
|
||||
|
||||
}
|
||||
private function check_isvalidated(){
|
||||
if(! $this->session->userdata('validated_rssapintar')){
|
||||
redirect('index.php/login');
|
||||
}
|
||||
}
|
||||
public function do_logout(){
|
||||
$this->session->sess_destroy();
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user