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'); $columnActionLabel = nexus_trans('nexus.action'); $filterForm = <<
FORM; stdhead($title); begin_main_frame(); $table = <<| ID | $columnNameLabel | $columnImageLargeLabel | $columnDurationLabel | $columnDescriptionLabel | $columnActionLabel |
| %s | %s | %s | %s | %s | ', $row->id, $row->name, $row->image_large, $row->duration, $row->description, $action ); } $table .= '