public function render_program_ot_mant_correctivo($id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if (($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) && $id) {
             $data['mes_ini'] = date("Y-m-d", strtotime("first day of this month"));
             $data['mes_fin'] = date("Y-m-d", strtotime("last day of this month"));
             $data['trimestre_ini'] = null;
             $data['trimestre_fin'] = null;
             $this->calcular_trimestre($data['trimestre_ini'], $data['trimestre_fin']);
             $data['mes'] = OtCorrectivo::getOtXPeriodo(9, $data['mes_ini'], $data['mes_fin'])->get()->count();
             $data['trimestre'] = OtCorrectivo::getOtXPeriodo(9, $data['trimestre_ini'], $data['trimestre_fin'])->get()->count();
             $data['solicitantes'] = User::getJefes()->get();
             $data["sot_info"] = SolicitudOrdenTrabajo::searchSotById($id)->get();
             $data["prioridades"] = Prioridad::lists('nombre', 'idprioridad');
             $data["tipo_fallas"] = TipoFalla::lists('nombre', 'idtipo_falla');
             if ($data["sot_info"]->isEmpty()) {
                 return Redirect::to('sot/list_sots');
             }
             $data["sot_info"] = $data["sot_info"][0];
             return View::make('ot/correctivo/createProgramOtMantCo', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function render_edit_sot($id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if (($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) && $id) {
             $tabla = Tabla::getTablaByNombre(self::$nombre_tabla)->get();
             $data["estados"] = Estado::where('idtabla', '=', $tabla[0]->idtabla)->lists('nombre', 'idestado');
             $data["sot_info"] = SolicitudOrdenTrabajo::searchSotById($id)->get();
             if ($data["sot_info"]->isEmpty()) {
                 return Redirect::to('sot/list_sots');
             }
             $data["sot_info"] = $data["sot_info"][0];
             return View::make('sot/editSot', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }