SHARE
TWEET

index

CHaNStar Jan 15th, 2020 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php include "lib/library.php";
  2.  
  3.     $succsess = flash('success');
  4.     $error = flash('error');
  5.  
  6.     cekLogin();
  7.  
  8.     // Membuat query SQL mengambil data siswa
  9.     $sql = "SELECT * FROM siswa";
  10.  
  11.     $sql = "SELECT * FROM siswa";
  12.  
  13.     $search = @$_GET['search'];
  14.    
  15.  
  16.     // Searching
  17.    
  18.     if(!empty($search)) $sql .= " WHERE nis LIKE '%$search%'
  19.     OR nama_lengkap LIKE '%$search%'
  20.     OR jenis_kelamin LIKE '%$search%'
  21.     OR kelas LIKE '%$search%'
  22.     OR jurusan LIKE '%$search%'
  23.     OR alamat LIKE '%$search%'
  24.     OR golongan_darah LIKE '%$search%'
  25.     OR nama_ibukandung LIKE '%$search%' ";
  26.  
  27.     // Ordering
  28.     $order_field = @$_GET['sort'];      //Mengambil Field yang akan di order
  29.     $order_mode = @$_GET['order'];      //Mengambil mode nya, Ascending atau Descending
  30.  
  31.     if(!empty($order_field) && !empty($order_mode)) $sql  .= " ORDER BY $order_field $order_mode" ;
  32.  
  33.    
  34.  
  35.  
  36.     $listSiswa = $mysqli->query($sql);
  37.    
  38.    
  39.     include 'views/v_index.php';
  40. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top