summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/admin/views/giglog_admin_page.php36
-rw-r--r--includes/band.php107
-rw-r--r--includes/css/main.css21
-rw-r--r--includes/venue.php144
4 files changed, 156 insertions, 152 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 89e92fd..c00284b 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -42,21 +42,22 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
<p><?php echo GiglogAdmin_AdminPage::get_filters() ?></p>
<p><?php echo GiglogAdmin_AdminPage::get_concerts() ?></p>
</div>
-
- <form method="POST" action="" class="concedit" > Here Be Dragons <br>
- <label for="band">Band:</label><?php echo GiglogAdmin_AdminPage::get_allbands() ?><br>
- <label for="venue">Venue:</label><?php echo GiglogAdmin_AdminPage::get_allvenues() ?><br>
- <label for="cdate">Date:</label><input type="date" id="cdate" name="cdate"><br>
- <label for="ticket">Tickets:</label><input type="text" id="ticket" name="ticket"><br>
- <label for="eventurl">Event link:</label><input type="text" id="eventurl" name="eventurl"><br>
-
- <p><button>Submit</button></p>
- </form>
- <?php
+
+
+ <form method="POST" action="" class="concedit" > Here Be Dragons <br>
+ <label for="band">Band:</label><?php echo GiglogAdmin_AdminPage::get_allbands() ?><br>
+ <label for="venue">Venue:</label><?php echo GiglogAdmin_AdminPage::get_allvenues() ?><br>
+ <label for="cdate">Date:</label><input type="date" id="cdate" name="cdate"><br>
+ <label for="ticket">Tickets:</label><input type="text" id="ticket" name="ticket"><br>
+ <label for="eventurl">Event link:</label><input type="text" id="eventurl" name="eventurl"><br>
+
+ <p><button>Submit</button></p>
+ </form>
+ <?php //currnet comment and above form can be removed once we decide how to...form. The form is meant to allow adding single concerts or editing one in the table.
}
static function get_allvenues()
- { $select .= '<select name="selectvenue">';
- foreach ( GiglogAdmin_Venue::all_venues() AS $venue )
+ { $select .= '<select name="selectvenue">';
+ foreach ( GiglogAdmin_Venue::all_venues() AS $venue )
{
$select .= '<option value="' . $venue -> id. '">'.$venue->vname;
$select .='</option>';
@@ -67,12 +68,13 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
static function get_allbands()
- {
+ {
$select .= '<select name="selectband">';
+
foreach ( GiglogAdmin_Band::all_bands() AS $band )
{
$select .= '<option value="' . $band -> id. '">'.$band->vname;
- $select .='</option>';
+ $select .='</option>';
}
$select .= '</select>';
return($select);
@@ -144,7 +146,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
return $select;
}
-
+
//function to calculate if the concert has been added in the past 10 days or before that and show a green NEW for the newest rows
static function getpublishstatus($concert_id)
{
@@ -158,7 +160,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$date2 = new DateTime($x, new DateTimeZone('Europe/London'));
$dd = $date2 -> diff($date1) ->format("%a");
}
-
+
if ($dd <= 10) return ('<span style="color:green">NEW</span>');
}
diff --git a/includes/band.php b/includes/band.php
index 12e80f4..9ed7a53 100644
--- a/includes/band.php
+++ b/includes/band.php
@@ -1,53 +1,54 @@
-<?php
-/*
- * Copyright (C) 2021 Harald Eilertsen, Andrea Chirulescu
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-if ( !class_exists('GiglogAdmin_Band') ) {
- class GiglogAdmin_Band
- {
- static function create($name)
- {
- global $wpdb;
-
- $wpdb->insert('wpg_bands', array(
- 'id' => '',
- 'wpgband_name' => $name
- ));
-
- return $wpdb->insert_id;
- }
-
- static function find_or_create($name)
- {
- global $wpdb;
-
- $bandsql = 'SELECT id FROM wpg_bands WHERE upper(wpgband_name)="' . $name . '"';
- $results = $wpdb->get_results($bandsql);
-
- return $results ? $results[0]->id : GiglogAdmin_Band::create($name);
- }
- static function all_bands()
- {
- global $wpdb;
-
- $results = $wpdb->get_results("select id, wpgband_name as vname from wpg_bands order by wpgband_name");
-
- return ($results);
- }
-
- }
-}
+<?php
+/*
+ * Copyright (C) 2021 Harald Eilertsen, Andrea Chirulescu
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if ( !class_exists('GiglogAdmin_Band') ) {
+ class GiglogAdmin_Band
+ {
+ static function create($name)
+ {
+ global $wpdb;
+
+ $wpdb->insert('wpg_bands', array(
+ 'id' => '',
+ 'wpgband_name' => $name
+ ));
+
+ return $wpdb->insert_id;
+ }
+
+ static function find_or_create($name)
+ {
+ global $wpdb;
+
+ $bandsql = 'SELECT id FROM wpg_bands WHERE upper(wpgband_name)="' . $name . '"';
+ $results = $wpdb->get_results($bandsql);
+
+ return $results ? $results[0]->id : GiglogAdmin_Band::create($name);
+ }
+
+ static function all_bands()
+ {
+ global $wpdb;
+
+ $results = $wpdb->get_results("select id, wpgband_name as vname from wpg_bands order by wpgband_name");
+
+ return ($results);
+ }
+
+ }
+}
diff --git a/includes/css/main.css b/includes/css/main.css
index bf2ca4a..56fb365 100644
--- a/includes/css/main.css
+++ b/includes/css/main.css
@@ -18,20 +18,20 @@ input[name="assignitem"]
background: transparent;
- border: none;
-
+ border: none;
+
font-size: small;
padding: none;
background-image: url('/wp-content/plugins/giglogadmin/assets/images/checkedbox.png');
-
+
background-repeat: no-repeat;
background-size: 15px 15px;
-
+
width: 20px;
-
+
height: 20px;
vertical-align: center;
@@ -59,8 +59,8 @@ input[name="unassignitem"]
background: transparent;
- border: none;
-
+ border: none;
+
font-size: small;
padding: none;
@@ -70,9 +70,9 @@ input[name="unassignitem"]
background-repeat: no-repeat;
background-size: 15px 15px;
-
+
width: 20px;
-
+
height: 20px;
vertical-align: center;
@@ -82,7 +82,8 @@ input[name="unassignitem"]
.adminbuttons form
{
display: flex; /* 2. display flex to the rescue */
- flex-direction: row;
+
+ flex-direction: row;
}
.adminbuttons input
{ width: 80px;
diff --git a/includes/venue.php b/includes/venue.php
index b742a17..4951d6b 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -1,72 +1,72 @@
-<?php
-/*
- * Copyright (C) 2021 Harald Eilertsen, Andrea Chirulescu
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-if ( !class_exists('GiglogAdmin_Venue') ) {
- class GiglogAdmin_Venue
- {
- static function create($name)
- {
- global $wpdb;
-
- $wpdb->insert('wpg_venues', array(
- 'id' => '',
- 'wpgvenue_name' => $name
- ));
-
- return $wpdb->insert_id;
- }
-
- static function find_or_create($name)
- {
- global $wpdb;
-
- $venuesql = 'SELECT id FROM wpg_venues WHERE upper(wpgvenue_name)="' . $name . '"';
- $results = $wpdb->get_results($venuesql);
-
- return $results ? $results[0]->id : GiglogAdmin_Venue::create($name);
- }
-
- static function all_cities()
- {
- global $wpdb;
- $results = $wpdb->get_results('select distinct wpgvenue_city from wpg_venues');
-
- return array_map(function ($r) { return $r->wpgvenue_city; }, $results);
- }
-
- static function all_venues()
- {
- global $wpdb;
-
- $results = $wpdb->get_results("select id, CONCAT( IFNULL(wpgvenue_name,''),'-',IFNULL(wpgvenue_city,'')) as vname from wpg_venues");
-
- return ($results);
- }
-
-
- static function venues_in_city($city)
- {
- global $wpdb;
- $q = $wpdb->prepare(
- "select id, wpgvenue_name from wpg_venues where wpgvenue_city=?", $city);
- $results = $wpdb->get_results($q);
-
- return array_map(function ($r) { return [$r->id, $r->wpgvenue_name]; }, $results);
- }
- }
-}
+<?php
+/*
+ * Copyright (C) 2021 Harald Eilertsen, Andrea Chirulescu
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if ( !class_exists('GiglogAdmin_Venue') ) {
+ class GiglogAdmin_Venue
+ {
+ static function create($name)
+ {
+ global $wpdb;
+
+ $wpdb->insert('wpg_venues', array(
+ 'id' => '',
+ 'wpgvenue_name' => $name
+ ));
+
+ return $wpdb->insert_id;
+ }
+
+ static function find_or_create($name)
+ {
+ global $wpdb;
+
+ $venuesql = 'SELECT id FROM wpg_venues WHERE upper(wpgvenue_name)="' . $name . '"';
+ $results = $wpdb->get_results($venuesql);
+
+ return $results ? $results[0]->id : GiglogAdmin_Venue::create($name);
+ }
+
+ static function all_cities()
+ {
+ global $wpdb;
+ $results = $wpdb->get_results('select distinct wpgvenue_city from wpg_venues');
+
+ return array_map(function ($r) { return $r->wpgvenue_city; }, $results);
+ }
+
+ static function all_venues()
+ {
+ global $wpdb;
+
+ $results = $wpdb->get_results("select id, CONCAT( IFNULL(wpgvenue_name,''),'-',IFNULL(wpgvenue_city,'')) as vname from wpg_venues");
+
+ return ($results);
+ }
+
+
+ static function venues_in_city($city)
+ {
+ global $wpdb;
+ $q = $wpdb->prepare(
+ "select id, wpgvenue_name from wpg_venues where wpgvenue_city=?", $city);
+ $results = $wpdb->get_results($q);
+
+ return array_map(function ($r) { return [$r->id, $r->wpgvenue_name]; }, $results);
+ }
+ }
+}