public function home()
 {
     $data["inside_url"] = Config::get('app.inside_url');
     $data["user"] = Session::get('user');
     $data["reportes_cn_data"] = ReporteCN::getLast10CreatedReportesCNInfo()->get();
     return View::make('planeamiento/planeamiento', $data);
 }
Ejemplo n.º 2
0
 public function submit_enable_reporte_cn()
 {
     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) {
             $idreporte_CN = Input::get('idreporte_CN');
             $url = "reporte_cn/edit_reporte_cn/" . $idreporte_CN;
             $reporte_cn = ReporteCN::withTrashed()->find($idreporte_CN);
             $reporte_cn->restore();
             Session::flash('message', 'Se habilitó correctamente el Reporte.');
             return Redirect::to($url);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function return_reporte_cn_paac()
 {
     if (!Request::ajax() || !Auth::check()) {
         return Response::json(array('success' => false), 200);
     }
     $id = Auth::id();
     $data["inside_url"] = Config::get('app.inside_url');
     $data["user"] = Session::get('user');
     if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
         // Check if the current user is the "System Admin"
         $data = Input::get('selected_id');
         if ($data != "vacio") {
             $abreviatura = mb_substr($data, 0, 2);
             $correlativo = mb_substr($data, 2, 4);
             $anho = mb_substr($data, 7, 2);
             if ($abreviatura == "NS" || $abreviatura == "NI" || $abreviatura == "NP") {
                 $reporte = ReporteCN::searchReporteCN_PAACByCodigoReporte($abreviatura, $correlativo, $anho);
             } else {
                 $reporte = ReportePAAC::searchReporteCN_PAACByCodigoReporte($abreviatura, $correlativo, $anho);
             }
         } else {
             $reporte = null;
         }
         return Response::json(array('success' => true, 'reporte' => $reporte), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }
 public function render_edit_reporte_cn($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["areas"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["tipo_reporte_cn"] = TipoReporteCN::lists('nombre', 'idtipo_reporte_CN');
             $data["reporte_cn_info"] = ReporteCN::withTrashed()->find($id);
             $data["otretiro_info"] = OtRetiro::find($data["reporte_cn_info"]->idot_retiro);
             $data["otretiro_info"] = OtRetiro::searchOtByCodigoReporte($data["otretiro_info"]->ot_tipo_abreviatura, $data["otretiro_info"]->ot_correlativo, $data["otretiro_info"]->ot_activo_abreviatura)->get()[0];
             return View::make('reportes_CN/editReporteCN', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }