diff --git a/public/ajax.php b/public/ajax.php index 8fe245a5..c9d9a0cc 100644 --- a/public/ajax.php +++ b/public/ajax.php @@ -131,3 +131,10 @@ function clearShoutBox($params) \Nexus\Database\NexusDB::table('shoutbox')->delete(); return true; } + +function buyMedal($params) +{ + global $CURUSER; + $rep = new \App\Repositories\BonusRepository(); + return $rep->consumeToBuyMedal($CURUSER['id'], $params['medal_id']); +} diff --git a/public/medal.php b/public/medal.php index c81d12ed..bf87cabe 100644 --- a/public/medal.php +++ b/public/medal.php @@ -7,7 +7,7 @@ if (!empty($q)) { $query->where('username', 'name', "%{$q}%"); } $total = (clone $query)->count(); -$perPage = 50; +$perPage = 20; list($paginationTop, $paginationBottom, $limit, $offset) = pager($perPage, $total, "?"); $rows = (clone $query)->offset($offset)->take($perPage)->orderBy('id', 'desc')->get(); $q = htmlspecialchars($q); @@ -44,25 +44,48 @@ $table = <<
| %s | %s | %s | %s | %s | ', + '|
| %s | %s | %s | %s | %s | ', $row->id, $row->name, $row->image_large, $row->duration, $row->description, $action ); } $table .= '