57 lines
2.1 KiB
PHP
57 lines
2.1 KiB
PHP
<?php
|
|
class M_screen extends CI_Model {
|
|
function index() {
|
|
$query = $this->db->get('master_klinik');
|
|
return $query->result();
|
|
}
|
|
|
|
function info_pp($mlscreen) {
|
|
$this->db->join('proses_ruang_tunggu', 'prt_pengunjung_id = pp_id', 'LEFT');
|
|
$this->db->join('master_klinik', 'mk_id = pp_klinik_id','LEFT');
|
|
$this->db->where('mk_screen', $mlscreen);
|
|
$this->db->where('prt_status', '5');
|
|
$this->db->where('pp_tanggal_periksa', date("Y-m-d"));
|
|
$query = $this->db->get('proses_pengunjung');
|
|
return $query->result();
|
|
}
|
|
|
|
function master_klinik($mlscreen) {
|
|
$this->db->where('mk_screen', $mlscreen);
|
|
$this->db->order_by('mk_nama', 'asc');
|
|
$query = $this->db->get('master_klinik');
|
|
return $query->result();
|
|
}
|
|
|
|
function edit($ketscr) {
|
|
$this->db->where('mk_screen', $ketscr);
|
|
$query = $this->db->get('master_klinik');
|
|
return $query;
|
|
}
|
|
|
|
function prosesedit() {
|
|
$totnum = $this->input->post('lastnumber');
|
|
for($i=1;$i<=$totnum;$i++){
|
|
$update_kl = array(
|
|
'mk_screen' => $this->input->post('sc'.$i),
|
|
);
|
|
$id = $this->input->post('idk'.$i);
|
|
$this->db->where('mk_id', $id);
|
|
$this->db->update('master_klinik', $update_kl);
|
|
}
|
|
}
|
|
|
|
function pengunjung($idloket) {
|
|
$this->db->order_by('pp_fasttrack', 'desc');
|
|
$this->db->order_by('pp_tanggal_datang', 'DESC');
|
|
$this->db->join('proses_pengunjung', 'pp_id = prt_pengunjung_id', 'left');
|
|
$this->db->join('master_klinik', 'mk_id = pp_klinik_id', 'left');
|
|
$this->db->where('pp_tanggal_periksa', date('Y-m-d'));
|
|
$this->db->where('pp_loket', $idloket);
|
|
//$this->db->where('pp_loket', $this->session->userdata('s_loket'));
|
|
$this->db->where('prt_aktif ', '0');
|
|
$this->db->where('prt_status <', '5');
|
|
$query = $this->db->get('proses_ruang_tunggu');
|
|
return $query->result();
|
|
}
|
|
}
|
|
?>
|