Rofihimam

Untitled

Nov 6th, 2019
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include 'lib/library.php';
  3.  
  4.     $sql = 'SELECT * FROM siswa';
  5.  
  6.     // Searching
  7.     $search = @$_GET['search'];
  8.     $category = @$_GET['category'];
  9.     if (!empty($search)) $sql .= " WHERE $category LIKE '%$search%' ";
  10.  
  11.     // Ordering
  12.     $order_field = @$_GET['sort'];
  13.     $order_mode = @$_GET['order'];
  14.     if (!empty($order_field) && !empty($order_mode)) $sql .= " ORDER BY $order_field $order_mode ";
  15.  
  16.     $listSiswa = $mysqli->query($sql);
  17.  
  18.     include 'views/v_index.php';
  19. ?>
RAW Paste Data