示例#1
0
 function listaAcceso(Request $r)
 {
     date_default_timezone_set("America/Mexico_City");
     $id_lab = Session::get('id_lab');
     $laboratorio = Laboratorio::find($id_lab);
     $salones = LabArea::where('id_laboratorio', $id_lab)->lists('salon');
     $labAreas = LabArea::where('id_laboratorio', $id_lab)->lists('id_area');
     $entradas = LabEntrada::whereIn('id_area', $labAreas)->whereNull('hora_salida')->paginate(8);
     $claves_mat = Horario::whereIn('salon', $salones)->lists('clave_materia');
     $materias = Materia::whereIn('clave_materia', $claves_mat)->get();
     /**  $res = ['succes'=> false];
          try {
           if($r->ajax())
           {
             $res['html'] = view('laboratorio.controlAlumnos.tablaAcceso',  array('entradas' => $entradas))-render();
             $res['succes'] = true;
             return response()->json($res);
     
           }
         } catch (Exception $e) {
           $res ['msj'] = $e->getMessage();
           return response()->json($res);
         }*/
     return view('laboratorio.controlAlumnos.acceso_alumnos', array('laboratorio' => $laboratorio, 'entradas' => $entradas, 'materias' => $materias));
 }
示例#2
0
 public function deleteDestroy($id)
 {
     $materia = Materia::findOrFail($id);
     $materia->delete();
     return $materia;
 }