summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2021-09-05 15:03:09 +0200
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2021-09-05 15:03:09 +0200
commit98909040a8dff9fb77f9e0a9acd0b9ce81236335 (patch)
tree3be5d93b369dcd9d3231d045a6afc2c5f8f96570
parent88244b19533163564098057c75952deffc7dc13e (diff)
downloadgigologadmin-98909040a8dff9fb77f9e0a9acd0b9ce81236335.tar.gz
gigologadmin-98909040a8dff9fb77f9e0a9acd0b9ce81236335.tar.bz2
gigologadmin-98909040a8dff9fb77f9e0a9acd0b9ce81236335.zip
Fixed filter by your concerts
Added CSS and extra fromatting to table
-rw-r--r--includes/admin/views/giglog_admin_page.php25
-rw-r--r--includes/concert.php4
-rw-r--r--includes/css/main.css16
3 files changed, 34 insertions, 11 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index ce0031c..fedfa6c 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -110,8 +110,8 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
//option to select own concerts only
$select .= '<input class="ownconc" type="checkbox" value="1"';
- if(isset($_POST['my_checkbox'])) $select .=' checked="checked" ';
- $select.=' name="my_checkbox">Show own concerts only</input>';
+ if(isset($_POST['ownconcerts'])) $select .=' checked="checked" ';
+ $select.=' name="ownconcerts">Show own concerts only</input>';
$select .= '<input type="submit" value="APPLY"></form>';
@@ -215,6 +215,9 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$venue = filter_input( INPUT_POST, 'selectvenue', FILTER_SANITIZE_SPECIAL_CHARS );
if ($venue) $filter['venue_id'] = $venue;
+ if(isset($_POST['ownconcerts']) && $_POST['ownconcerts'] == '1')
+ $filter['currentuser'] = wp_get_current_user()->user_login;
+
$concerts = GiglogAdmin_Concert::find_concerts($filter);
$lastType = '';
@@ -223,15 +226,15 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$content .= '<tr class="assignitr">';
if ($lastType != '' && $lastType != $concert->venue()->city()) {
- $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr>';
+ $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr class="assignitr">';
}
if ($lastType == '' ) {
- $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr>';
+ $content .= '<td>' . $concert->venue()->city() . '</td></tr><tr class="assignitr">';
}
// Modify these to match the database structure
// $content .= '<td>' . $row->id. '</td>';
- $content .= '<td></td>';
+ $content .= '<td></br></br></td>';
$content .= '<td>' . $concert->cname() . '</td>';
$content .= '<td>' . $concert->venue()->name() . '</td>';
$fdate = strtotime($concert->cdate());
@@ -239,12 +242,12 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
//$content .= DATE_FORMAT($fdate,'%d.%b.%Y');
$content .= '<td>' . $newformat . '</td>';
- $content .= '<td>' . $this->getpublishstatus($concert) . '</td>';
+ $content .= '<td class="publishstatus">' . $this->getpublishstatus($concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('photo1', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('photo2', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('rev1', $concert) . '</td>';
- $content .= '<td>' . $this->assign_role_for_user_form('rev2', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('photo1', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('photo2', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('rev1', $concert) . '</td>';
+ $content .= '<td class="assigneduser">' . $this->assign_role_for_user_form('rev2', $concert) . '</td>';
$content .= '<td>' . self::STATUS_LABELS[$concert->status()] . '</td>';
@@ -407,7 +410,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$f = '<form class="unassignit" method="POST" action="">'
. ' <input type="hidden" name="cid" value="' . $concert->id() . '" />'
. ' <input type="hidden" name="pid" value="' . $role . '" />'
- . ' <input type="submit" name="unassignitem" value="Your"/>'
+ . ' <input type="submit" name="unassignitem" value=""/>'
. '</form>';
}
elseif ( $assigned_user ) { //check if slot is taken by another user
diff --git a/includes/concert.php b/includes/concert.php
index 8210b2d..f4d7e6b 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -217,6 +217,10 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
array_push($where, 'wpg_venues.id = ' . $wpdb->prepare('%s', $filter["venue_id"]));
}
+ if ( isset( $filter["currentuser"] ) ) {
+ array_push($where , 'wpgconcert_roles like "%'.$filter["currentuser"].'%"');
+ }
+
if ( ! empty( $where ) ) {
$query .= 'WHERE ' . implode(' and ', $where);
}
diff --git a/includes/css/main.css b/includes/css/main.css
index 1cbc906..c28ae76 100644
--- a/includes/css/main.css
+++ b/includes/css/main.css
@@ -77,6 +77,7 @@ span.takenbyself
padding: none !important;
font-size: small;
vertical-align: center;
+ border-collapse:collapse;
}
table.assignit
@@ -84,6 +85,7 @@ table.assignit
{
white-space: nowrap;
overflow: hidden;
+ border-collapse:collapse;
}
input[name="unassignitem"]
@@ -162,3 +164,17 @@ input[name="unassignitem"]
{
height: auto;
}
+
+ tr.assignitr:nth-child(even){
+ background: #CCC
+ }
+
+tr.assignitr {
+ min-height: 120%;
+ }
+
+ .assigneduser, .publishstatus
+ {
+ text-align: center;
+
+ }