where('username', 'like', "%{$q}%"); } $total = (clone $query)->count(); $perPage = 50; list($paginationTop, $paginationBottom, $limit, $offset) = pager($perPage, $total, "?"); $rows = (clone $query)->offset($offset)->take($perPage)->orderBy('id', 'desc')->get()->toArray(); $header = [ 'id' => 'ID', 'uid' => 'UID', 'username' => 'Username', 'reason' => 'Reason', 'created_at' => 'Created at', ]; $table = build_table($header, $rows); $q = htmlspecialchars($q); $filterForm = <<
FORM; stdhead('User ban log'); begin_main_frame(); echo $filterForm . $table . $paginationBottom; end_main_frame(); stdfoot();