load->model('master/about_model'); $this->load->model('master/studi_model'); $this->load->model('master/dosen_model'); $this->load->model('master/kegiatan_model'); $this->load->model('master/informasi_model'); $this->load->model('master/pps_model'); $this->load->model('master/akademik_model'); $this->load->model('master/kurikulum_model'); //model transaksi //model report //model utilitas $this->load->model('utility/user_model'); // $this->load->model('utility/modul_model'); $this->load->model('utility/role_model'); $this->load->model('utility/listcode_model'); $this->load->model('utility/setting_model'); //model common $this->load->model('common/log_model'); //library $this->load->library('upload'); $this->load->library('image_lib'); $this->load->library('datatables_ssp'); $this->initialize(); } public function count_data($param) { switch ($param) { // case 'movie'; // $data['tile'] = $this->movie_model->select('id_movie', null, null, null, null)->num_rows(); // return $data['tile']; // break; default : return 'unknow'; break; } } public function initialize() { // $this->menu = $this->listcode_model->select('*', array('head_list' => 'MD'), NULL, NULL, NULL)->result(); // $this->submenu = $this->modul_model->select('*', NULL, NULL, NULL, array('field' => 'kode_modul', 'sort' => 'asc'))->result(); $this->counter = new Counter(); $this->log = new C_log(); $this->setting['About'] = $this->about_model->select('*', array('id_about' => '1'), null, null, null)->row(); $this->setting['genre'] = $this->listcode_model->select('nama_list,kode_list', array('head_list' => 'GN'), null, null, array('field' => 'nama_list', 'sort' => 'asc'))->result(); // $field_countmenu = 'nama_role,' // . '(SELECT count(r.id_role) FROM u_role r WHERE r.kode_role = u_role.kode_role AND r.hak_akses LIKE \'%M%\') AS master, ' // . '(SELECT count(r.id_role) FROM u_role r WHERE r.kode_role = u_role.kode_role AND r.hak_akses LIKE \'%T%\') AS transaksi, ' // . '(SELECT count(r.id_role) FROM u_role r WHERE r.kode_role = u_role.kode_role AND r.hak_akses LIKE \'%R%\') AS report, ' // . '(SELECT count(r.id_role) FROM u_role r WHERE r.kode_role = u_role.kode_role AND r.hak_akses LIKE \'%U%\') AS utilitas'; // $this->countmenu = $this->role_model->select($field_countmenu, array('nama_role' => $this->session->userdata('sps_type')), NULL, NULL, NULL)->result_array(); // $setting = array( 'dash_url' => site_url('common/dash') ); $this->setting = array_merge($this->setting, $setting); $this->conn = array( 'user' => $this->db->username, 'pass' => $this->db->password, 'db' => $this->db->database, 'host' => $this->db->hostname ); } public function ajax_tabel_lib($table_name, $table_column, $button = null) { if (!$this->input->is_ajax_request()) { exit('No direct script access allowed'); } else { $connection = array( 'user' => $this->db->username, 'pass' => $this->db->password, 'db' => $this->db->database, 'host' => $this->db->hostname ); $primaryKey = $table_column[0]; $columns = array(); for ($i = 0; $i < count($table_column); $i++) { if ($i == 0) { $arr = array('db' => $table_column[$i], 'dt' => 'DT_RowId'); array_push($columns, $arr); } else { $arr = array('db' => $table_column[$i], 'dt' => $table_column[$i]); array_push($columns, $arr); } } //button if ($button != null) { $frmt = array('db' => $table_column[0], 'dt' => 'aksi'); $format = array_merge($frmt, $button); array_push($columns, $format); } // json data // $connection : detil koneksi database // $table_name : nama tabel yang akan ditampilkan datanya // $primaryKey : primari key dari tabel // $columns : array field tabel echo json_encode( Datatables_ssp::simple($_GET, $connection, $table_name, $primaryKey, $columns) ); } } public function is_logged_in() { if ($this->session->userdata('pps_is_login') == '') { redirect('common/auth'); } } }