// SPDX-FileCopyrightText: 2021 Harald Eilertsen ';
// $content .= '
';
$content.='CITY ID BAND VENUE DATE ';
$content .= ' ';
//pagination. Change value as needed
$total_records_per_page = 15;
$filter = [];
// Use the submitted "city" if any. Otherwise, use the default/static value.
$cty = filter_input( INPUT_POST, 'selectcity', FILTER_SANITIZE_SPECIAL_CHARS );
if ($cty) {
$filter['city'] = $cty;
}
$venue = filter_input( INPUT_POST, 'selectvenue', FILTER_SANITIZE_SPECIAL_CHARS );
if ($venue) {
$filter['venue_id'] = $venue;
}
$smonth = filter_input( INPUT_POST, 'selectmonth', FILTER_SANITIZE_SPECIAL_CHARS );
if ($smonth) {
$filter['month'] = $smonth;
}
if(isset($_POST['ownconcerts']) && $_POST['ownconcerts'] == '1') {
$filter['currentuser'] = wp_get_current_user()->user_login;
}
$concerts = GiglogAdmin_Concert::find_concerts($filter);
//get number of pages for pagination
$total_records = count($concerts);
$total_no_of_pages = ceil($total_records / $total_records_per_page);
$second_last = $total_no_of_pages - 1; // total pages minus 1
if (isset($_GET['page_no']) && $_GET['page_no']!="" && $_GET['page_no']<=$total_no_of_pages) {
$page_no = $_GET['page_no'];
} else {
$page_no = 1;
}
//calculate OFFSET Value and SET other Variables
$offset = ($page_no-1) * $total_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2";
$filter['offset'] = $offset;
$filter['recperpage'] = $total_records_per_page;
$concertsp = GiglogAdmin_Concert::find_concerts($filter);
$lastType = '';
foreach ( $concertsp AS $concert ) {
$content .= 'CITY DATE NAME VENUE ';
if (!is_admin()) {
$content .= 'EVENT TICKETS ';
}
else {
$content .= ' PHOTO1 PHOTO2 TEXT1 TEXT2 STATUS ';
if (current_user_can('administrator')) {
$content .= 'AdminOptions ';
}
}
$content .= '';
if ($lastType != '' && $lastType != $concert->venue()->city()) {
$content .= ' ';
$lastType = $concert->venue()->city();
}
$content .= '' . $concert->venue()->city() . ' ';
}
if ($lastType == '' ) {
$content .= '' . $concert->venue()->city() . ' ';
}
if ($lastType != '' && $lastType == $concert->venue()->city()) {
$content .= '';
}
$fdate = strtotime($concert->cdate());
$newformat = date('d.M.Y',$fdate);
//$content .= DATE_FORMAT($fdate,'%d.%b.%Y');
$content .= ' ' . $newformat . ' ';
$content .= ''. $concert->cname() . ' ';
$content .= '' . $concert->venue()->name() . ' ';
if(!is_admin()){
$content .= 'Link ';
$content .= 'Tickets ';
}
else {
$content .= '' . $this->mark_new_concert($concert) . ' ';
$content .= '' . $this->assign_role_for_user_form('photo1', $concert) . ' ';
$content .= '' . $this->assign_role_for_user_form('photo2', $concert) . ' ';
$content .= '' . $this->assign_role_for_user_form('rev1', $concert) . ' ';
$content .= '' . $this->assign_role_for_user_form('rev2', $concert) . ' ';
$content .= '' . self::STATUS_LABELS[$concert->status()] . ' ';
if (current_user_can('administrator')) {
$content .= ''
. $this->adminactions($concert)
. ' ';
}
}
$content .= '