mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-03 01:34:53 +02:00
feat: implement per-page entry selection for voucher management and enhance UI styling
This commit is contained in:
parent
abc847cf55
commit
92d9db3071
2 changed files with 86 additions and 11 deletions
|
@ -439,7 +439,7 @@ switch ($action) {
|
|||
$plan = _req('plan');
|
||||
$status = _req('status');
|
||||
$batch_name = _req('batch_name');
|
||||
|
||||
|
||||
$ui->assign('batch_name', $batch_name);
|
||||
$ui->assign('router', $router);
|
||||
$ui->assign('customer', $customer);
|
||||
|
@ -470,6 +470,27 @@ switch ($action) {
|
|||
$query->where('tbl_voucher.batch_name', $batch_name);
|
||||
}
|
||||
|
||||
if (!empty($_COOKIE['per-page']) && $_COOKIE['per-page'] != $config['voucher_per_page']) {
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'voucher_per_page')->find_one();
|
||||
if ($d) {
|
||||
$d->value = $_COOKIE['per-page'];
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'voucher_per_page';
|
||||
$d->value = $_COOKIE['per-page'];
|
||||
$d->save();
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_per_page']) && empty($_COOKIE['per-page'])) {
|
||||
$_COOKIE['per-page'] = $config['voucher_per_page'];
|
||||
setcookie('per-page', $config['voucher_per_page'], time() + (86400 * 30), "/");
|
||||
}
|
||||
|
||||
$ui->assign('cookie', $_COOKIE['per-page']);
|
||||
|
||||
$per_page = (!empty($_COOKIE['per-page']) && $_COOKIE['per-page'] != $config['voucher_per_page']) ? $_COOKIE['per-page'] : '10';
|
||||
|
||||
$append_url = "&search=" . urlencode($search) . "&router=" . urlencode($router) . "&customer=" . urlencode($customer) . "&plan=" . urlencode($plan) . "&status=" . urlencode($status);
|
||||
|
||||
// option customers
|
||||
|
@ -508,7 +529,7 @@ switch ($action) {
|
|||
$query->where_in('generated_by', $sales);
|
||||
}
|
||||
}
|
||||
$d = Paginator::findMany($query, ["search" => $search], 10, $append_url);
|
||||
$d = Paginator::findMany($query, ["search" => $search], $per_page, $append_url);
|
||||
// extract admin
|
||||
$admins = [];
|
||||
foreach ($d as $k) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue