public function showhome() { $jewels = WebShopItems::select('price')->where('belongto', 'j')->get(); $shopitems = WebShopItems::whereNotIn('belongto', array('j', 'ad'))->where('onsale', 1)->orderby('uptime', 'desc')->take(5)->get(); $online = DB::connection('MuOnline')->select('SELECT COUNT(DISTINCT AccountID) AS Count FROM ConnectionHistory WHERE Date > DATEADD(day, -1, GETDATE())'); $numchars = DB::connection('MuOnline')->select('SELECT COUNT(Name) AS Count FROM Character'); $visited = DB::connection('MuOnline')->select('SELECT COUNT(DISTINCT IP) AS Count FROM ConnectionHistory'); $data = array('page' => 'Home', 'id' => NULL, 'coin' => NULL, 'jewels' => $jewels, 'items' => $shopitems, 'numchars' => $numchars, 'visited' => $visited, 'online' => $online); return View::make('template/neon/home')->with($data); }
public function showmarket() { $db = Session::get('db'); Config::set('database.default', $db); $shopitems = WebShopItems::whereNotIn('belongto', array('j', 'ad'))->where('onsale', 1)->orderby('uptime', 'desc')->paginate(7); $jewels = WebShopItems::where('belongto', 'j')->get(); if (Auth::check()) { $id = Auth::user()->memb___id; $coin = $this->getCoin($id); } else { $id = NULL; $coin = NULL; } $data = array('page' => 'Auction House', 'id' => $id, 'coin' => $coin, 'items' => $shopitems, 'jewels' => $jewels); return View::make('template/neon/market')->with($data); }