where('display_on_medal_page', 1); $q = htmlspecialchars($_REQUEST['q'] ?? ''); if (!empty($q)) { $query->where('username', 'name', "%{$q}%"); } $total = (clone $query)->count(); $perPage = 20; list($paginationTop, $paginationBottom, $limit, $offset) = pager($perPage, $total, "?"); $rows = (clone $query)->offset($offset)->take($perPage)->orderBy('id', 'desc')->get(); $q = htmlspecialchars($q); $title = nexus_trans('medal.label'); $columnNameLabel = nexus_trans('label.name'); $columnImageLargeLabel = nexus_trans('medal.fields.image_large'); $columnPriceLabel = nexus_trans('medal.fields.price'); $columnDurationLabel = nexus_trans('medal.fields.duration'); $columnDescriptionLabel = nexus_trans('medal.fields.description'); $columnBuyLabel = nexus_trans('medal.buy_btn'); $columnSaleBeginEndTimeLabel = nexus_trans('medal.fields.sale_begin_end_time'); $columnInventoryLabel = nexus_trans('medal.fields.inventory'); $columnBonusAdditionFactorLabel = nexus_trans('medal.fields.bonus_addition_factor'); $columnGiftLabel = nexus_trans('medal.gift_btn'); $columnGiftFeeFactorLabel = nexus_trans('medal.fields.gift_fee_factor'); $header = '
| ID | $columnNameLabel | $columnImageLargeLabel | $columnSaleBeginEndTimeLabel | $columnBonusAdditionFactorLabel | $columnGiftFeeFactorLabel | $columnPriceLabel | $columnDurationLabel | $columnInventoryLabel | $columnDescriptionLabel | $columnBuyLabel | $columnGiftLabel |
| %s | %s | %s ~ %s | %s | %s | %s | %s | %s | %s | %s | %s | ', $row->id, $row->name, $row->image_large, $row->sale_begin_time ?? '--', $row->sale_end_time ?? '--', $row->bonus_addition_factor, $row->gift_fee_factor ?? 0, number_format($row->price), $row->durationText, $row->inventory ?? nexus_trans('label.infinite'), $row->description, $buyAction, $giftAction ); } $table .= '