rutas.php 893 B

12345678910111213141516171819202122232425262728
  1. <?
  2. header('Content-Type: application/json charset=utf-8');
  3. $ruta = "../";
  4. require_once "../class/c_login.php";
  5. $universidad_la_salle = $db
  6. ->where('salon', 'UNIVERSIDAD LA SALLE', 'ILIKE')
  7. ->getOne('salon_view_mat');
  8. $rutas =
  9. array_map(
  10. function ($ruta) use ($db) {
  11. $ruta['subrutas'] =
  12. $db
  13. ->where('id_espacio_padre', $ruta['id_espacio_sgu'])
  14. ->orderBy('salon')
  15. ->get('salon_view_mat');
  16. return $ruta;
  17. },
  18. $db
  19. ->where('id_espacio_padre', $universidad_la_salle['id_espacio_sgu'])
  20. ->orderBy('salon')
  21. ->get('salon_view_mat')
  22. );
  23. // echo json_encode($universidad_la_salle, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); EXIT;
  24. echo json_encode($rutas, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);