Advertisement
eqeqwan21

Untitled

Apr 3rd, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private function get_dimprofiles()
  2.  {
  3.    
  4.     if(isset($_GET['kp'])) {
  5.         $sql = "SELECT id, Name from DimProfile order by Name";
  6.         $this->run_query($sql, null, null, PDO::FETCH_KEY_PAIR);
  7.     }
  8.     elseif(isset($_GET['filter'])) {
  9.         $sql = "SELECT distinct DimProfile.id as id, DimProfile.Name as Name, Town_id from Devices
  10.        left join `DimProfile` on `DimProfile`.id = Devices.DimProfile_id
  11.        order by DimProfile.Name
  12.        ";
  13.         $this->run_query($sql);
  14.     }
  15.     else {
  16.         $sql = "SELECT * from DimProfile order by name";   
  17.         $this->run_query($sql);
  18.     }
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement