function form_training($id = null) { $sess_id = $this->session->userdata('user_id'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } $this->db->select('training.*, training.id as id,users.nik as nik, users.username as name,penyelenggara.title as penyelenggara, pembiayaan.title as pembiayaan, status_lv1.title as approval_status_lv1, status_lv2.title as approval_status_lv2'); $this->db->from('users_training as training'); $this->db->join('users', 'users.id = training.user_id', 'LEFT'); $this->db->join('penyelenggara', 'training.penyelenggara_id = penyelenggara.id', 'LEFT'); $this->db->join('pembiayaan', 'training.pembiayaan_id = pembiayaan.id', 'LEFT'); $this->db->join('approval_status as status_lv1', 'training.approval_status_id_lv1 = status_lv1.id', 'left'); $this->db->join('approval_status as status_lv2', 'training.approval_status_id_lv2 = status_lv2.id', 'left'); if ($id != null) { $this->db->where('training.id', $id); } $this->db->where('training.is_deleted', 0); $this->db->where("(training.user_id= {$sess_id} {$sub_id})", null, false); $q = $this->db->get(); return $q; }
function form_absen($id = null) { $sess_id = $this->session->userdata('user_id'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } $this->db->select('absen.*, absen.id as id, absen.date_tidak_hadir as date, users.username as name,keterangan_absen.id as keterangan_id, keterangan_absen.title as keterangan_absen'); $this->db->from('users_keterangan_absen as absen'); $this->db->join('users', 'users.id = absen.user_id', 'LEFT'); $this->db->join('comp_session', 'absen.id_comp_session = comp_session.id', 'LEFT'); $this->db->join('keterangan_absen', 'absen.keterangan_id = keterangan_absen.id', 'LEFT'); if ($id != null) { $this->db->where('absen.id', $id); } $this->db->where("(absen.user_id= {$sess_id} {$sub_id} {$subsub_id} )", null, false); $this->db->where('absen.is_deleted', 0); $q = $this->db->get(); return $q; }
function form_exit($id = null) { $sess_id = $this->session->userdata('user_id'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } $admin = $this->ion_auth->is_admin() || $this->ion_auth->is_admin_bagian(); //$this->db->select('users_exit.id as id, users_exit.user_id, exit_type.title as exit_type, users_exit.date_exit, users_exit.created_on as date_created, users_exit.is_app,users_exit.user_app, users_exit.date_app,users_exit.note_app, users_exit.is_app_mgr, users_exit.user_app_mgr, users_exit.date_app_mgr, users_exit.is_app_koperasi, users_exit.user_app_koperasi, users_exit.date_app_koperasi,users_exit.is_app_perpus, users_exit.user_app_perpus, users_exit.date_app_perpus,users_exit.is_app_hrd, users_exit.user_app_hrd, users_exit.date_app_hrd, users_exit_inventaris.*, users_exit_rekomendasi.*'); $this->db->select('users_exit.*, exit_type.title as exit_type'); $this->db->from('users_exit'); $this->db->join('users', 'users.id = users_exit.user_id', 'LEFT'); $this->db->join('exit_type', 'users_exit.exit_type_id = exit_type.id', 'LEFT'); $this->db->where('users_exit.is_deleted', 0); if ($admin != 1) { $this->db->where("(users_exit.user_id= {$sess_id} {$sub_id})", null, false); } if ($id != null) { $this->db->where('users_exit.id', $id); } $this->db->where('is_purposed', 1); //$this->db->where('users_exit.user_id', $sess_id); $this->db->order_by('users_exit.id', 'desc'); $q = $this->db->get(); return $q; }
<th width="10%" style="text-align:center;">APPR SPV</th> <th width="10%" style="text-align:center;">APPR HRD</th> </tr> </thead> <tbody> <?php if ($form_training->num_rows() > 0) { foreach ($form_training->result() as $user) { $id_training = $user->id; $session_id = get_nik($this->session->userdata('user_id')); $id_user = $this->session->userdata('user_id'); $txt_app_lv1 = $txt_app_lv2 = $txt_app_lv3 = "-"; // approval training //Approval Level 1 if (!empty(is_have_subordinate($session_id))) { if (cek_subordinate(is_have_subordinate($session_id), 'id', $user->user_id)) { if ($user->is_app_lv1 == 0) { $txt_app_lv1 = "<a href='" . site_url('form_training/approval_spv/' . $user->id) . "''>\n <button type='button' class='btn btn-info btn-small' title='Make Approval'><i class='icon-paste'></i></button>\n </a>"; } else { $txt_app_lv1 = "<a href='" . site_url('form_training/approval_spv/' . $user->id) . "''>Ya</a>"; } } elseif ($user->is_app_lv1 == 1) { $txt_app_lv1 = "<a href='" . site_url('form_training/approval_spv/' . $user->id) . "''>Ya</a>"; } elseif ($user->is_app_lv1 == 0) { $txt_app_lv1 = '-'; } } else { if ($user->is_app_lv1 == 1) { $txt_app_lv1 = "<a href='" . site_url('form_training/approval_spv/' . $user->id) . "''>Ya</a>"; } }
function get_subsubordinate($id) { $x = ''; //print_mz(is_have_subordinate(get_nik(20))); $input = is_have_subordinate(get_nik($id)); //print_r($input); if (!empty($input)) { $output = implode(', ', array_column($input, 'id')); $exp = explode(',', $output); for ($i = 0; $i < 1; $i++) { $y = get_nik($exp[$i]); $x .= 'superior_id=' . "'{$y}'"; } for ($i = 1; $i < sizeof($exp); $i++) { $y = get_nik($exp[$i]); $x .= ' OR superior_id=' . "'{$y}'"; } return $x; } }
<h3>Widget Settings</h3> </div> <div class="modal-body"> Widget settings form goes here </div> </div> <div class="clearfix"></div> <div class="content"> <div id="container"> <div class="row"> <div class="col-md-12"> <div class="grid simple "> <div class="grid-title no-border"> <h4>Daftar Permintaan <span class="semi-bold">Pelatihan</span></h4> <?php if (is_have_subordinate($sess_id) || is_admin() || is_admin_bagian()) { ?> <div class="tools"> <a href="<?php echo site_url('form_training/input'); ?> " class="config"></a> </div> <?php } ?> </div> <div class="grid-body no-border"> <br/> <?php echo form_open(site_url('form_training/keywords'));
/** * form_spd_luar * * @return object form_spd_luar * @author Deni **/ public function form_spd_luar($id = null) { $this->trigger_events('form_spd_luar'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_admin = is_admin(); $is_approver = $this->approval->approver('dinas'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_spd_luar'] . '.*', $this->tables['users_spd_luar'] . '.id as id', $this->tables['users_spd_luar'] . '.id as form_spd_luar_id', $this->tables['transportation'] . '.title as transportation_nm', 'city_to.title as city_to', 'city_from.title as city_from')); $this->db->join('users', 'users.nik = users_spd_luar.task_receiver', 'LEFT'); $this->db->join('users as creator', 'creator.nik = users_spd_luar.task_creator', 'LEFT'); $this->db->join('transportation', 'users_spd_luar.transportation_id = transportation.id'); $this->db->join('city as city_to', 'users_spd_luar.to_city_id = city_to.id'); $this->db->join('city as city_from', 'users_spd_luar.from_city_id = city_from.id'); if ($id != null) { $this->db->where('users_spd_luar.id', $id); } if ($is_approver !== $sess_nik && $is_admin != 1) { $this->db->where("(users_spd_luar.task_receiver = '{$sess_nik}' OR users_spd_luar.task_creator = '{$sess_nik}' OR users_spd_luar.created_by = '{$sess_id}'\n OR users_spd_luar.user_app_lv1 = '{$sess_nik}' OR users_spd_luar.user_app_lv2 = '{$sess_nik}' OR users_spd_luar.user_app_lv3 = '{$sess_nik}' \n )", null, false); } $this->db->where('users_spd_luar.is_deleted', 0); $this->db->order_by('users_spd_luar.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_where) && !empty($this->_ion_where)) { foreach ($this->_ion_where as $where) { $this->db->where($where); } $this->_ion_where = array(); } if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_spd_luar']); return $this; }
<h3>Widget Settings</h3> </div> <div class="modal-body"> Widget settings form goes here </div> </div> <div class="clearfix"></div> <div class="content"> <div id="container"> <div class="row"> <div class="col-md-12"> <div class="grid simple "> <div class="grid-title no-border"> <h4>Daftar Pengajuan <span class="semi-bold">Demotion</span></h4> <?php if (is_have_subordinate($sess_id) || is_admin() || $this->approval->approver('demosi') == $sess_nik) { ?> <div class="tools"> <a href="<?php echo site_url('form_demotion/input'); ?> " class="config"></a> </div> <?php } ?> </div> <div class="grid-body no-border"> <?php if ($_num_rows > 0) { ?>
/** * form_exit * * @return object form_exit * @author Deni **/ public function form_exit($id = null) { $this->trigger_events('form_exit'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_admin = is_admin() || is_admin_inventaris(); $is_approver = $this->approval->approver('exit'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_exit'] . '.*', $this->tables['users_exit'] . '.id as id', 'exit_type.title as exit_type', 'status_lv1.title as approval_status_lv1', 'status_lv2.title as approval_status_lv2', 'status_lv3.title as approval_status_lv3', 'status_hrd.title as approval_status_hrd', 'status_hrd.title as approval_status_it', 'status_hrd.title as approval_status_mgr', 'status_hrd.title as approval_status_koperasi', 'status_hrd.title as approval_status_perpus', 'status_asset.title as approval_status_asset')); $this->db->join('users', 'users.id = users_exit.user_id', 'LEFT'); $this->db->join('exit_type', 'users_exit.exit_type_id = exit_type.id', 'LEFT'); $this->db->join('approval_status as status_lv1', 'users_exit.app_status_id_lv1 = status_lv1.id', 'left'); $this->db->join('approval_status as status_lv2', 'users_exit.app_status_id_lv2 = status_lv2.id', 'left'); $this->db->join('approval_status as status_lv3', 'users_exit.app_status_id_lv3 = status_lv3.id', 'left'); $this->db->join('approval_status as status_hrd', 'users_exit.app_status_id_hrd = status_hrd.id', 'left'); $this->db->join('approval_status as status_it', 'users_exit.app_status_id_it = status_it.id', 'left'); $this->db->join('approval_status as status_mgr', 'users_exit.app_status_id_mgr = status_mgr.id', 'left'); $this->db->join('approval_status as status_perpus', 'users_exit.app_status_id_perpus = status_perpus.id', 'left'); $this->db->join('approval_status as status_koperasi', 'users_exit.app_status_id_koperasi = status_koperasi.id', 'left'); $this->db->join('approval_status as status_asset', 'users_exit.app_status_id_asset = status_asset.id', 'left'); if ($id != null) { $this->db->where('users_exit.id', $id); } if ($is_approver !== $sess_nik && $is_admin != 1) { //$this->db->where("(users_exit.user_id= $sess_id $sub_id $subsub_id )",null, false); $this->db->where("(users_exit.user_id = {$sess_id} OR users_exit.user_app_lv1 = '{$sess_nik}' OR users_exit.user_app_lv2 = '{$sess_nik}' OR users_exit.user_app_lv3 = '{$sess_nik}' OR users_exit.user_app_asset = '{$sess_nik}' OR users_exit.created_by = '{$sess_id}')", null, false); } $this->db->where('is_purposed', 1); $this->db->order_by('users_exit.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_exit']); return $this; }
public function form_cuti_supervisor($id) { $this->trigger_events('form_cuti_supervisor'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $is_admin = is_admin(); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_cuti'] . '.*', $this->tables['users_cuti'] . '.id as id', $this->tables['alasan_cuti'] . '.title as alasan_cuti', $this->tables['comp_session'] . '.year as session_year', $this->tables['users'] . '.username as name', 'status_lv1.title as approval_status_lv1', 'status_lv2.title as approval_status_lv2', 'status_lv3.title as approval_status_lv3', 'status_hrd.title as approval_status_hrd')); $this->db->join('alasan_cuti', 'users_cuti.alasan_cuti_id = alasan_cuti.HRSLEAVETYPEID', 'left'); $this->db->join('comp_session', 'users_cuti.id_comp_session = comp_session.id', 'left'); $this->db->join('users', 'users_cuti.user_id = users.id', 'left'); $this->db->join('approval_status as status_lv1', 'users_cuti.approval_status_id_lv1 = status_lv1.id', 'left'); $this->db->join('approval_status as status_lv2', 'users_cuti.approval_status_id_lv2 = status_lv2.id', 'left'); $this->db->join('approval_status as status_lv3', 'users_cuti.approval_status_id_lv3 = status_lv3.id', 'left'); $this->db->join('approval_status as status_hrd', 'users_cuti.approval_status_id_hrd = status_hrd.id', 'left'); $this->db->where('users_cuti.id', $id); if ($is_admin != 1) { //$this->db->where("(users_cuti.user_id= $sess_id $sub_id $subsub_id )",null, false); } $this->db->order_by('users_cuti.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_cuti']); return $this; }
<div class="col-md-12"> <br/> <p class="wf-approve-sp"> <?php if ($absen->is_app_lv1 == 1) { ?> <span class="semi-bold"><?php echo $name_app_lv1; ?> </span><br/> <span class="small"><?php echo $absen->date_app_lv1; ?> </span> <?php } elseif (cek_subordinate(is_have_subordinate($session_nik), 'id', $absen->user_id)) { if ($absen->is_app_lv1 == 0) { ?> <button class="btn btn-danger btn-cons" id="btn_app_lv1" type=""><i class="icon-ok"></i>Approve</button> <?php } } ?> <p class="">(Supervisor)</p> </div> </div> </div> </div> </form> <?php }
/** * recruitment * * @return object recruitment * @author Abdul Ghanni **/ public function recruitment($id = null) { $this->trigger_events('recruitment'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $admin = is_admin(); $is_approver = $this->approval->approver('recruitment'); $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['recruitment'] . '.*', $this->tables['recruitment'] . '.id as id', $this->tables['recruitment'] . '.created_on as date_created', 'kualifikasi' . '.*', 'kemampuan' . '.*', 'status.title as status', 'urgensi.title as urgensi', 'jurusan.title as jurusan', 'ipk.title as ipk', 'toefl.title as toefl', 'brevet.title as brevet')); $this->db->join('users', 'users_recruitment.user_id = users.id', 'left'); $this->db->join('users_recruitment_kualifikasi as kualifikasi', 'users_recruitment.user_kualifikasi_id = kualifikasi.id', 'left'); $this->db->join('users_recruitment_kemampuan as kemampuan', 'users_recruitment.user_kemampuan_id = kemampuan.id', 'left'); $this->db->join('recruitment_status as status', 'users_recruitment.status_id = status.id', 'left'); $this->db->join('recruitment_urgensi as urgensi', 'users_recruitment.urgensi_id = urgensi.id', 'left'); $this->db->join('recruitment_jurusan as jurusan', 'kualifikasi.jurusan = jurusan.id', 'left'); $this->db->join('recruitment_brevet as brevet', 'kemampuan.brevet_id = brevet.id', 'left'); $this->db->join('ipk as ipk', 'kualifikasi.ipk = ipk.id', 'left'); $this->db->join('toefl as toefl', 'kualifikasi.toefl = toefl.id', 'left'); $this->db->where('users_recruitment.is_deleted', 0); //$this->db->where('users.active', 0); //$this->db->where('receiver_id', (!empty($nik)) ? $nik : $this->session->userdata('user_id')); $this->db->order_by('users_recruitment.id', 'desc'); if ($is_approver !== $sess_nik && $admin != 1) { //$this->db->where("(users_recruitment.user_id= $sess_id $sub_id $subsub_id )",null, false); $this->db->where("(users_recruitment.user_id = {$sess_id} OR users_recruitment.user_app_lv1 = '{$sess_nik}' OR users_recruitment.user_app_lv2 = '{$sess_nik}' OR users_recruitment.user_app_lv3 = '{$sess_nik}' OR users_recruitment.created_by = '{$sess_id}')", null, false); } if ($id != null) { $this->db->where('users_recruitment.id', $id); } } if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['recruitment']); return $this; }
$rejected = assets_url('img/rejected_stamp.png'); if ($row->is_app_lv1 == 1) { echo $row->approval_status_id_lv1 == 1 ? "<img class=approval_img_md src={$approved}>" : ($row->approval_status_id_lv1 == 2 ? "<img class=approval_img_md src={$rejected}>" : ''); ?> <br/> <span class="semi-bold"><?php echo get_name($row->user_app_lv1); ?> </span><br/> <span class="semi-bold">Supervisor</span><br/> <span class="small"><?php echo dateIndo($row->date_app_lv1); ?> </span><br/> <?php } elseif ($row->is_app_lv1 == 0 && cek_subordinate(is_have_subordinate($session_id), 'id', $row->user_id) == TRUE) { ?> <div class="btn btn-success btn-cons" data-toggle="modal" data-target="#submitrecruitmentspvModal"><i class="icon-ok"></i>Submit</div> <span class="small"></span><br/> <?php } else { ?> <span class="semi-bold"></span><br/> <span class="small"></span><br/> <?php } ?> </p> </div> <div class="col-md-3">
public function form_absen_detail($id) { $this->trigger_events('form_absen_supervisor'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $is_admin = is_admin(); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_absen'] . '.*', $this->tables['users_absen'] . '.id as id', $this->tables['keterangan_absen'] . '.title as keterangan_absen', $this->tables['comp_session'] . '.year as session_year', $this->tables['users'] . '.username as name')); $this->db->join('keterangan_absen', 'users_absen.keterangan_id = keterangan_absen.id', 'left'); $this->db->join('comp_session', 'users_absen.id_comp_session = comp_session.id', 'left'); $this->db->join('users', 'users_absen.user_id = users.id', 'left'); $this->db->where('users_absen.id', $id); if ($is_admin != 1) { //$this->db->where("(users_absen.user_id= $sess_id $sub_id $subsub_id )",null, false); } $this->db->order_by('users_absen.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_absen']); return $this; }
/** * form_training_group * * @return object form_training_group * @author Deni **/ public function form_training_group($id = null) { $this->trigger_events('form_training_group'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_approver = $this->approval->approver('training'); $is_admin = is_admin(); $is_admin_legal = is_admin_legal(); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_training_group'] . '.*', $this->tables['users_training_group'] . '.id as id', $this->tables['penyelenggara'] . '.title as penyelenggara', $this->tables['pembiayaan'] . '.title as pembiayaan', $this->tables['training_type'] . '.title as training_type', 'training_ikatan_dinas.title as ikatan', 'training_waktu.title as waktu', 'status_lv1.title as approval_status_lv1', 'status_lv2.title as approval_status_lv2', 'status_lv3.title as approval_status_lv3', 'status_hrd.title as approval_status_hrd')); $this->db->join('users', 'users_training_group.user_pengaju_id = users.id', 'left'); $this->db->join('penyelenggara', 'users_training_group.penyelenggara_id = penyelenggara.id', 'LEFT'); $this->db->join('pembiayaan', 'users_training_group.pembiayaan_id = pembiayaan.id', 'LEFT'); $this->db->join('training_type', 'users_training_group.training_type_id = training_type.id', 'LEFT'); $this->db->join('training_ikatan_dinas', 'users_training_group.ikatan_dinas_id = training_ikatan_dinas.id', 'LEFT'); $this->db->join('training_waktu', 'users_training_group.waktu_id = training_waktu.id', 'LEFT'); $this->db->join('approval_status as status_lv1', 'users_training_group.approval_status_id_lv1 = status_lv1.id', 'left'); $this->db->join('approval_status as status_lv2', 'users_training_group.approval_status_id_lv2 = status_lv2.id', 'left'); $this->db->join('approval_status as status_lv3', 'users_training_group.approval_status_id_lv3 = status_lv3.id', 'left'); $this->db->join('approval_status as status_hrd', 'users_training_group.approval_status_id_hrd = status_hrd.id', 'left'); if ($id != null) { $this->db->where('users_training_group.id', $id); } if ($is_approver !== $sess_nik && $is_admin != 1 && $is_admin_legal != 1) { //$this->db->where("(users_training_group.user_id= $sess_id $sub_id $subsub_id )",null, false); $this->db->where("(users_training_group.user_pengaju_id = {$sess_id} OR users_training_group.user_peserta_id like '%{$sess_nik}%' OR users_training_group.user_app_lv1 = '{$sess_nik}' OR users_training_group.user_app_lv2 = '{$sess_nik}' OR users_training_group.user_app_lv3 = '{$sess_nik}' OR users_training_group.created_by = '{$sess_id}')", null, false); } $this->db->order_by('users_training_group.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_training_group']); return $this; }
/** * form_medical * * @return object form_medical * @author Deni **/ public function form_medical($id = null) { $this->trigger_events('form_medical'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_approver = $this->approval->approver('medical'); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } $is_admin = is_admin(); //default selects $this->db->select(array($this->tables['users_medical'] . '.*', $this->tables['users_medical'] . '.id as id')); $this->db->join('users', 'users.id = users_medical.user_id', 'LEFT'); if ($id != null) { $this->db->where('users_medical.id', $id); } //$this->db->where('users_medical.is_deleted', 0); if ($is_approver !== $sess_nik && $is_admin != 1) { $this->db->where("(users_medical.user_id = {$sess_id} OR users_medical.user_app_lv1 = '{$sess_nik}' OR users_medical.user_app_lv2 = '{$sess_nik}' OR users_medical.user_app_lv3 = '{$sess_nik}' OR users_medical.created_by = '{$sess_id}')", null, false); } $this->db->order_by('users_medical.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_medical']); return $this; }
/** * form_resignment * * @return object form_resignment * @author Deni **/ public function form_resignment($id = null) { $this->trigger_events('form_resignment'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_approver = $this->approval->approver('resignment'); $is_admin = is_admin(); $is_admin_payroll = is_admin_payroll(); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } //default selects $this->db->select(array($this->tables['users_resignment'] . '.*', $this->tables['users_resignment'] . '.id as id', 'status_lv1.title as approval_status_lv1', 'status_lv2.title as approval_status_lv2', 'status_lv3.title as approval_status_lv3', 'status_hrd.title as approval_status_hrd', 'users_resignment_wawancara.alasan_resign_id', 'users_resignment_wawancara.desc_resign', 'users_resignment_wawancara.procedure_resign', 'users_resignment_wawancara.kepuasan_resign', 'users_resignment_wawancara.saran_resign', 'users_resignment_wawancara.rework_resign')); $this->db->join('users', 'users.id = users_resignment.user_id', 'LEFT'); //$this->db->join('alasan_resign', 'users_resignment.alasan_resign_id = alasan_resign.id', 'LEFT'); $this->db->join('approval_status as status_lv1', 'users_resignment.app_status_id_lv1 = status_lv1.id', 'left'); $this->db->join('approval_status as status_lv2', 'users_resignment.app_status_id_lv2 = status_lv2.id', 'left'); $this->db->join('approval_status as status_lv3', 'users_resignment.app_status_id_lv3 = status_lv3.id', 'left'); $this->db->join('approval_status as status_hrd', 'users_resignment.app_status_id_hrd = status_hrd.id', 'left'); $this->db->join('users_resignment_wawancara', 'users_resignment.id = users_resignment_wawancara.user_resignment_id', 'left'); if ($id != null) { $this->db->where('users_resignment.id', $id); } if ($is_approver !== $sess_nik && $is_admin != 1 && $is_admin_payroll != 1) { //$this->db->where("(users_resignment.user_id= $sess_id $sub_id $subsub_id )",null, false); $this->db->where("(users_resignment.user_id = {$sess_id} OR users_resignment.user_app_lv1 = '{$sess_nik}' OR users_resignment.user_app_lv2 = '{$sess_nik}' OR users_resignment.user_app_lv3 = '{$sess_nik}' OR users_resignment.created_by = '{$sess_id}')", null, false); } $this->db->order_by('users_resignment.id', 'desc'); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_resignment']); return $this; }
public function form_spd_dalam_report($id = null) { $sess_id = $this->session->userdata('user_id'); $sess_nik = get_nik($sess_id); $is_admin = is_admin(); if (!empty(is_have_subordinate(get_nik($sess_id)))) { $sub_id = get_subordinate($sess_id); } else { $sub_id = ''; } if (!empty(is_have_subsubordinate($sess_id))) { $subsub_id = 'OR ' . get_subsubordinate($sess_id); } else { $subsub_id = ''; } $this->trigger_events('form_spd_dalam_report'); if (isset($this->_ion_select) && !empty($this->_ion_select)) { foreach ($this->_ion_select as $select) { $this->db->select($select); } $this->_ion_select = array(); } else { //default selects $sess_nik = !empty(get_nik($this->session->userdata('user_id'))) ? get_nik($this->session->userdata('user_id')) : $this->session->userdata('user_id'); $this->db->select(array($this->tables['users_spd_dalam_report'] . '.*', $this->tables['users_spd_dalam_report'] . '.id as id', $this->tables['users_spd_dalam'] . '.id as spd_id')); $this->db->join('users_spd_dalam_report', 'users_spd_dalam.id = users_spd_dalam_report.user_spd_dalam_id', 'left'); if ($is_admin != 1) { $this->db->where("(users_spd_dalam.task_receiver = '{$sess_nik}' OR users_spd_dalam.task_creator = '{$sess_nik}' )", null, false); } $this->db->where('users_spd_dalam.is_deleted', 0); } $this->trigger_events('extra_where'); //run each where that was passed if (isset($this->_ion_where) && !empty($this->_ion_where)) { foreach ($this->_ion_where as $where) { $this->db->where($where); } $this->_ion_where = array(); } if (isset($this->_ion_like) && !empty($this->_ion_like)) { foreach ($this->_ion_like as $like) { $this->db->or_like($like); } $this->_ion_like = array(); } if (isset($this->_ion_limit) && isset($this->_ion_offset)) { $this->db->limit($this->_ion_limit, $this->_ion_offset); $this->_ion_limit = NULL; $this->_ion_offset = NULL; } else { if (isset($this->_ion_limit)) { $this->db->limit($this->_ion_limit); $this->_ion_limit = NULL; } } //set the order if (isset($this->_ion_order_by) && isset($this->_ion_order)) { $this->db->order_by($this->_ion_order_by, $this->_ion_order); $this->_ion_order = NULL; $this->_ion_order_by = NULL; } $this->response = $this->db->get($this->tables['users_spd_dalam']); return $this; }