public function dashboard()
 {
     $subscriber = Subscriber::find(Auth::id());
     $plan = Subscriber::getActiveServices($subscriber);
     return View::make('user.prepaid.dashboard')->with('profile', Auth::user())->with('plan', $plan);
 }
 public function getActiveServices($user_id)
 {
     $profile = Subscriber::findOrFail($user_id);
     $plan = Subscriber::getActiveServices($profile);
     $framedIP = SubnetIP::where('user_id', $user_id)->first();
     $framedRoute = UserRoute::where('user_id', $user_id)->first();
     switch ($profile->plan_type) {
         case FREE_PLAN:
         case PREPAID_PLAN:
             $rc_history = Voucher::where('user_id', $user_id)->leftJoin('voucher_limits as l', 'l.id', '=', 'limit_id')->paginate(5);
             return View::make("admin.accounts.services")->with('profile', $profile)->with('rc_history', $rc_history)->with('plan', $plan)->with('framedIP', $framedIP)->with('framedRoute', $framedRoute);
             break;
         case ADVANCEPAID_PLAN:
             $rproducts = APRecurringProduct::where('user_id', $profile->id)->get();
             $nrproducts = APNonRecurringProduct::where('user_id', $profile->id)->get();
             return View::make('admin.accounts.services-ap2')->with('profile', $profile)->with('plan', $plan)->with('framedIP', $framedIP)->with('framedRoute', $framedRoute)->with('rproducts', $rproducts)->with('nrproducts', $nrproducts);
             break;
     }
 }