From c3a19d2a6b392d9f3ab58c61ed83bdf25d919c9e Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Tue, 4 May 2021 20:14:40 +0200 Subject: Fixed venue by city filter. With a small exception: cna't get it to select in dropdown --- includes/admin/views/giglog_admin_page.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'includes/admin/views/giglog_admin_page.php') diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 72a34eb..3482ae2 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -78,6 +78,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { static function get_filters() { $cities = array_merge(["ALL"], GiglogAdmin_Venue::all_cities()); + $cty = filter_input( INPUT_POST, 'selectcity', FILTER_SANITIZE_SPECIAL_CHARS ); $selected_city = filter_input(INPUT_POST, "selectcity", FILTER_SANITIZE_SPECIAL_CHARS) || $cities[0]; @@ -85,34 +86,34 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $select = '
FILTER DATA: '; - if ( $selected_city != "ALL" ) { + + if ( $cty && $cty!= "ALL" ) { //second drop down for venue + $venues = GiglogAdmin_Venue::venues_in_city($cty); - $venues = GiglogAdmin_Venue::venues_in_city($selected_city); $venue_list = array_merge( [0, "ALL"], array_map( function($v) { return [$v->id(), $v->name()]; }, $venues)); - $selected_venue = - filter_input(INPUT_POST, "selectvenue", FILTER_SANITIZE_SPECIAL_CHARS) - || $venues[0]; + $selected_venue = filter_input(INPUT_POST, "selectvenue", FILTER_SANITIZE_SPECIAL_CHARS) + || $venue_list[0]; $select .= ''; + } //option to select own concerts only $select .= '