61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
<?php
|
|
class M_fasttrack extends CI_Model {
|
|
|
|
function index() {
|
|
//$this->db->order_by("mk_nama", "asc");
|
|
$this->db->order_by('pp_fasttrack', 'DESC');
|
|
$this->db->join('master_klinik', 'mk_id = pp_klinik_id');
|
|
$this->db->join('proses_ruang_tunggu', 'prt_pengunjung_id = pp_id', 'left');
|
|
$this->db->where('pp_tanggal_periksa', date("Y-m-d"));
|
|
$query = $this->db->get('proses_pengunjung');
|
|
return $query->result();
|
|
}
|
|
|
|
function selectpasien($id) {
|
|
$this->db->join('master_klinik', 'mk_id = pp_klinik_id');
|
|
$this->db->where('pp_id', $id);
|
|
$this->db->where('pp_tanggal_periksa', date("Y-m-d"));
|
|
$query = $this->db->get('proses_pengunjung');
|
|
return $query->result();
|
|
}
|
|
|
|
function setfastrack(){
|
|
$id = $this->input->post('idpengunjung');
|
|
$pj = $this->input->post('penanggungjawab');
|
|
$rm = $this->input->post('norek');
|
|
$np = $this->input->post('namapas');
|
|
$ke = $this->input->post('ket');
|
|
|
|
$rafast = $pj."|".$np."|".$ke."|";
|
|
|
|
$update_fastrack = array(
|
|
'pp_fasttrack' => $rafast,
|
|
'pp_rekamedik' => $rm,
|
|
);
|
|
$this->db->where('pp_id', $id);
|
|
$this->db->update('proses_pengunjung', $update_fastrack);
|
|
|
|
if($this->input->post('ppstatus')==1){
|
|
$update_prt = array(
|
|
'prt_status' => 1,
|
|
);
|
|
$this->db->where('prt_pengunjung_id', $id);
|
|
$this->db->update('proses_ruang_tunggu', $update_prt);
|
|
}else{
|
|
$update_pp = array(
|
|
'pp_status' => 1,
|
|
);
|
|
$this->db->where('pp_id', $id);
|
|
$this->db->update('proses_pengunjung', $update_pp);
|
|
|
|
$insert_prt = array(
|
|
'prt_status' => 1,
|
|
'prt_tanggal' => date("Y-m-d H:i:s"),
|
|
'prt_aktif' => 0,
|
|
'prt_pengunjung_id' => $id,
|
|
);
|
|
$insert = $this->db->insert('proses_ruang_tunggu', $insert_prt);
|
|
}
|
|
}
|
|
}
|
|
?>
|