[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
smk
/
application
/
controllers
/
akademik
/
[
Home
]
File: Tingkat.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Tingkat extends Member_Controller { private $kode_menu = 'akademik-referensi'; private $url = 'akademik/tingkat'; function __construct(){ parent:: __construct(); $this->load->model('akademik/tingkat_model'); } public function index($page=null, $id=null){ $data['kode_menu'] = $this->kode_menu; $data['nama'] = $this->access->get_nama(); parent::cek_akses($data['kode_menu']); $this->template->display_admin($this->url.'/list_view', 'Daftar Tingkat', $data); } function get_all_tingkat(){ $is_edit = $this->access->cek_akses_crud($this->kode_menu, 1); // variable initialization $search = ""; $start = 0; $rows = 10; // get search value (if any) if (isset($_GET['sSearch']) && $_GET['sSearch'] != "" ) { $search = $_GET['sSearch']; } // limit $start = $this->get_start(); $rows = $this->get_rows(); // run query to get user listing $query = $this->tingkat_model->get_all_tingkat($start, $rows, $search); $iFilteredTotal = $query->num_rows(); $iTotal=$this->tingkat_model->get_all_tingkat_count($search)->row()->hasil; $output = array( "sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iTotal, "aaData" => array() ); // get result after running query and put it in array $i=$start; $user = $query->result(); foreach ($user as $temp) { $record = array(); $record[] = ++$i; $record[] = $temp->tingkat; $record[] = $temp->urutan; $record[] = $temp->keterangan; if($is_edit){ $record[] = '<a href="'.site_url('user/useratur/index/edit/'.$temp->id).'" class="btn btn-default btn-xs">Edit</a>'; }else{ $record[] = ''; } $output['aaData'][] = $record; } // format it to JSON, this output will be displayed in datatable echo json_encode($output); } function get_pilihan_sdm(){ $is_edit = $this->access->cek_akses_crud('user_atur', 0); $this->load->model('akademik/pegawai_model'); // variable initialization $search = ""; $start = 0; $rows = 10; // get search value (if any) if (isset($_GET['sSearch']) && $_GET['sSearch'] != "" ) { $search = $_GET['sSearch']; } // limit $start = $this->get_start(); $rows = $this->get_rows(); // run query to get user listing $query = $this->pegawai_model->get_all_pegawai($start, $rows, $search); $iFilteredTotal = $query->num_rows(); $iTotal=$this->pegawai_model->get_all_pegawai_count($search)->row()->hasil; $output = array( "sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iTotal, "aaData" => array() ); // get result after running query and put it in array $i=$start; $sdm = $query->result(); foreach ($sdm as $temp) { $record = array(); $record[] = ++$i; $record[] = $temp->nip; $record[] = $temp->nama; $record[] = $temp->alamat; $record[] = '<a onclick="pilihsdm(\''.$temp->nip.'\',\''.$temp->nama.'\')" class="btn btn-default btn-xs">Pilih</a>'; $output['aaData'][] = $record; } // format it to JSON, this output will be displayed in datatable echo json_encode($output); } /** * funsi tambahan * * */ function get_start() { $start = 0; if (isset($_GET['iDisplayStart'])) { $start = intval($_GET['iDisplayStart']); if ($start < 0) $start = 0; } return $start; } function get_rows() { $rows = 10; if (isset($_GET['iDisplayLength'])) { $rows = intval($_GET['iDisplayLength']); if ($rows < 5 || $rows > 500) { $rows = 10; } } return $rows; } function get_sort_dir() { $sort_dir = "ASC"; $sdir = strip_tags($_GET['sSortDir_0']); if (isset($sdir)) { if ($sdir != "asc" ) { $sort_dir = "DESC"; } } return $sort_dir; } }