diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/admin/views/giglog_admin_page.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 624566f..b78b4db 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(): string { $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,25 +86,25 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $select = '<form method="POST" action="">FILTER DATA: <select name="selectcity">'; foreach ( $cities AS $city ) { - $select .= '<option value="' . $city . '"' . selected($city, $selected_city) . '>'; + $select .= '<option value="' . $city . '"' . selected($city,$cty ) . '>'; $select .= $city . '</option>'; } $select .= '</select>'; - 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 .= '<select name="selectvenue">'; @@ -111,8 +112,8 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { $select .= '<option value="' . $venue[0] . '"' . selected($venue, $selected_venue) . '>'; $select .= $venue[1] . '</option>'; } - $select .= '</select>'; + } //option to select own concerts only $select .= '<input class="ownconc" type="checkbox" value="1"'; |