112 lines
4.0 KiB
PHP
112 lines
4.0 KiB
PHP
<?php
|
|
class M_loketranap extends CI_Model {
|
|
|
|
function index() {
|
|
$this->db->join('master_loket', 'ml_id = ppr_loket', 'LEFT');
|
|
$this->db->where('ppr_status <=', "2");
|
|
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
|
|
|
$this->db->order_by('ppr_tanggal_periksa', 'ASC');
|
|
$this->db->order_by('ppr_status', 'ASC');
|
|
$query = $this->db->get('proses_pengunjung_ranap');
|
|
return $query->result();
|
|
}
|
|
|
|
function datapengunjung($id) {
|
|
$this->db->where('ppr_id', $id);
|
|
$query = $this->db->get('proses_pengunjung_ranap');
|
|
return $query;
|
|
}
|
|
|
|
function searchloket() {
|
|
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
|
$this->db->where('ppr_status', "1");
|
|
$this->db->where('ppr_loket', $this->session->userdata('s_loket'));
|
|
$query = $this->db->get('proses_pengunjung_ranap');
|
|
return $query;
|
|
}
|
|
|
|
function datapanggil() {
|
|
$this->db->join('master_loket', 'ml_id = ppr_loket', 'LEFT');
|
|
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
|
$this->db->where('ppr_status <=', "2");
|
|
$this->db->where('ppr_loket is NULL', NULL, TRUE);
|
|
$this->db->where('ppr_callsound is NULL', NULL, FALSE);
|
|
$this->db->order_by('ppr_callsound', 'ASC');
|
|
$query = $this->db->get('proses_pengunjung_ranap');
|
|
return $query->result();
|
|
}
|
|
|
|
function datapanggilsuara() {
|
|
$this->db->join('master_loket', 'ml_id = ppr_loket', 'LEFT');
|
|
$this->db->like('ppr_tanggal_periksa', date("Y-m-d"));
|
|
$this->db->where('ppr_loket is NOT NULL', NULL, FALSE);
|
|
$this->db->where('ppr_callsound is NOT NULL', NULL, FALSE);
|
|
$this->db->order_by('ppr_callsound', 'DESC');
|
|
$query = $this->db->get('proses_pengunjung_ranap');
|
|
return $query->result();
|
|
}
|
|
|
|
function dataloket() {
|
|
$this->db->join('master_loket', 'ml_id = mu_loket_id', 'LEFT');
|
|
$this->db->where('mu_tipeuser_id', "7");
|
|
$query = $this->db->get('master_user');
|
|
return $query->result();
|
|
}
|
|
|
|
// function insertpengunjung() {
|
|
//
|
|
// $no_antrian;
|
|
// $hasil_nomor = "";
|
|
// $this->db->order_by('ppr_nomor_antrian', 'ASC');
|
|
// $this->db->where('ppr_tanggal_periksa', date("Y-m-d"));
|
|
// $query = $this->db->get('proses_pengunjung_ranap');
|
|
// foreach ($query->result() as $datpengunjung){
|
|
// $no_antrian = $datpengunjung->ppr_nomor_antrian;
|
|
// }
|
|
//
|
|
// if(isset($no_antrian)){
|
|
// $hasil_nomor = $no_antrian+1;
|
|
// $nomjum = strlen($hasil_nomor);$nol="";
|
|
// if($nomjum=="1"){$nol="00";}
|
|
// elseif($nomjum=="2"){$nol="0";}
|
|
// $hasil_nomor=$nol.$hasil_nomor;
|
|
// }else {
|
|
// $hasil_nomor="001";
|
|
// }
|
|
//
|
|
// $insert = array(
|
|
// 'ppr_nomor_antrian' => $hasil_nomor,
|
|
// 'ppr_tanggal_periksa' => date("Y-m-d"),
|
|
// 'ppr_status' => "0",
|
|
// );
|
|
// $this->db->insert('proses_pengunjung_ranap', $insert);
|
|
// }
|
|
//
|
|
// 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'),
|
|
// );
|
|
// $id = $this->input->post('id');
|
|
// $this->db->where('mt_id', $id);
|
|
// $this->db->update('master_tipeuser', $update_tipeuser);
|
|
// }
|
|
//
|
|
// function view($id) {
|
|
// $this->db->where('mt_id', $id);
|
|
// $query = $this->db->get('master_tipeuser');
|
|
// return $query;
|
|
// }
|
|
//
|
|
// function delete($id) {
|
|
// $this->db->where('mt_id', $id);
|
|
// $this->db->delete('master_tipeuser');
|
|
// }
|
|
}
|
|
?>
|