Guest User

Untitled

a guest
Jun 20th, 2012
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * Content::getApparecchi()
  3. *
  4. * @return
  5. */
  6. public function getApparecchi()
  7. {
  8. $sort = sanitize(get('sort'));
  9. $access = '';
  10. $order = '';
  11. if (Registry::get("Users")->userlevel == 5) {
  12. $extra = ($sort) ? "AND" : "WHERE";
  13. $access = "$extra app.staff_id='" . Registry::get("Users")->uid . "'";
  14. $counter = countEntries("permissions", "staff_id", Registry::get("Users")->uid);
  15. } else {
  16. $counter = countEntries("apparecchi");
  17. }
  18.  
  19. $pager = Paginator::instance();
  20. $pager->items_total = $counter;
  21. $pager->default_ipp = Registry::get("Core")->perpage;
  22. $pager->paginate();
  23.  
  24. ($sort) ? $order = "WHERE app.client_id = '" . (int)$sort . "'" : null;
  25.  
  26. $sql = "SELECT app.id as appid, u.id as uid, app.tipo_apparecchio, app.modello, app.seriale, app.marca_app,"
  27. . "\n CONCAT(u.fname,' ',u.lname) as clientname"
  28. . "\n FROM apparecchi as app"
  29. . "\n LEFT JOIN users as u ON u.id = app.client_id"
  30.  
  31. . $pager->limit;
  32. $row = self::$db->fetch_all($sql);
  33.  
  34. return ($row) ? $row : 0;
  35. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×