public function listaAulas() { $q = isset($_POST['q']) ? strval($_POST['q']) : ''; $aula = new Aula(); $row = $aula->find('all', array('conditions' => array('Aula.nombre like' => "%{$q}%"))); $this->set('result', $row); $this->render('listaAulas', 'ajax'); }
public function update() { $id = Input::get('id'); $tabla = Input::get('tabla'); switch ($tabla) { case '0': $clave = Input::get('clave'); $appat = Input::get('ap_pat'); $apmat = Input::get('ap_mat'); $nombre = Input::get('nombre'); $segnombre = Input::get('seg_nombre'); $tipo = Input::get('tipo'); $grado = Input::get('grado'); $tutorias = Input::get('tutorias'); $gestion = Input::get('gestion'); $investigacion = Input::get('investigacion'); $dependencias = Input::get('dependencias'); $edit = Professor::find($id); $edit->clave = $clave; $edit->ap_pat = $appat; $edit->ap_mat = $apmat; $edit->nombre = $nombre; $edit->seg_nombre = $segnombre; $edit->tipo = $tipo; $edit->id_grado = $grado; $edit->tutorias = $tutorias; $edit->gestion = $gestion; $edit->investigacion = $investigacion; $edit->dependencias = $dependencias; $edit->save(); return View::make('crud.crudMaestros')->with('professors', Professor::all()); break; case '1': $nombre = Input::get('nombre'); $semestre = Input::get('semestre'); $plan = Input::get('idPlan'); $edit = Subject::find($id); $edit->nombre = $nombre; $edit->semestre = $semestre; $edit->id_plan = $plan; $edit->save(); return View::make('crud.crudMaterias')->with('subjects', Subject::all()); break; case '2': $nombre = Input::get('nombre'); $edit = Aula::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudAulas')->with('aulas', Aula::all()); break; case '3': $nombre = Input::get('nombre'); $edit = Plan::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudPlanes')->with('plans', Plan::all()); break; default: //aqui me redirecciona a una pagina vacia solo con un mensaje 404 return View::make('landing'); break; } }
public function get_comparar_aula() { $data = Input::all(); $response = []; $temp = Horario::select('horarios.*', 'p.grupo')->join('plantillas as p', 'horarios.id_plantilla', '=', 'p.id')->where('horarios.id_aula', $data['id'])->where('p.ciclo', $data['ciclo'])->where('p.anio', $data['anio'])->get(); array_push($response, $temp); $temp = Aula::find($data['id']); array_push($response, $temp); echo json_encode($response); }