add rssa-pintar to git
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user