public function getServiciosAjax()
 {
     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 || $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) {
         // Check if the current user is the "System Admin"
         $data = Input::get('id_departamento');
         if ($data != 0) {
             $servicios = Servicio::where('idarea', $data)->lists('nombre', 'idservicio');
         } else {
             $servicios = array();
         }
         return Response::json(array('success' => true, 'servicios' => $servicios), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }
 public function return_area()
 {
     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") {
             $servicio = Servicio::where('idservicio', '=', $data)->get();
         } else {
             $servicio = null;
         }
         return Response::json(array('success' => true, 'servicio' => $servicio), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }
 public function getServiciosAjax()
 {
     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 || $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) {
         $data = Input::get('value');
         if ($data != "") {
             $servicios = Servicio::where('idarea', '=', $data)->get();
         } else {
             $servicios = array();
         }
         return Response::json(array('success' => true, 'servicios' => $servicios), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }