load->model('m_kepegawaian'); if ($this->session->userdata("logged_in") == FALSE){ redirect("user/login", "location"); } } public function data_tenaga_pendidik(){ $data['base_url'] = base_url().'kepegawaian/data_tenaga_pendidik'; $jml_dosen = $this->m_kepegawaian->jml_dosen(); $data['total_rows'] = $jml_dosen; $data['per_page'] = '50'; $data['uri_segment']= '3'; $data['first_link'] = 'Pertama'; $data['last_link'] = 'Terakhir'; $data['next_link'] = '>'; $data['prev_link'] = '<'; $this->pagination->initialize($data); $offset = $this->uri->segment(3); if ($offset == '') { $offset = 0; } $paging = $data['per_page']; // Otoritas // $id_menu = '5'; is_akses($id_menu); $menu["id_menu"] = $id_menu; $data["jml_cari"] = ""; $data["nama_kata_kunci"] = "Keseluruhan"; $data['title'] = 'UNLASYS - Data Tenaga Pendidik'; $data["query"] = $this->m_kepegawaian->list_t_pendidik($paging, $offset); $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_data_t_pendidik.php'); $this->load->view('v_footer.php'); } public function tambah_pegawai(){ $this->_validation_pegawai(); if($this->form_validation->run()==false){ $data["title"] = "UNLASYS - Tambah Data Pegawai"; $data["judul_form"] = "Tambah"; $data["noktp"] = ""; $data["nmtnpagelar"] = ""; $data["nmdgngelar"] = ""; $data["jenkel"] = ""; $data["tmptlahir"] = ""; $data["tgllahir"] = ""; $data["alamat_rmh"] = ""; $data["kelurahan"] = ""; $data["kecamatan"] = ""; $data["kotakab"] = ""; $data["kdpos"] = ""; $data["notlp"] = ""; $data["email"] = ""; // T Kependidikan $data["tgl_msk"] = ""; $data["nik"] = ""; $data["id_unit"] = ""; $data["id_jabatan"] = ""; $data["det_jabatan"] = ""; $data["id_golongan"] = ""; $data["id_pend"] = ""; $data["det_pend"] = ""; // T Pendidik $data["nidu"] = ""; $data["nidn_nidk_nup"] = ""; $data["id_prodi"] = ""; $data["tmt_dosen"] = ""; $data["st_dosen"] = ""; $data["id_jabakad"] = ""; $data["id_gol_inpassing"] = ""; $data["id_unit"] = ""; $data["id_jabatan"] = ""; $data["det_jabatan"] = ""; $data["action_form"] = base_url().'kepegawaian/tambah_pegawai'; $data["drop_golongan"] = $this->m_kepegawaian->get_drop_golongan(); $data["drop_unit"] = $this->m_kepegawaian->get_drop_unit(); $data["drop_jabatan"] = $this->m_kepegawaian->get_drop_jabatan(); $data["drop_jabakad"] = $this->m_kepegawaian->get_drop_jabakad(); $data["drop_pend"] = $this->m_kepegawaian->get_drop_pend(); $data["drop_gol_inpassing"] = $this->m_kepegawaian->get_drop_golongan(); $data["drop_jabakad"] = $this->m_kepegawaian->get_drop_jabakad(); //$data["anchor"] = "anchor('kepegawaian/',' Kembali',array('class'=>'btn btn-primary'));"; // Otoritas // $id_menu = '6'; $menu["id_menu"] = $id_menu; $data['title'] = 'UNLASYS - Data Pegawai'; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_form_pegawai.php'); $this->load->view('v_footer.php'); }else{ $data = array( 'noktp' => $this->input->post('noktp'), 'nmtnpagelar' => $this->input->post('nmtnpagelar'), 'nmdgngelar' => $this->input->post('nmdgngelar'), 'jenkel' => $this->input->post('jenkel'), 'tmptlahir' => $this->input->post('tmptlahir'), 'tgllahir' => date('Y-m-d', strtotime($this->input->post('tgllahir'))), 'alamat_rmh' => $this->input->post('alamat_rmh'), 'kelurahan' => $this->input->post('kelurahan'), 'kecamatan' => $this->input->post('kecamatan'), 'kotakab' => $this->input->post('kotakab'), 'notlp' => $this->input->post('notlp'), 'email' => $this->input->post('email'), 'tgl_msk' => date('Y-m-d', strtotime($this->input->post('tgl_msk'))), 'nik' => $this->input->post('nik'), 'id_unit_kerja' => $this->input->post('id_unit'), 'id_jabatan' => $this->input->post('id_jabatan'), 'det_jabatan' => $this->input->post('det_jabatan'), 'nidn_nidk_nup' => $this->input->post('nidn_nidk_nup'), 'tmt_dosen' => date('Y-m-d', strtotime($this->input->post('tmt_dosen'))), 'id_pend' => $this->input->post('id_pend'), 'det_pend' => $this->input->post('det_pend'), 'id_golongan' => $this->input->post('id_golongan'), 'id_jabakad' => $this->input->post('id_jabakad') ); $this->m_kepegawaian->save_pegawai($data); $this->session->set_flashdata('success', 'Data Pegawai berhasil ditambah'); redirect('kepegawaian/data_tenaga_pendidik'); } } public function cari_tenaga_pendidik(){ $kunci = $this->input->post("cari"); if($kunci <> ''){ $kunci2 = strtoupper($kunci); $data['query'] = $this->m_kepegawaian->cari_t_pendidik($kunci, $kunci2); //$data['kunci'] = $kunci; if ($data['query']->result() == null ){ $this->session->set_flashdata('error', 'Tidak ditemukan Data Tenaga Pendidik dengan kata kunci = "'.$kunci.'"'); redirect ('kepegawaian/data_tenaga_pendidik','refresh'); }else{ $data["jml_cari"] = "Data Ditemukan : ".$this->m_kepegawaian->count_cari($kunci, $kunci2).""; $reset = anchor('kepegawaian/data_tenaga_pendidik','',array('class'=>'btn btn-danger btn-circle')); $data["nama_kata_kunci"] = 'Cari - Kata Kunci : "'.$kunci.'" '.$reset; $data["title"] = "UNLASYS - Daftar Cari Tenaga Pendidik'"; // Otoritas // $id_menu = '5'; is_akses($id_menu); $menu["id_menu"] = $id_menu; $data['title'] = 'UNLASYS - Data Tenaga Pendidik'; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_data_t_pendidik.php'); $this->load->view('v_footer.php'); } }else{ $this->session->set_flashdata('error', 'Kolom Nama Tenaga Pendidik kosong'); redirect('kepegawaian/data_tenaga_pendidik', 'refresh'); } } public function detail_tenaga_pendidik($id_pegawai){ $data["title"] = "UNLASYS - Profil Tenaga Pendidik'"; $data["query"] = $this->m_kepegawaian->detail_t_pendidik($id_pegawai); // Otoritas // $id_menu = '5'; $menu["id_menu"] = $id_menu; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_detail_t_pendidik.php'); $this->load->view('v_footer.php'); } public function ubah_tenaga_pendidik($id_pegawai,$offset){ $this->_validation_pegawai(); if($this->form_validation->run()==false){ $data["title"] = "UNLASYS - Ubah Data Tenaga Pendidik"; $data["judul_form"] = "Ubah"; $data["action_form"] = base_url().'kepegawaian/ubah_tenaga_pendidik/'.$id_pegawai; $data_t_pendidik = $this->m_kepegawaian->detail_t_pendidik($id_pegawai); foreach($data_t_pendidik->result() as $row_daftar) { //Pribadi $data["noktp"] = $row_daftar->noktp; $data["nmtnpagelar"] = $row_daftar->nmtnpagelar; $data["nmdgngelar"] = $row_daftar->nmdgngelar; $data["id_pend"] = $row_daftar->id_pend; $data["det_pend"] = $row_daftar->det_pend; $data["jenkel"] = $row_daftar->jenkel; $data["tmptlahir"] = $row_daftar->tmptlahir; $data["tgllahir"] = $row_daftar->tgllahir; $data["alamat_rmh"] = $row_daftar->alamat_rmh; $data["kelurahan"] = $row_daftar->kelurahan; $data["kecamatan"] = $row_daftar->kecamatan; $data["kotakab"] = $row_daftar->kotakab; $data["kdpos"] = $row_daftar->kdpos; $data["notlp"] = $row_daftar->notlp; $data["email"] = $row_daftar->email; //Tenaga Pendidik $data["nidu"] = $row_daftar->nidu; $data["nidn_nidk_nup"] = $row_daftar->nidn_nidk_nup; $data["id_prodi"] = $row_daftar->id_prodi; $data["tmt_dosen"] = $row_daftar->tmt_dosen; $data["id_jabakad"] = $row_daftar->id_jabakad; $data["id_gol_inpassing"] = $row_daftar->id_gol_inpassing; $data["id_st_ikatan_kerja"] = $row_daftar->id_st_ikatan_kerja; //Dropdown $data["drop_gol_inpassing"] = $this->m_kepegawaian->get_drop_golongan(); $data["drop_jabakad"] = $this->m_kepegawaian->get_drop_jabakad(); $data["drop_prodi"] = $this->m_kepegawaian->get_drop_prodi(); $data["drop_pend"] = $this->m_kepegawaian->get_drop_pend(); $data["drop_unit"] = $this->m_kepegawaian->get_drop_unit(); $data["drop_jabatan"] = $this->m_kepegawaian->get_drop_jabatan(); $data["drop_ikerja"] = $this->m_kepegawaian->get_drop_ikerja(); // Otoritas // $id_menu = '5'; $menu["id_menu"] = $id_menu; $data["offset"] = $offset; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_form_t_pendidik.php'); $this->load->view('v_footer.php'); } }else{ $data = array( 'noktp' => $this->input->post('noktp'), 'nmtnpagelar' => $this->input->post('nmtnpagelar'), 'nmdgngelar' => $this->input->post('nmdgngelar'), 'id_pend' => $this->input->post('id_pend'), 'det_pend' => $this->input->post('det_pend'), 'jenkel' => $this->input->post('jenkel'), 'tmptlahir' => $this->input->post('tmptlahir'), 'tgllahir' => date('Y-m-d', strtotime($this->input->post('tgllahir'))), 'alamat_rmh' => $this->input->post('alamat_rmh'), 'kelurahan' => $this->input->post('kelurahan'), 'kecamatan' => $this->input->post('kecamatan'), 'kotakab' => $this->input->post('kotakab'), 'kdpos' => $this->input->post('kdpos'), 'notlp' => $this->input->post('notlp'), 'email' => $this->input->post('email'), 'nidu' => $this->input->post('nidu'), 'nidn_nidk_nup' => $this->input->post('nidn_nidk_nup'), 'id_prodi' => $this->input->post('id_prodi'), 'tmt_dosen' => date('Y-m-d', strtotime($this->input->post('tmt_dosen'))), 'id_st_ikatan_kerja' => $this->input->post('id_st_ikatan_kerja'), 'id_jabakad' => $this->input->post('id_jabakad'), 'id_gol_inpassing' => $this->input->post('id_gol_inpassing'), 'id_st_ikatan_kerja' => $this->input->post('id_st_ikatan_kerja') ); $this->m_kepegawaian->update_pegawai($id_pegawai, $data); $this->session->set_flashdata('success', 'Data Tenaga Pendidik berhasil diubah'); redirect('kepegawaian/data_tenaga_pendidik/'.$offset); } } public function ubah_tenaga_kependidikan($id_pegawai){ $this->_validation_pegawai(); if($this->form_validation->run()==false){ $data["title"] = "UNLASYS - Ubah Data Tenaga Kependidikan"; $data["judul_form"] = "Ubah"; $data["action_form"] = base_url().'kepegawaian/ubah_tenaga_kependidikan/'.$id_pegawai; $data_t_kependidikan = $this->m_kepegawaian->detail_t_kependidikan($id_pegawai); foreach($data_t_kependidikan->result() as $row_daftar) { //Pribadi $data["noktp"] = $row_daftar->noktp; $data["nmtnpagelar"] = $row_daftar->nmtnpagelar; $data["nmdgngelar"] = $row_daftar->nmdgngelar; $data["id_pend"] = $row_daftar->id_pend; $data["det_pend"] = $row_daftar->det_pend; $data["jenkel"] = $row_daftar->jenkel; $data["tmptlahir"] = $row_daftar->tmptlahir; $data["tgllahir"] = $row_daftar->tgllahir; $data["alamat_rmh"] = $row_daftar->alamat_rmh; $data["kelurahan"] = $row_daftar->kelurahan; $data["kecamatan"] = $row_daftar->kecamatan; $data["kotakab"] = $row_daftar->kotakab; $data["kdpos"] = $row_daftar->kdpos; $data["notlp"] = $row_daftar->notlp; $data["email"] = $row_daftar->email; //Tenaga Kependidikan $data["tgl_msk"] = $row_daftar->tgl_msk; $data["nik"] = $row_daftar->nik; $data["id_unit"] = $row_daftar->id_unit_kerja; $data["id_jabatan"] = $row_daftar->id_jabatan; $data["det_jabatan"] = $row_daftar->det_jabatan; $data["id_golongan"] = $row_daftar->id_golongan; //Dropdown $data["drop_golongan"] = $this->m_kepegawaian->get_drop_golongan(); $data["drop_unit"] = $this->m_kepegawaian->get_drop_unit(); $data["drop_jabatan"] = $this->m_kepegawaian->get_drop_jabatan(); $data["drop_pend"] = $this->m_kepegawaian->get_drop_pend(); // Otoritas // $id_menu = '6'; $menu["id_menu"] = $id_menu; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_form_t_kependidikan.php'); $this->load->view('v_footer.php'); } }else{ $data = array( 'noktp' => $this->input->post('noktp'), 'nmtnpagelar' => $this->input->post('nmtnpagelar'), 'nmdgngelar' => $this->input->post('nmdgngelar'), 'id_pend' => $this->input->post('id_pend'), 'det_pend' => $this->input->post('det_pend'), 'jenkel' => $this->input->post('jenkel'), 'tmptlahir' => $this->input->post('tmptlahir'), 'tgllahir' => date('Y-m-d', strtotime($this->input->post('tgllahir'))), 'alamat_rmh' => $this->input->post('alamat_rmh'), 'kelurahan' => $this->input->post('kelurahan'), 'kecamatan' => $this->input->post('kecamatan'), 'kotakab' => $this->input->post('kotakab'), 'kdpos' => $this->input->post('kdpos'), 'notlp' => $this->input->post('notlp'), 'email' => $this->input->post('email'), 'tgl_msk' => date('Y-m-d', strtotime($this->input->post('tgl_msk'))), 'nik' => $this->input->post('nik'), 'id_unit_kerja' => $this->input->post('id_unit'), 'id_jabatan' => $this->input->post('id_jabatan'), 'det_jabatan' => $this->input->post('det_jabatan'), 'id_golongan' => $this->input->post('id_golongan') ); $this->m_kepegawaian->update_pegawai($id_pegawai, $data); $this->session->set_flashdata('success', 'Data Tenaga Kependidikan berhasil diubah'); redirect('kepegawaian/data_tenaga_kependidikan'); } } public function hapus_pegawai($id_pegawai){ $this->m_kepegawaian->delete_pegawai($id_pegawai); $this->session->set_flashdata('success', 'Data Pegawai berhasil dihapus'); redirect('kepegawaian/data_pegawai'); } public function hapus_tenaga_pendidik($id_pegawai,$offset){ $this->m_kepegawaian->delete_pegawai($id_pegawai); $this->session->set_flashdata('success', 'Data Tenaga Pendidik berhasil dihapus'); redirect('kepegawaian/data_tenaga_pendidik'.$offset); } public function hapus_tenaga_kependidikan($id_pegawai){ $this->m_kepegawaian->delete_pegawai($id_pegawai); $this->session->set_flashdata('success', 'Data Tenaga Kependidikan berhasil dihapus'); redirect('kepegawaian/data_tenaga_kependidikan'); } function _validation_pegawai(){ /*$this->form_validation->set_rules("noktp", "No. KTP", "required|min_length[10]|max_length[30]"); $this->form_validation->set_rules("nmtnpagelar", "Nama", "required|min_length[5]|max_length[30]"); $this->form_validation->set_rules("nmdgngelar", "Nama", "required|min_length[5]|max_length[70]"); $this->form_validation->set_rules("jenkel", "Jenis Kelamin", "required"); $this->form_validation->set_rules("tmptlahir", "Tempat Lahir", "required|min_length[4]|max_length[30]"); $this->form_validation->set_rules("tgllahir", "Tanggal Lahir", "required"); $this->form_validation->set_rules("alamat_rmh", "Alamat Rumah", "required|min_length[4]|max_length[500]"); $this->form_validation->set_rules("kelurahan", "Kelurahan", "min_length[4]|max_length[30]"); $this->form_validation->set_rules("kecamatan", "Kecamatan", "min_length[4]|max_length[30]"); $this->form_validation->set_rules("kotakab", "Kota/Kabupaten", "min_length[4]|max_length[50]"); $this->form_validation->set_rules("notlp", "No Telepon/HP", "required|max_length[20]"); $this->form_validation->set_rules("email", "Email", "valid_email|max_length[50]"); $this->form_validation->set_rules("tgl_msk", "Tanggal Masuk", "required"); $this->form_validation->set_rules("nik", "NIK", "required|min_length[3]|max_length[20]"); $this->form_validation->set_rules("id_unit", "Unit Kerja", "required"); $this->form_validation->set_rules("id_jabatan", "Jabatan", "required"); $this->form_validation->set_rules("det_jabatan", "Detail Jabatan", "min_length[5]|max_length[30]"); $this->form_validation->set_rules("id_pend", "Pendidikan", "required"); $this->form_validation->set_rules("det_pend", "Detail Pendidikan", "min_length[5]|max_length[50]"); $this->form_validation->set_rules("id_golongan", "Golongan", "required"); $this->form_validation->set_message("required","%s tidak boleh kosong"); $this->form_validation->set_message("min_length", "%s tidak boleh kurang dari %s karakter"); $this->form_validation->set_message("max_length", "%s tidak boleh lebih dari %s karakter");*/ $this->form_validation->set_rules("email", "Email", "valid_email|max_length[50]"); $this->form_validation->set_message("valid_email","%s tidak valid"); $this->form_validation->set_error_delimiters("
", "
"); } public function data_tenaga_kependidikan(){ $data['base_url'] = base_url().'kepegawaian/data_tenaga_kependidikan'; $data['total_rows'] = $this->db->count_all('pegawai'); $data['per_page'] = '20'; $data['uri_segment']= '3'; $data['first_link'] = 'Pertama'; $data['last_link'] = 'Terakhir'; $data['next_link'] = '>'; $data['prev_link'] = '<'; $this->pagination->initialize($data); $offset = $this->uri->segment(3); if ($offset == '') { $offset = 0; } $paging = $data['per_page']; // Otoritas // $id_menu = '6'; is_akses($id_menu); $menu["id_menu"] = $id_menu; $data['title'] = 'UNLASYS - Data Tenaga Kependidikan'; $data["query"] = $this->m_kepegawaian->list_t_kependidikan($paging, $offset); $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_data_t_kependidikan.php'); $this->load->view('v_footer.php'); } public function cari_tenaga_kependidikan(){ $kunci = $this->input->post("cari"); if($kunci <> ''){ $kunci2 = strtoupper($kunci); $data['query'] = $this->m_kepegawaian->cari_t_kependidikan($kunci, $kunci2); //$data['kunci'] = $kunci; if ($data['query']->result() == null ){ $this->session->set_flashdata('error', 'Tidak ditemukan Data Tenaga Kependidikan dengan kata kunci = "'.$kunci.'"'); redirect ('kepegawaian/data_tenaga_kependidikan','refresh'); }else{ $data["jml_cari"] = "
Data Ditemukan : ".$this->m_kepegawaian->count_cari($kunci, $kunci2)."
"; $reset = anchor('kepegawaian/data_tenaga_pendidik','',array('class'=>'btn btn-danger btn-circle')); $data["nama_kata_kunci"] = 'Cari - Kata Kunci : "'.$kunci.'" '.$reset; $data["title"] = "UNLASYS - Daftar Cari Tenaga Kependidikan'"; // Otoritas // $id_menu = '6'; is_akses($id_menu); $menu["id_menu"] = $id_menu; $data['title'] = 'UNLASYS - Data Tenaga Kependidikan'; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_data_t_kependidikan.php'); $this->load->view('v_footer.php'); } }else{ $this->session->set_flashdata('error', 'Kolom Nama Tenaga Kependidikan kosong'); redirect('kepegawaian/data_tenaga_kependidikan', 'refresh'); } } public function detail_tenaga_kependidikan($id_pegawai){ $data["title"] = "UNLASYS - Profil Tenaga Kependidikan'"; $data["query"] = $this->m_kepegawaian->detail_t_kependidikan($id_pegawai); // Otoritas // $id_menu = '6'; $menu["id_menu"] = $id_menu; $this->load->view('v_header.php',$data); $this->load->view('v_sidebar.php',$menu); $this->load->view('v_topbar.php'); $this->load->view('kepegawaian/v_detail_t_kependidikan.php'); $this->load->view('v_footer.php'); } }