public function editGroup()
 {
     $data = Input::all();
     return View::make('proyectos.editarGrupo')->with('profesores', Professor::all())->with('data', Plantilla::select('plantillas.id', 'plantillas.grupo', 's.nombre as materia', 'plantillas.id_profesor', 'p.nombre as plan', 'pr.id as idProyecto', 'pr.ciclo', 'pr.anio')->join('subjects as s', 's.id', '=', 'plantillas.id_subject')->join('plans as p', 'p.id', '=', 's.id_plan')->join('proyectos as pr', 'plantillas.id_proyecto', '=', 'pr.id')->where('plantillas.grupo', '=', $data['g'])->where('s.semestre', '=', $data['s'])->where('p.nombre', '=', $data['pl'])->where('plantillas.id_proyecto', $data['pid'])->get())->with('aulas', Aula::all())->with('grupos', Plantilla::select('*')->groupBy('grupo')->get());
 }
Ejemplo n.º 2
0
 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;
     }
 }