public function index()
 {
     $user_id = Auth::user()->id;
     $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
     $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
     $logs = Logs::all();
     return View::make('dashboard.logs.index', ['nombre' => $breadcrumbs_data, 'logs' => $logs]);
 }
 public function index_lic()
 {
     $user_id = Auth::user()->id;
     $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
     $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
     $colonies_active = LicenseExpiration::where('expiration', '!=', '0000-00-00')->get();
     $admin_colonies = AssigmentRoleHab::where('role_id', '=', 2)->get();
     return View::make('dashboard.colonies.active', ['nombre' => $breadcrumbs_data, 'colonies' => $colonies_active, 'admin' => $admin_colonies]);
 }
 public function report_promo($colony)
 {
     $user_id = Auth::user()->id;
     $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
     $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
     $colony_data = Colony::where('id', '=', $colony)->first();
     $colony_name = $colony_data->name;
     $promos = Promo::where('colony_id', '=', $colony)->get();
     return View::make('dashboard.promos.report_promo', ['nombre' => $breadcrumbs_data, 'colony_name' => $colony_name, 'promos' => $promos, 'num' => 1]);
 }
 public function sugerenciasViewSent($id_mensaje)
 {
     $user_id = Auth::user()->id;
     $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
     $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
     $suggestions = DB::connection('habitaria_dev')->table("suggestions")->where('id_mensaje', '=', $id_mensaje)->first();
     $user = User::with('Data_users')->find($suggestions->user_id);
     $count = DB::connection('habitaria_dev')->table("suggestions")->where('bd_inbox', '=', 1)->where('tray', '<>', 0)->where('id_receptor', '=', 0)->where('mark', '=', 'unread')->count();
     return View::make('dashboard.suggestions.suggestions_view_sent', ['nombre' => $breadcrumbs_data, 'suggestions' => $suggestions, 'count' => $count, 'contador' => 1, 'user' => $user]);
 }
 public function report_license($colony)
 {
     $user_id = Auth::user()->id;
     $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
     $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
     $colony_data = Colony::where('id', '=', $colony)->first();
     $colony_name = $colony_data->name;
     $licenses = License::where('colony_id', '=', $colony)->get();
     return View::make('dashboard.license.report_license', ['nombre' => $breadcrumbs_data, 'colony_name' => $colony_name, 'licenses' => $licenses, 'num' => 1]);
 }
    public function index()
    {
        if (Auth::check()) {
            $user_id = Auth::user()->id;
            $breadcrumbs = Data_users::where('user_id', '=', $user_id)->first();
            $breadcrumbs_data = $breadcrumbs->name . " " . $breadcrumbs->last_name;
            $Status = DB::connection('habitaria_dev')->select('SELECT Count(suggestions.id) as cantidad, suggestions.status FROM suggestions
GROUP BY suggestions.status');
            $Asunto = DB::connection('habitaria_dev')->select('SELECT Count(suggestions.id) as cantidad, suggestions.asunto FROM suggestions
GROUP BY suggestions.asunto');
            return View::make('dashboard.home', ['nombre' => $breadcrumbs_data, 'Status' => $Status, 'Asunto' => $Asunto]);
        } else {
            return Redirect::action('UsersController@login');
        }
    }
 public function profile()
 {
     $user_id = Auth::user()->id;
     $user_data = Data_users::where('user_id', '=', $user_id)->first();
     $role = AssigmentRole::where('user_id', '=', $user_id)->first();
     $user_role = ucfirst($role->Role->name);
     return View::make('users.profile', ['role' => $user_role, 'user' => $user_data]);
 }