summaryrefslogtreecommitdiffstats
path: root/includes/concert.php
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2022-02-09 19:55:39 +0100
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2022-02-09 19:55:39 +0100
commit1ceb9d3a96534f327fa59694c463c258040fe7fe (patch)
tree83c86be94b77d2f8004e8f1bb2e16d1f2327a7a5 /includes/concert.php
parentac623b61ba321a844d5c187124d84e6fd13bf1a8 (diff)
downloadgigologadmin-1ceb9d3a96534f327fa59694c463c258040fe7fe.tar.gz
gigologadmin-1ceb9d3a96534f327fa59694c463c258040fe7fe.tar.bz2
gigologadmin-1ceb9d3a96534f327fa59694c463c258040fe7fe.zip
css small fixed for table display
added pagination to concert list
Diffstat (limited to 'includes/concert.php')
-rw-r--r--includes/concert.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/includes/concert.php b/includes/concert.php
index 8609694..a67364f 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -208,6 +208,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
];
$where = [];
+ $lmt=[];
foreach( $filter as $key => $value ) {
switch ($key) {
case 'name':
@@ -219,12 +220,20 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
case 'id':
case 'venue_id':
- array_push($where, $wpdb->prepare($keymap[$key] . '=%d', $value));
- break;
+ array_push($where, $wpdb->prepare($keymap[$key] . '=%d', $value));
+ break;
case 'currentuser':
- array_push($where , $wpdb->prepare($keymap[$key] . ' like "%%%s%%"', $value));
- break;
+ array_push($where , $wpdb->prepare($keymap[$key] . ' like "%%%s%%"', $value));
+ break;
+
+ case 'offset':
+ array_push($lmt , $value);
+ break;
+
+ case 'recperpage':
+ array_push($lmt , $value);
+ break;
}
}
@@ -234,6 +243,10 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
$query.= ' ORDER BY wpgconcert_date';
+ if ( ! empty( $lmt ) ) {
+ $query .= ' LIMIT ' . implode(', ', $lmt);
+ }
+
$results = $wpdb->get_results($query);
return array_map(function($c) { return new GiglogAdmin_Concert($c); }, $results);