public function submit_enable_reporte_paac() { 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_PAAC = Input::get('idreporte_PAAC'); $url = "reporte_paac/edit_reporte_paac/" . $idreporte_PAAC; $reporte_paac = ReportePAAC::withTrashed()->find($idreporte_PAAC); $reporte_paac->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); } }