Advertisement
sanca

datasiswa.php

Dec 15th, 2013
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.70 KB | None | 0 0
  1. public function view($kelas){
  2.         if ($this->session->getValue('username','grup')==TRUE){
  3.             $kelas=$kelas;
  4.             $datasiswa=$this->datasiswa->viewbykelas($kelas);            
  5.            
  6.                     $data=array(
  7.                         'title'=>'View Siswa Kelas '.$kelas,
  8.                         'username'=>$this->session->getValue('username'),
  9.                         'page'=>'viewsiswa',
  10.                         'kelas'=>$this->kelas->viewkelas(),
  11.                     );
  12.                 $this->output('index', $data);
  13.                 }else{
  14.         $this->redirect('login');
  15.         }
  16.        
  17.     }
  18.    
  19.     public function datatab(){
  20.         if ($this->session->getValue('username','grup')==TRUE){
  21.             $kelas=$kelas;
  22.             $datasiswa=$this->datasiswa->viewbykelas($kelas);
  23.            
  24.             $total_rows=$this->datasiswa->totalbykelas($kelas);
  25.             $per_page=$this->request->post('perPage') ?: 10;
  26.             $current_page=$this->request->post('currentPage') ?: 1;
  27.            
  28.             $sort=$this->request->post('sort') ?: array(array("column_0","desc"),array("column_2","asc"));
  29.             $filter=$this->request->post('filter') ?: array("column_0"=>"foo");
  30.            
  31.             $datatab = array(
  32.  
  33.                     "totalRows"   => $total_rows,
  34.                     "perPage"     => $per_page,
  35.                     "sort"        => $sort,
  36.                     "filter"      => $filter,
  37.                     "currentPage" => $current_page,
  38.                     "data"        => array(),
  39.  
  40.                     "posted"      => $_POST
  41.  
  42.             );
  43.            
  44.             foreach($datasiswa as $datasiswa) {
  45.                 $i=0;
  46.                 $datatab["data"][] = array(
  47.                     "column_0"  => $i++,
  48.                     "column_1"  => $datasiswa->foto,
  49.                     "column_2"  => $datasiswa->nama,
  50.                     "column_1"  => $datasiswa->kelamin,
  51.                     "column_1"  => $datasiswa->sekolah,
  52.                     "column_1"  => $datasiswa->status,
  53.                     "column_4"  => "<a class='btn btn-success btn-round' href='#' data-toggle='modal' data-target='#myModal'></a>",
  54.                 );
  55.                 }
  56.                
  57.                // echo json_encode($datatab);
  58.                     $data=array(
  59.                         'title'=>'View Siswa Kelas '.$kelas,
  60.                         'username'=>$this->session->getValue('username'),
  61.                         'page'=>'viewsiswa',
  62.                         'kelas'=>$this->kelas->viewkelas(),
  63.                     );
  64.                 $this->output('index', $data);
  65.                 }else{
  66.         $this->redirect('login');
  67.         }
  68.        
  69.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement