Example #1
0
 public function getAll()
 {
     $result = array();
     $html = file_get_html("http://www.eps.uam.es/esp/alumnos/lab_horario.php?horario_id=17&semestre=S2");
     $e = $html->find('select');
     $e = $e[0];
     $curl = new CURL();
     $opts = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true);
     foreach ($e->find('option') as $g) {
         $result[] = array("id" => $g->value, "name" => $g->innertext);
         $id = $g->value;
         $curl->addSession("http://www.eps.uam.es/esp/alumnos/lab_horario.php?local_id={$id}&horario_id=17&semestre=S2", $opts);
     }
     // Ejecuta todas las peticiones en paralelo
     $pages = $curl->exec();
     $curl->clear();
     for ($i = 0; $i < sizeof($pages); $i++) {
         $result[$i]["data"] = Laboratorio::get($result[$i]["id"], $page);
     }
     return $result;
 }
Example #2
0
 public function getLabAction()
 {
     $lab = Laboratorio::get($this->_params['id']);
     return $lab;
 }