add rssa-pintar to git
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
class M_datapenunjang extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$this->db->order_by('pp_date_pemeriksaan', 'DESC');
|
||||
$this->db->where('pp_user_pasien_id', $this->session->userdata('s_ID_User_rssapintar'));
|
||||
$query = $this->db->get('proses_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function radiologi(){
|
||||
$this->db->where('pfp_ket', 1);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function lab(){
|
||||
$this->db->where('pfp_ket', 2);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function labpa(){
|
||||
$this->db->where('pfp_ket', 3);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function labmikro(){
|
||||
$this->db->where('pfp_ket', 4);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class M_dataresume extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$this->db->order_by('pr_date_resume', 'DESC');
|
||||
$this->db->where('pr_user_pasien_id', $this->session->userdata('s_ID_User_rssapintar'));
|
||||
$query = $this->db->get('proses_resume');
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
class M_dokter extends CI_Model {
|
||||
function index() {
|
||||
$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->join('master_spesialis', 'master_user.mu_spesialis_id = master_spesialis.ms_id','left');
|
||||
$this->db->where('mu_tipeuser_id', '5');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function statusaktif() {
|
||||
$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->join('master_spesialis', 'master_user.mu_spesialis_id = master_spesialis.ms_id','left');
|
||||
$this->db->where('mu_tipeuser_id', '5');
|
||||
$this->db->where('mu_status', '1');
|
||||
$this->db->where('mu_dpjp_ket', '1');
|
||||
$this->db->order_by("ms_nama", "asc");
|
||||
$this->db->order_by("mu_nama_lengkap", "asc");
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert_userlogin = array(
|
||||
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "5",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkap'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_spesialis_id' => $this->input->post('spesialis'),
|
||||
'mu_dpjp_ket' => $this->input->post('dpjp'),
|
||||
);
|
||||
$insert = $this->db->insert('master_user', $insert_userlogin);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$password = $this->input->post('passworduser');
|
||||
if(empty($password)){
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkap'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_tipeuser_id' => "5",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_spesialis_id' => $this->input->post('spesialis'),
|
||||
'mu_dpjp_ket' => $this->input->post('dpjp'),
|
||||
);
|
||||
}else{
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "5",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_spesialis_id' => $this->input->post('spesialis'),
|
||||
'mu_dpjp_ket' => $this->input->post('dpjp'),
|
||||
);
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_userlogin);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->delete('master_user');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 0,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 1,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
class M_hakakses extends CI_Model {
|
||||
|
||||
function prosesedithakakses() {
|
||||
$this->db->where('mum_tipeuser_id', $this->input->post('id'));
|
||||
$this->db->delete('master_user_menu');
|
||||
|
||||
if(isset($_POST['akses'])){
|
||||
$postakses= $_POST['akses'];
|
||||
foreach($postakses as $key1 =>$valueakses)
|
||||
{
|
||||
$tambahaction=null;
|
||||
$editaction=null;
|
||||
$deleteaction=null;
|
||||
$dataakses= explode ("-",$valueakses);
|
||||
|
||||
if(isset($_POST['tambah'])){
|
||||
$posttambah= $_POST['tambah'];
|
||||
foreach($posttambah as $key2 =>$valuetambah)
|
||||
{
|
||||
if($dataakses[1]==$valuetambah){
|
||||
$tambahaction="tambah";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['edit'])){
|
||||
$postedit= $_POST['edit'];
|
||||
foreach($postedit as $key3 =>$valueedit)
|
||||
{
|
||||
if($dataakses[1]==$valueedit){
|
||||
$editaction="ubah";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['delete'])){
|
||||
$postdelete= $_POST['delete'];
|
||||
foreach($postdelete as $key4 =>$valuedelete)
|
||||
{
|
||||
if($dataakses[1]==$valuedelete){
|
||||
$deleteaction="hapus";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['view'])){
|
||||
$postview= $_POST['view'];
|
||||
foreach($postview as $key5 =>$valueview)
|
||||
{
|
||||
if($dataakses[1]==$valueview){
|
||||
$viewaction="lihat";
|
||||
}
|
||||
}
|
||||
}
|
||||
$insert_hakakses = array(
|
||||
'mum_tipeuser_id' => $this->input->post('id'),
|
||||
'mum_menu_id' => $dataakses[1],
|
||||
'mum_lihat' => $viewaction,
|
||||
'mum_tambah' => $tambahaction,
|
||||
'mum_ubah' => $editaction,
|
||||
'mum_hapus' => $deleteaction,
|
||||
);
|
||||
|
||||
$insert = $this->db->insert('master_user_menu', $insert_hakakses);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
class M_jadwaldokter extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$this->db->order_by('pjd_date', 'ASC');
|
||||
$this->db->order_by('pjd_user_dokter_id', 'ASC');
|
||||
$query = $this->db->get('proses_jadwal_dokter');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function spesialisstatus() {
|
||||
$this->db->order_by('ms_nama', 'ASC');
|
||||
$this->db->where('ms_status', 1);
|
||||
$query = $this->db->get('master_spesialis');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function dokterstatus() {
|
||||
$this->db->join('master_spesialis', 'master_spesialis.ms_id = master_user.mu_spesialis_id','left');
|
||||
$this->db->order_by('ms_nama', 'ASC');
|
||||
$this->db->order_by('mu_nama_lengkap', 'ASC');
|
||||
$this->db->where('mu_status', 1);
|
||||
$this->db->where('mu_tipeuser_id', 5);
|
||||
$this->db->where('mu_dpjp_ket', 1);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
// function insert() {
|
||||
// $dokter = $_POST['iddokter'];$num=0;
|
||||
// foreach($dokter as $key =>$datanya)
|
||||
// {
|
||||
// if($_POST['jam'][$num]!=""){
|
||||
// $insert = array(
|
||||
// 'pjd_date' => $_POST['tanggal'][$num],
|
||||
// 'pjd_time_mulai' => $_POST['jam'][$num],
|
||||
// 'pjd_user_dokter_id' => $_POST['iddokter'][$num],
|
||||
// );
|
||||
// $insert = $this->db->insert('proses_jadwal_dokter', $insert);
|
||||
// }
|
||||
// $num++;
|
||||
// }
|
||||
// }
|
||||
|
||||
function prosesedit() {
|
||||
$dokter = $_POST['iddokter'];$num=0;
|
||||
foreach($dokter as $key =>$datanya)
|
||||
{
|
||||
if($_POST['jam'][$num]!=""||$_POST['idket'][$num]!=""){
|
||||
$update = array(
|
||||
'pjd_date' => $_POST['tanggal'][$num],
|
||||
'pjd_time_mulai' => $_POST['jam'][$num],
|
||||
'pjd_user_dokter_id' => $_POST['iddokter'][$num],
|
||||
);
|
||||
if($_POST['idket'][$num]==0){
|
||||
if($_POST['jam'][$num]!=""){
|
||||
$insert = $this->db->insert('proses_jadwal_dokter', $update);
|
||||
}
|
||||
}else{
|
||||
$id = $_POST['idket'][$num];
|
||||
$this->db->where('pjd_id', $id);
|
||||
$this->db->update('proses_jadwal_dokter', $update);
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function delete($bulan, $tahun) {
|
||||
$setbulan="";
|
||||
if($bulan<=9){$setbulan="0".$bulan;}else{$sethari=$setbulan;}
|
||||
|
||||
$this->db->like("pjd_date", "$tahun-$setbulan", "both");
|
||||
$this->db->delete('proses_jadwal_dokter');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
class M_laboratorium extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('master_laboratorium');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function status() {
|
||||
$this->db->where('ml_status', 1);
|
||||
$query = $this->db->get('master_laboratorium');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function statusdetail() {
|
||||
$this->db->join('master_laboratorium', 'master_laboratorium.ml_id = master_laboratorium_detail.mld_ml_id','left');
|
||||
$this->db->order_by('ml_nama', 'ASC');
|
||||
$this->db->order_by('mld_nama', 'ASC');
|
||||
$this->db->where('mld_status', 1);
|
||||
$query = $this->db->get('master_laboratorium_detail');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert = array(
|
||||
'ml_nama' => $this->input->post('nama'),
|
||||
'ml_keterangan' => $this->input->post('keterangan'),
|
||||
'ml_status' => 1,
|
||||
);
|
||||
$insert = $this->db->insert('master_laboratorium', $insert);
|
||||
$id = $this->db->insert_id();
|
||||
|
||||
$status = $_POST['statusdetail'];$num=0;
|
||||
foreach($status as $key =>$datanya)
|
||||
{
|
||||
$insert_data = array(
|
||||
'mld_nama' => $_POST['detail'][$num],
|
||||
'mld_keterangan' => $_POST['ket'][$num],
|
||||
'mld_status' => $_POST['statusdetail'][$num],
|
||||
'mld_ml_id' => $id,
|
||||
);
|
||||
$insert = $this->db->insert('master_laboratorium_detail', $insert_data);
|
||||
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('ml_id', $id);
|
||||
$query = $this->db->get('master_laboratorium');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function editdetail($id) {
|
||||
$this->db->where('mld_ml_id', $id);
|
||||
$query = $this->db->get('master_laboratorium_detail');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$update = array(
|
||||
'ml_nama' => $this->input->post('nama'),
|
||||
'ml_keterangan' => $this->input->post('keterangan'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('ml_id', $id);
|
||||
$this->db->update('master_laboratorium', $update);
|
||||
|
||||
$status = $_POST['statusdetail'];$num=0;
|
||||
foreach($status as $key =>$datanya)
|
||||
{
|
||||
$data = array(
|
||||
'mld_nama' => $_POST['detail'][$num],
|
||||
'mld_keterangan' => $_POST['ket'][$num],
|
||||
'mld_status' => $_POST['statusdetail'][$num],
|
||||
'mld_ml_id' => $id,
|
||||
);
|
||||
if($_POST['baru'][$num]=="2"){
|
||||
$this->db->where('mld_id', $_POST['iddetail'][$num]);
|
||||
$this->db->update('master_laboratorium_detail', $data);
|
||||
}else{
|
||||
$insert = $this->db->insert('master_laboratorium_detail', $data);
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('ml_id', $id);
|
||||
$this->db->delete('master_laboratorium');
|
||||
|
||||
$this->db->where('mld_ml_id', $id);
|
||||
$this->db->delete('master_laboratorium_detail');
|
||||
}
|
||||
|
||||
function deletedetail($id) {
|
||||
$this->db->where('mld_id', $id);
|
||||
$this->db->delete('master_laboratorium_detail');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'ml_status' => 0,
|
||||
);
|
||||
$this->db->where('ml_id', $id);
|
||||
$this->db->update('master_laboratorium', $update_data);
|
||||
|
||||
$update_data_detail = array(
|
||||
'mld_status' => 0,
|
||||
);
|
||||
$this->db->where('mld_ml_id', $id);
|
||||
$this->db->update('master_laboratorium_detail', $update_data_detail);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'ml_status' => 1,
|
||||
);
|
||||
$this->db->where('ml_id', $id);
|
||||
$this->db->update('master_laboratorium', $update_data);
|
||||
|
||||
$update_data_detail = array(
|
||||
'mld_status' => 1,
|
||||
);
|
||||
$this->db->where('mld_ml_id', $id);
|
||||
$this->db->update('master_laboratorium_detail', $update_data_detail);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class M_login extends CI_Model{
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
public function validate(){
|
||||
$username = $this->security->xss_clean($this->input->post('username'));
|
||||
$password = md5($this->security->xss_clean($this->input->post('password')));
|
||||
$this->db->join('master_spesialis', 'master_user.mu_spesialis_id = master_spesialis.ms_id','left');
|
||||
$this->db->where('mu_nama_user', $username);
|
||||
$this->db->where('mu_password', $password);
|
||||
$query = $this->db->get('master_user');
|
||||
if($query->num_rows() == 1)
|
||||
{
|
||||
|
||||
$row = $query->row();
|
||||
$data = array(
|
||||
's_ID_User_rssapintar' => $row->mu_id,
|
||||
's_nama_rssapintar' => $row->mu_nama_lengkap,
|
||||
's_FK_TipeUser_rssapintar' => $row->mu_tipeuser_id,
|
||||
's_ID_Spesialis_rssapintar' => $row->ms_id,
|
||||
's_Spesialis_rssapintar' => $row->ms_nama,
|
||||
's_petugas_rssapintar' => $row->mu_petugas_penunjang,
|
||||
'validated_rssapintar' => true
|
||||
);
|
||||
$this->session->set_userdata($data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
class M_menu extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$this->db->order_by('mm_urutan', 'ASC');
|
||||
$this->db->where('mm_aktif', "1");
|
||||
$query = $this->db->get('master_menu');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function hakakses($id) {
|
||||
$this->db->where('mum_tipeuser_id', $id);
|
||||
$query = $this->db->get('master_user_menu');
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
class M_pasien extends CI_Model {
|
||||
function index() {
|
||||
//$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->where('mu_tipeuser_id', '6');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function statusaktif() {
|
||||
$this->db->where('mu_status', '1');
|
||||
$this->db->where('mu_tipeuser_id', '6');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert_userlogin = array(
|
||||
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
$insert = $this->db->insert('master_user', $insert_userlogin);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$password = $this->input->post('passworduser');
|
||||
if(empty($password)){
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
}else{
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_userlogin);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->delete('master_user');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 0,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 1,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
class M_pemeriksaan extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$this->db->join('master_spesialis', 'master_spesialis.ms_id = proses_pemeriksaan.pp_spesialis_id','left');
|
||||
$this->db->join('master_ruang', 'master_ruang.mr_id = proses_pemeriksaan.pp_ruang_id','left');
|
||||
$this->db->join('master_user', 'master_user.mu_id = proses_pemeriksaan.pp_user_pasien_id','left');
|
||||
$this->db->like("pp_date_pemeriksaan", date("Y-m-d") , "both");
|
||||
$query = $this->db->get('proses_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function search() {
|
||||
if(! $this->input->post('reservation')){
|
||||
$date1 = date("Y-m-d");
|
||||
$date2 = date("Y-m-d");
|
||||
}else{
|
||||
$datemya = explode("-",$this->input->post('reservation'));
|
||||
$date1 = date("Y-m-d", strtotime($datemya[0]));
|
||||
$date2 = date("Y-m-d", strtotime($datemya[1]));
|
||||
}
|
||||
|
||||
$spesialis = "";
|
||||
if($this->input->post('spesialis')!="0"){
|
||||
$this->db->where('pp_spesialis_id', $this->input->post('spesialis'));
|
||||
}
|
||||
$this->db->join('master_spesialis', 'master_spesialis.ms_id = proses_pemeriksaan.pp_spesialis_id','left');
|
||||
$this->db->join('master_ruang', 'master_ruang.mr_id = proses_pemeriksaan.pp_ruang_id','left');
|
||||
$this->db->join('master_user', 'master_user.mu_id = proses_pemeriksaan.pp_user_pasien_id','left');
|
||||
$this->db->where('pp_date_pemeriksaan >=', $date1.' 00:00:00');
|
||||
$this->db->where('pp_date_pemeriksaan <=', $date2.' 23:59:59');
|
||||
$query = $this->db->get('proses_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$originalDate = $this->input->post('tanggal');
|
||||
$originalTime = $this->input->post('waktu');
|
||||
$newDate = date("Y-m-d", strtotime($originalDate));
|
||||
$newTime = date("H:i:s", strtotime($originalTime));
|
||||
$datetime = $newDate." ".$newTime;
|
||||
|
||||
$insert = array(
|
||||
'pp_date_pemeriksaan' => $datetime,
|
||||
'pp_user_pasien_id' => $this->input->post('pasien'),
|
||||
'pp_ruang_id' => $this->input->post('ruang'),
|
||||
'pp_spesialis_id' => $this->input->post('spesialis'),
|
||||
'pp_status' => "1",
|
||||
'pp_jenis_pelayanan' => $this->input->post('pelayanan'),
|
||||
'pp_user_dokter_dpjp_id'=> $this->input->post('dpjp'),
|
||||
'pp_radiologi' => $this->input->post('radiologi'),
|
||||
'pp_lab_pk' => $this->input->post('laborat'),
|
||||
'pp_lab_pa' => $this->input->post('laboratpa'),
|
||||
'pp_lab_mikro' => $this->input->post('laboratmikro'),
|
||||
'pp_user_dokter_id' => $this->input->post('iddokter'),
|
||||
);
|
||||
$insert = $this->db->insert('proses_pemeriksaan', $insert);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$query = '
|
||||
SELECT *,
|
||||
udok.mu_id AS dok_id,
|
||||
udok.mu_nama_lengkap AS dok_nama,
|
||||
|
||||
udpjp.mu_id AS dpjp_id,
|
||||
udpjp.mu_nama_lengkap AS dpjp_nama,
|
||||
|
||||
masp.ms_nama AS sp_nama,
|
||||
masp.ms_kode AS sp_kode,
|
||||
|
||||
upas.mu_id AS pas_id,
|
||||
upas.mu_nama_lengkap AS pas_nama,
|
||||
upas.mu_no_rekamedik AS pas_rm,
|
||||
upas.mu_NIK AS pas_nik,
|
||||
upas.mu_alamat_KTP AS pas_alamat,
|
||||
upas.mu_alamat_domisili AS pas_domisili,
|
||||
upas.mu_telepon_1 AS pas_telp1,
|
||||
upas.mu_telepon_2 AS pas_telp2,
|
||||
upas.mu_tanggal_lahir AS pas_tgl_lahir,
|
||||
upas.mu_gol_darah AS pas_gd,
|
||||
upas.mu_berat_badan AS pas_bb,
|
||||
upas.mu_tinggi_badan AS pas_tb,
|
||||
upas.mu_warna_kulit AS pas_wk,
|
||||
upas.mu_jenis_kelamin AS pas_jk,
|
||||
upas.mu_gambar AS pas_gambar,
|
||||
|
||||
ruang.mr_kode AS ru_id,
|
||||
ruang.mr_kode AS ru_kode,
|
||||
ruang.mr_nama AS ru_nama,
|
||||
|
||||
spdok.ms_nama AS spdok_nama,
|
||||
spdok.ms_kode AS spdok_kode,
|
||||
|
||||
spdpjp.ms_nama AS spdpjp_nama,
|
||||
spdpjp.ms_kode AS spdpjp_kode
|
||||
|
||||
FROM proses_pemeriksaan
|
||||
|
||||
LEFT JOIN master_user AS udok ON (udok.mu_id=pp_user_dokter_id)
|
||||
LEFT JOIN master_user AS upas ON (upas.mu_id=pp_user_pasien_id)
|
||||
LEFT JOIN master_user AS udpjp ON (udpjp.mu_id=pp_user_dokter_dpjp_id)
|
||||
LEFT JOIN master_ruang AS ruang ON (ruang.mr_id=pp_ruang_id)
|
||||
|
||||
LEFT JOIN master_spesialis AS masp ON (masp.ms_id=pp_spesialis_id)
|
||||
LEFT JOIN master_spesialis AS spdok ON (spdok.ms_id=udok.mu_spesialis_id)
|
||||
LEFT JOIN master_spesialis AS spdpjp ON (spdpjp.ms_id=udpjp.mu_spesialis_id)
|
||||
|
||||
WHERE pp_id = '.$id.'
|
||||
';
|
||||
$result = $this->db->query($query);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function proseseditpermin() {
|
||||
$originalDate = $this->input->post('tanggal');
|
||||
$originalTime = $this->input->post('waktu');
|
||||
$newDate = date("Y-m-d", strtotime($originalDate));
|
||||
$newTime = date("H:i:s", strtotime($originalTime));
|
||||
$datetime = $newDate." ".$newTime;
|
||||
|
||||
if($this->input->post('setdat')=="0"){
|
||||
$update = array(
|
||||
'pp_date_pemeriksaan' => $datetime,
|
||||
'pp_user_pasien_id' => $this->input->post('pasien'),
|
||||
'pp_ruang_id' => $this->input->post('ruang'),
|
||||
'pp_spesialis_id' => $this->input->post('spesialis'),
|
||||
'pp_status' => "1",
|
||||
'pp_jenis_pelayanan' => $this->input->post('pelayanan'),
|
||||
'pp_user_dokter_dpjp_id'=> $this->input->post('dpjp'),
|
||||
'pp_radiologi' => $this->input->post('radiologi'),
|
||||
'pp_lab_pk' => $this->input->post('laborat'),
|
||||
'pp_lab_pa' => $this->input->post('laboratpa'),
|
||||
'pp_lab_mikro' => $this->input->post('laboratmikro'),
|
||||
'pp_user_dokter_id' => $this->input->post('iddokter'),
|
||||
);
|
||||
}else{
|
||||
$update = array(
|
||||
'pp_radiologi' => $this->input->post('radiologi'),
|
||||
'pp_lab_pk' => $this->input->post('laborat'),
|
||||
'pp_lab_pa' => $this->input->post('laboratpa'),
|
||||
'pp_lab_mikro' => $this->input->post('laboratmikro'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pp_id', $id);
|
||||
$this->db->update('proses_pemeriksaan', $update);
|
||||
}
|
||||
|
||||
function proseseditupload($nama) {
|
||||
if($this->session->userdata('s_petugas_rssapintar')==1){
|
||||
$insert = array(
|
||||
'pfp_nama' => $nama,
|
||||
'pfp_pp_id' => $this->input->post('id'),
|
||||
'pfp_ket' => 1,
|
||||
'pfp_keterangan' => $this->input->post('ketfileradiologi'),
|
||||
'pfp_datetime' => date("Y-m-d H:i:s"),
|
||||
);
|
||||
$insert = $this->db->insert('proses_file_pemeriksaan', $insert);
|
||||
|
||||
$update = array(
|
||||
'pp_radiologi' => "2",
|
||||
//'pp_date_hasil'=> date("Y-m-d H:i:s"),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pp_id', $id);
|
||||
$this->db->update('proses_pemeriksaan', $update);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==2){
|
||||
$insert = array(
|
||||
'pfp_nama' => $nama,
|
||||
'pfp_pp_id' => $this->input->post('id'),
|
||||
'pfp_ket' => 2,
|
||||
'pfp_keterangan' => $this->input->post('ketfilelab'),
|
||||
'pfp_datetime' => date("Y-m-d H:i:s"),
|
||||
);
|
||||
$insert = $this->db->insert('proses_file_pemeriksaan', $insert);
|
||||
|
||||
$update = array(
|
||||
'pp_lab_pk' => "2",
|
||||
//'pp_date_hasil'=> date("Y-m-d H:i:s"),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pp_id', $id);
|
||||
$this->db->update('proses_pemeriksaan', $update);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==3){
|
||||
$insert = array(
|
||||
'pfp_nama' => $nama,
|
||||
'pfp_pp_id' => $this->input->post('id'),
|
||||
'pfp_ket' => 3,
|
||||
'pfp_keterangan' => $this->input->post('ketfilelabpa'),
|
||||
'pfp_datetime' => date("Y-m-d H:i:s"),
|
||||
);
|
||||
$insert = $this->db->insert('proses_file_pemeriksaan', $insert);
|
||||
|
||||
$update = array(
|
||||
'pp_lab_pa' => "2",
|
||||
//'pp_date_hasil'=> date("Y-m-d H:i:s"),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pp_id', $id);
|
||||
$this->db->update('proses_pemeriksaan', $update);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==4){
|
||||
$insert = array(
|
||||
'pfp_nama' => $nama,
|
||||
'pfp_pp_id' => $this->input->post('id'),
|
||||
'pfp_ket' => 4,
|
||||
'pfp_keterangan' => $this->input->post('ketfilelabmikro'),
|
||||
'pfp_datetime' => date("Y-m-d H:i:s"),
|
||||
);
|
||||
$insert = $this->db->insert('proses_file_pemeriksaan', $insert);
|
||||
|
||||
$update = array(
|
||||
'pp_lab_mikro' => "2",
|
||||
//'pp_date_hasil'=> date("Y-m-d H:i:s"),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pp_id', $id);
|
||||
$this->db->update('proses_pemeriksaan', $update);
|
||||
}
|
||||
}
|
||||
|
||||
function deletefile($id) {
|
||||
$this->db->where('pfp_id', $id);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
$data = $query->result();
|
||||
foreach($data as $dat){
|
||||
if($this->session->userdata('s_petugas_rssapintar')==1){
|
||||
unlink("./document/radiologi/".$dat->pfp_nama);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==2){
|
||||
unlink("./document/lab/".$dat->pfp_nama);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==3){
|
||||
unlink("./document/labpa/".$dat->pfp_nama);
|
||||
}elseif($this->session->userdata('s_petugas_rssapintar')==4){
|
||||
unlink("./document/labmikro/".$dat->pfp_nama);
|
||||
}
|
||||
|
||||
}
|
||||
$this->db->where('pfp_id', $id);
|
||||
$this->db->delete('proses_file_pemeriksaan');
|
||||
}
|
||||
|
||||
function radiologi($id){
|
||||
$this->db->where('pfp_pp_id', $id);
|
||||
$this->db->where('pfp_ket', 1);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function lab($id){
|
||||
$this->db->where('pfp_pp_id', $id);
|
||||
$this->db->where('pfp_ket', 2);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function labpa($id){
|
||||
$this->db->where('pfp_pp_id', $id);
|
||||
$this->db->where('pfp_ket', 3);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function labmikro($id){
|
||||
$this->db->where('pfp_pp_id', $id);
|
||||
$this->db->where('pfp_ket', 4);
|
||||
$query = $this->db->get('proses_file_pemeriksaan');
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
class M_petugas extends CI_Model {
|
||||
function index() {
|
||||
$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->where('mu_tipeuser_id', '4');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$petugas = $this->input->post('petugas');
|
||||
if($this->input->post('petugas')=="5"){
|
||||
$petugas = null;
|
||||
}
|
||||
$insert_userlogin = array(
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "4",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkap'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_petugas_penunjang' => $petugas,
|
||||
);
|
||||
$insert = $this->db->insert('master_user', $insert_userlogin);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$password = $this->input->post('passworduser');
|
||||
$petugas = $this->input->post('petugas');
|
||||
if($this->input->post('petugas')=="5"){
|
||||
$petugas = null;
|
||||
}
|
||||
if(empty($password)){
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkap'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_tipeuser_id' => "4",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_petugas_penunjang' => $petugas,
|
||||
);
|
||||
}else{
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "4",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_petugas_penunjang' => $petugas,
|
||||
);
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_userlogin);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->delete('master_user');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 0,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 1,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
class M_profile extends CI_Model {
|
||||
function index() {
|
||||
//$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->where('mu_id', $this->session->userdata('s_ID_User_rssapintar'));
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function statusaktif() {
|
||||
$this->db->where('mu_status', '1');
|
||||
$this->db->where('mu_tipeuser_id', '6');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert_userlogin = array(
|
||||
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
$insert = $this->db->insert('master_user', $insert_userlogin);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$password = $this->input->post('passworduser');
|
||||
if(empty($password)){
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
}else{
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkappasien'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => "6",
|
||||
'mu_status' => $this->input->post('status'),
|
||||
'mu_no_rekamedik' => $this->input->post('normpasien'),
|
||||
'mu_NIK' => $this->input->post('nikpasien'),
|
||||
'mu_alamat_KTP' => $this->input->post('alamatktp'),
|
||||
'mu_alamat_domisili'=> $this->input->post('alamatdomisili'),
|
||||
'mu_telepon_1' => $this->input->post('telpon1'),
|
||||
'mu_telepon_2' => $this->input->post('telpon2'),
|
||||
'mu_tanggal_lahir' => date("Y-m-d", strtotime($this->input->post('tgllahir'))),
|
||||
'mu_jenis_kelamin' => $this->input->post('jkuser'),
|
||||
'mu_gol_darah' => $this->input->post('golongandarah'),
|
||||
'mu_berat_badan' => $this->input->post('beratbadan'),
|
||||
'mu_tinggi_badan' => $this->input->post('tinggibadan'),
|
||||
'mu_warna_kulit' => $this->input->post('warnakulit'),
|
||||
);
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_userlogin);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->delete('master_user');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 0,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 1,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
class M_proseshistory extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('laporan_proses_history');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert($tabel,$ket) {
|
||||
$insert_data = array(
|
||||
'lph_tabel' => $tabel,
|
||||
'lph_keterangan' => $ket,
|
||||
'lph_query' => $this->db->last_query(),
|
||||
'lph_datetime' => date("Y-m-d H:i"),
|
||||
'lph_user_id' => $this->session->userdata('s_ID_User_rssapintar'),
|
||||
);
|
||||
$insert = $this->db->insert('laporan_proses_history', $insert_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
class M_radiologi extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('master_radiologi');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function status() {
|
||||
$this->db->order_by('mro_nama', 'ASC');
|
||||
$this->db->where('mro_status', 1);
|
||||
$query = $this->db->get('master_radiologi');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function statusdetail() {
|
||||
$this->db->join('master_radiologi', 'master_radiologi.mro_id = master_radiologi_detail.mrod_mro_id','left');
|
||||
$this->db->order_by('mro_nama', 'ASC');
|
||||
$this->db->order_by('mrod_nama', 'ASC');
|
||||
$this->db->where('mrod_status', 1);
|
||||
$query = $this->db->get('master_radiologi_detail');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert = array(
|
||||
'mro_nama' => $this->input->post('nama'),
|
||||
'mro_keterangan' => $this->input->post('keterangan'),
|
||||
'mro_status' => 1,
|
||||
);
|
||||
$insert = $this->db->insert('master_radiologi', $insert);
|
||||
$id = $this->db->insert_id();
|
||||
|
||||
$status = $_POST['statusdetail'];$num=0;
|
||||
foreach($status as $key =>$datanya)
|
||||
{
|
||||
$insert_data = array(
|
||||
'mrod_nama' => $_POST['detail'][$num],
|
||||
'mrod_keterangan' => $_POST['ket'][$num],
|
||||
'mrod_status' => $_POST['statusdetail'][$num],
|
||||
'mrod_mro_id' => $id,
|
||||
);
|
||||
$insert = $this->db->insert('master_radiologi_detail', $insert_data);
|
||||
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mro_id', $id);
|
||||
$query = $this->db->get('master_radiologi');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function editdetail($id) {
|
||||
$this->db->where('mrod_mro_id', $id);
|
||||
$query = $this->db->get('master_radiologi_detail');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$update = array(
|
||||
'mro_nama' => $this->input->post('nama'),
|
||||
'mro_keterangan' => $this->input->post('keterangan'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mro_id', $id);
|
||||
$this->db->update('master_radiologi', $update);
|
||||
|
||||
$status = $_POST['statusdetail'];$num=0;
|
||||
foreach($status as $key =>$datanya)
|
||||
{
|
||||
$data = array(
|
||||
'mrod_nama' => $_POST['detail'][$num],
|
||||
'mrod_keterangan' => $_POST['ket'][$num],
|
||||
'mrod_status' => $_POST['statusdetail'][$num],
|
||||
'mrod_mro_id' => $id,
|
||||
);
|
||||
if($_POST['baru'][$num]=="2"){
|
||||
$this->db->where('mrod_id', $_POST['iddetail'][$num]);
|
||||
$this->db->update('master_radiologi_detail', $data);
|
||||
}else{
|
||||
$insert = $this->db->insert('master_radiologi_detail', $data);
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mro_id', $id);
|
||||
$this->db->delete('master_radiologi');
|
||||
|
||||
$this->db->where('mrod_mro_id', $id);
|
||||
$this->db->delete('master_radiologi_detail');
|
||||
}
|
||||
|
||||
function deletedetail($id) {
|
||||
$this->db->where('mrod_id', $id);
|
||||
$this->db->delete('master_radiologi_detail');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mro_status' => 0,
|
||||
);
|
||||
$this->db->where('mro_id', $id);
|
||||
$this->db->update('master_radiologi', $update_data);
|
||||
|
||||
$update_data_detail = array(
|
||||
'mrod_status' => 0,
|
||||
);
|
||||
$this->db->where('mrod_mro_id', $id);
|
||||
$this->db->update('master_radiologi_detail', $update_data_detail);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mro_status' => 1,
|
||||
);
|
||||
$this->db->where('mro_id', $id);
|
||||
$this->db->update('master_radiologi', $update_data);
|
||||
|
||||
$update_data_detail = array(
|
||||
'mrod_status' => 1,
|
||||
);
|
||||
$this->db->where('mrod_mro_id', $id);
|
||||
$this->db->update('master_radiologi_detail', $update_data_detail);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
class M_resume extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = '
|
||||
SELECT pr_id,pr_diagnosa,pr_tindakan,pr_keterangan,pr_date_resume,pr_status,pr_jenis_pelayanan,
|
||||
udok.mu_id AS dok_id,
|
||||
udok.mu_nama_lengkap AS dok_nama,
|
||||
|
||||
masp.ms_nama AS sp_nama,
|
||||
masp.ms_kode AS sp_kode,
|
||||
|
||||
upas.mu_id AS pas_id,
|
||||
upas.mu_nama_lengkap AS pas_nama,
|
||||
upas.mu_no_rekamedik AS pas_rm,
|
||||
upas.mu_NIK AS pas_nik,
|
||||
upas.mu_alamat_KTP AS pas_alamat,
|
||||
upas.mu_alamat_domisili AS pas_domisili,
|
||||
upas.mu_telepon_1 AS pas_telp1,
|
||||
upas.mu_telepon_2 AS pas_telp2,
|
||||
upas.mu_tanggal_lahir AS pas_tgl_lahir,
|
||||
upas.mu_gol_darah AS pas_gd,
|
||||
upas.mu_berat_badan AS pas_bb,
|
||||
upas.mu_tinggi_badan AS pas_tb,
|
||||
upas.mu_warna_kulit AS pas_wk,
|
||||
upas.mu_jenis_kelamin AS pas_jk,
|
||||
upas.mu_gambar AS pas_gambar,
|
||||
|
||||
ruang.mr_kode AS ru_id,
|
||||
ruang.mr_kode AS ru_kode,
|
||||
ruang.mr_nama AS ru_nama
|
||||
|
||||
FROM proses_resume
|
||||
|
||||
LEFT JOIN master_user AS udok ON (udok.mu_id=pr_user_dokter_id)
|
||||
LEFT JOIN master_user AS upas ON (upas.mu_id=pr_user_pasien_id)
|
||||
LEFT JOIN master_spesialis AS masp ON (masp.ms_id=pr_spesialis_id)
|
||||
LEFT JOIN master_ruang AS ruang ON (ruang.mr_id=pr_ruang_id)
|
||||
|
||||
WHERE pr_date_resume LIKE "%'.date("Y-m-d").'%"
|
||||
';
|
||||
$result = $this->db->query($query);
|
||||
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
function search() {
|
||||
if(! $this->input->post('reservation')){
|
||||
$date1 = date("Y-m-d");
|
||||
$date2 = date("Y-m-d");
|
||||
}else{
|
||||
$datemya = explode("-",$this->input->post('reservation'));
|
||||
$date1 = date("Y-m-d", strtotime($datemya[0]));
|
||||
$date2 = date("Y-m-d", strtotime($datemya[1]));
|
||||
}
|
||||
|
||||
$spesialis = "";
|
||||
if($this->input->post('spesialis')!="0"){
|
||||
$spesialis = 'AND pr_spesialis_id = "'.$this->input->post('spesialis').'"';
|
||||
}
|
||||
$query = '
|
||||
SELECT pr_id,pr_diagnosa,pr_tindakan,pr_keterangan,pr_date_resume,pr_status,pr_jenis_pelayanan,pr_user_dokter_id,pr_spesialis_id,
|
||||
udok.mu_id AS dok_id,
|
||||
udok.mu_nama_lengkap AS dok_nama,
|
||||
|
||||
masp.ms_nama AS sp_nama,
|
||||
masp.ms_kode AS sp_kode,
|
||||
|
||||
upas.mu_id AS pas_id,
|
||||
upas.mu_nama_lengkap AS pas_nama,
|
||||
upas.mu_no_rekamedik AS pas_rm,
|
||||
upas.mu_NIK AS pas_nik,
|
||||
upas.mu_alamat_KTP AS pas_alamat,
|
||||
upas.mu_alamat_domisili AS pas_domisili,
|
||||
upas.mu_telepon_1 AS pas_telp1,
|
||||
upas.mu_telepon_2 AS pas_telp2,
|
||||
upas.mu_tanggal_lahir AS pas_tgl_lahir,
|
||||
upas.mu_gol_darah AS pas_gd,
|
||||
upas.mu_berat_badan AS pas_bb,
|
||||
upas.mu_tinggi_badan AS pas_tb,
|
||||
upas.mu_warna_kulit AS pas_wk,
|
||||
upas.mu_jenis_kelamin AS pas_jk,
|
||||
upas.mu_gambar AS pas_gambar,
|
||||
|
||||
ruang.mr_kode AS ru_id,
|
||||
ruang.mr_kode AS ru_kode,
|
||||
ruang.mr_nama AS ru_nama
|
||||
|
||||
FROM proses_resume
|
||||
|
||||
LEFT JOIN master_user AS udok ON (udok.mu_id=pr_user_dokter_id)
|
||||
LEFT JOIN master_user AS upas ON (upas.mu_id=pr_user_pasien_id)
|
||||
LEFT JOIN master_spesialis AS masp ON (masp.ms_id=pr_spesialis_id)
|
||||
LEFT JOIN master_ruang AS ruang ON (ruang.mr_id=pr_ruang_id)
|
||||
|
||||
WHERE pr_date_resume between "'.$date1.' 00:00:00" AND "'.$date2.' 23:59:59"
|
||||
|
||||
'.$spesialis.'
|
||||
|
||||
';
|
||||
$result = $this->db->query($query);
|
||||
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
function status_petugas() {
|
||||
$this->db->join('master_user', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$this->db->where('pr_status', 1);
|
||||
$query = $this->db->get('proses_resume');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function status_dokter() {
|
||||
$this->db->where('pr_status', 2);
|
||||
$query = $this->db->get('proses_resume');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert_petugas() {
|
||||
$originalDate = $this->input->post('tanggal');
|
||||
$originalTime = $this->input->post('waktu');
|
||||
$newDate = date("Y-m-d", strtotime($originalDate));
|
||||
$newTime = date("H:i:s", strtotime($originalTime));
|
||||
$datetime = $newDate." ".$newTime;
|
||||
|
||||
$insert = array(
|
||||
'pr_user_pasien_id' => $this->input->post('pasien'),
|
||||
'pr_ruang_id' => $this->input->post('ruang'),
|
||||
'pr_spesialis_id' => $this->input->post('spesialis'),
|
||||
'pr_date_resume' => $datetime,
|
||||
'pr_status' => "1",
|
||||
'pr_jenis_pelayanan'=> $this->input->post('pelayanan'),
|
||||
);
|
||||
$insert = $this->db->insert('proses_resume', $insert);
|
||||
}
|
||||
|
||||
function edit_petugas($id) {
|
||||
$query = '
|
||||
SELECT pr_id,pr_diagnosa,pr_tindakan,pr_keterangan,pr_date_resume,pr_status,pr_user_pasien_id,pr_ruang_id,pr_spesialis_id,pr_jenis_pelayanan,
|
||||
udok.mu_id AS dok_id,
|
||||
udok.mu_nama_lengkap AS dok_nama,
|
||||
|
||||
udpjp.mu_id AS dpjp_id,
|
||||
udpjp.mu_nama_lengkap AS dpjp_nama,
|
||||
|
||||
masp.ms_nama AS sp_nama,
|
||||
masp.ms_kode AS sp_kode,
|
||||
|
||||
upas.mu_id AS pas_id,
|
||||
upas.mu_nama_lengkap AS pas_nama,
|
||||
upas.mu_no_rekamedik AS pas_rm,
|
||||
upas.mu_NIK AS pas_nik,
|
||||
upas.mu_alamat_KTP AS pas_alamat,
|
||||
upas.mu_alamat_domisili AS pas_domisili,
|
||||
upas.mu_telepon_1 AS pas_telp1,
|
||||
upas.mu_telepon_2 AS pas_telp2,
|
||||
upas.mu_tanggal_lahir AS pas_tgl_lahir,
|
||||
upas.mu_gol_darah AS pas_gd,
|
||||
upas.mu_berat_badan AS pas_bb,
|
||||
upas.mu_tinggi_badan AS pas_tb,
|
||||
upas.mu_warna_kulit AS pas_wk,
|
||||
upas.mu_jenis_kelamin AS pas_jk,
|
||||
upas.mu_gambar AS pas_gambar,
|
||||
|
||||
ruang.mr_kode AS ru_id,
|
||||
ruang.mr_kode AS ru_kode,
|
||||
ruang.mr_nama AS ru_nama,
|
||||
|
||||
spdok.ms_nama AS spdok_nama,
|
||||
spdok.ms_kode AS spdok_kode,
|
||||
|
||||
spdpjp.ms_nama AS spdpjp_nama,
|
||||
spdpjp.ms_kode AS spdpjp_kode
|
||||
|
||||
FROM proses_resume
|
||||
|
||||
LEFT JOIN master_user AS udok ON (udok.mu_id=pr_user_dokter_id)
|
||||
LEFT JOIN master_user AS upas ON (upas.mu_id=pr_user_pasien_id)
|
||||
LEFT JOIN master_user AS udpjp ON (udpjp.mu_id=pr_user_dokter_dpjp_id)
|
||||
LEFT JOIN master_ruang AS ruang ON (ruang.mr_id=pr_ruang_id)
|
||||
|
||||
LEFT JOIN master_spesialis AS masp ON (masp.ms_id=pr_spesialis_id)
|
||||
LEFT JOIN master_spesialis AS spdok ON (spdok.ms_id=udok.mu_spesialis_id)
|
||||
LEFT JOIN master_spesialis AS spdpjp ON (spdpjp.ms_id=udpjp.mu_spesialis_id)
|
||||
|
||||
WHERE pr_id = '.$id.'
|
||||
';
|
||||
$result = $this->db->query($query);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function proseseditpetugas() {
|
||||
$originalDate = $this->input->post('tanggal');
|
||||
$originalTime = $this->input->post('waktu');
|
||||
$newDate = date("Y-m-d", strtotime($originalDate));
|
||||
$newTime = date("H:i:s", strtotime($originalTime));
|
||||
$datetime = $newDate." ".$newTime;
|
||||
|
||||
$update = array(
|
||||
'pr_user_pasien_id' => $this->input->post('pasien'),
|
||||
'pr_ruang_id' => $this->input->post('ruang'),
|
||||
'pr_spesialis_id' => $this->input->post('spesialis'),
|
||||
'pr_date_resume' => $datetime,
|
||||
//'pr_status' => "1",
|
||||
'pr_jenis_pelayanan'=> $this->input->post('pelayanan'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pr_id', $id);
|
||||
$this->db->update('proses_resume', $update);
|
||||
}
|
||||
|
||||
function proseseditdokter() {
|
||||
$update = array(
|
||||
'pr_user_dokter_id' => $this->input->post('iddokter'),
|
||||
'pr_user_dokter_dpjp_id' => $this->input->post('dpjp'),
|
||||
'pr_diagnosa' => $this->input->post('diagnosa'),
|
||||
'pr_tindakan' => $this->input->post('tindakan'),
|
||||
'pr_keterangan' => $this->input->post('keterangan'),
|
||||
'pr_status' => "2",
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('pr_id', $id);
|
||||
$this->db->update('proses_resume', $update);
|
||||
}
|
||||
|
||||
function deletedokter($id) {
|
||||
$update = array(
|
||||
'pr_user_dokter_id' => null,
|
||||
'pr_user_dokter_dpjp_id' => null,
|
||||
'pr_diagnosa' => null,
|
||||
'pr_tindakan' => null,
|
||||
'pr_keterangan' => null,
|
||||
'pr_status' => "1",
|
||||
);
|
||||
$this->db->where('pr_id', $id);
|
||||
$this->db->update('proses_resume', $update);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('pr_id', $id);
|
||||
$this->db->delete('proses_resume');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
class M_ruangan extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('master_ruang');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function status() {
|
||||
$this->db->where('mr_status', 1);
|
||||
$query = $this->db->get('master_ruang');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function pelayanan($pel) {
|
||||
$this->db->where('mr_status', 1);
|
||||
$this->db->where('mr_pelayanan', $pel);
|
||||
$query = $this->db->get('master_ruang');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert = array(
|
||||
'mr_nama' => $this->input->post('nama'),
|
||||
'mr_kode' => $this->input->post('kode'),
|
||||
'mr_status' => $this->input->post('status'),
|
||||
'mr_pelayanan' => $this->input->post('pelayanan'),
|
||||
);
|
||||
$insert = $this->db->insert('master_ruang', $insert);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mr_id', $id);
|
||||
$query = $this->db->get('master_ruang');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$update = array(
|
||||
'mr_nama' => $this->input->post('nama'),
|
||||
'mr_kode' => $this->input->post('kode'),
|
||||
'mr_status' => $this->input->post('status'),
|
||||
'mr_pelayanan' => $this->input->post('pelayanan'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mr_id', $id);
|
||||
$this->db->update('master_ruang', $update);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mr_id', $id);
|
||||
$this->db->delete('master_ruang');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mr_status' => 0,
|
||||
);
|
||||
$this->db->where('mr_id', $id);
|
||||
$this->db->update('master_ruang', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mr_status' => 1,
|
||||
);
|
||||
$this->db->where('mr_id', $id);
|
||||
$this->db->update('master_ruang', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
class M_spesialis extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('master_spesialis');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function status() {
|
||||
$this->db->where('ms_status', 1);
|
||||
$query = $this->db->get('master_spesialis');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert = array(
|
||||
'ms_nama' => $this->input->post('nama'),
|
||||
'ms_kode' => $this->input->post('kode'),
|
||||
'ms_status' => $this->input->post('status'),
|
||||
);
|
||||
$insert = $this->db->insert('master_spesialis', $insert);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('ms_id', $id);
|
||||
$query = $this->db->get('master_spesialis');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$update = array(
|
||||
'ms_nama' => $this->input->post('nama'),
|
||||
'ms_kode' => $this->input->post('kode'),
|
||||
'ms_status' => $this->input->post('status'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('ms_id', $id);
|
||||
$this->db->update('master_spesialis', $update);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('ms_id', $id);
|
||||
$this->db->delete('master_spesialis');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'ms_status' => 0,
|
||||
);
|
||||
$this->db->where('ms_id', $id);
|
||||
$this->db->update('master_spesialis', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'ms_status' => 1,
|
||||
);
|
||||
$this->db->where('ms_id', $id);
|
||||
$this->db->update('master_spesialis', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
class M_tipeuser extends CI_Model {
|
||||
|
||||
function index() {
|
||||
$query = $this->db->get('master_tipeuser');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function tipeuserstatus() {
|
||||
$this->db->where('mt_status', 1);
|
||||
$query = $this->db->get('master_tipeuser');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert_tipeuser = array(
|
||||
'mt_nama' => $this->input->post('namatipeuser'),
|
||||
'mt_status' => $this->input->post('status'),
|
||||
);
|
||||
$insert = $this->db->insert('master_tipeuser', $insert_tipeuser);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mt_id', $id);
|
||||
$query = $this->db->get('master_tipeuser');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$update_tipeuser = array(
|
||||
'mt_nama' => $this->input->post('namatipeuser'),
|
||||
'mt_status' => $this->input->post('status'),
|
||||
);
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mt_id', $id);
|
||||
$this->db->update('master_tipeuser', $update_tipeuser);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mt_id', $id);
|
||||
$this->db->delete('master_tipeuser');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mt_status' => 0,
|
||||
);
|
||||
$this->db->where('mt_id', $id);
|
||||
$this->db->update('master_tipeuser', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mt_status' => 1,
|
||||
);
|
||||
$this->db->where('mt_id', $id);
|
||||
$this->db->update('master_tipeuser', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
class M_userlogin extends CI_Model {
|
||||
function index() {
|
||||
$this->db->join('master_tipeuser', 'master_tipeuser.mt_id = master_user.mu_tipeuser_id','left');
|
||||
$query = $this->db->get('master_user');
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function insert() {
|
||||
$insert_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkapuser'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => $this->input->post('tipeuser'),
|
||||
'mu_status' => $this->input->post('status'),
|
||||
);
|
||||
$insert = $this->db->insert('master_user', $insert_userlogin);
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$query = $this->db->get('master_user');
|
||||
return $query;
|
||||
}
|
||||
|
||||
function prosesedit() {
|
||||
$loketdat = $this->input->post('loket');if(empty($loketdat)){$loketdat=null;}
|
||||
$klinik = $this->input->post('klinik');if(empty($klinik)){$klinik=null;}
|
||||
$password = $this->input->post('passworduser');
|
||||
if(empty($password)){
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkapuser'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_tipeuser_id' => $this->input->post('tipeuser'),
|
||||
'mu_status' => $this->input->post('status'),
|
||||
);
|
||||
}else{
|
||||
$update_userlogin = array(
|
||||
'mu_nama_lengkap' => $this->input->post('namalengkapuser'),
|
||||
'mu_nama_user' => $this->input->post('namauser'),
|
||||
'mu_password' => md5($this->input->post('passworduser')),
|
||||
'mu_tipeuser_id' => $this->input->post('tipeuser'),
|
||||
'mu_status' => $this->input->post('status'),
|
||||
);
|
||||
}
|
||||
$id = $this->input->post('id');
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_userlogin);
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->delete('master_user');
|
||||
}
|
||||
|
||||
function disabled($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 0,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
|
||||
function aktif($id) {
|
||||
$update_data = array(
|
||||
'mu_status' => 1,
|
||||
);
|
||||
$this->db->where('mu_id', $id);
|
||||
$this->db->update('master_user', $update_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user