From eb7e2ac02d652ac1ec9c842b14e1efbc27e852fc Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Fri, 9 Apr 2021 16:53:04 +0200 Subject: Beuatified files after using editconfig with notepad++ --- includes/admin/views/giglog_admin_page.php | 36 ++++---- includes/band.php | 107 ++++++++++----------- includes/css/main.css | 21 +++-- includes/venue.php | 144 ++++++++++++++--------------- 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' ) ) {

- -
Here Be Dragons
-
-
-
-
-
- -

-
- Here Be Dragons
+
+
+
+
+
+ +

+ + '; - foreach ( GiglogAdmin_Venue::all_venues() AS $venue ) + { $select .= ''; + foreach ( GiglogAdmin_Band::all_bands() AS $band ) { $select .= ''; + $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 ('NEW'); } 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 @@ -. - */ - -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); - } - - } -} +. + */ + +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 @@ -. - */ - -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); - } - } -} +. + */ + +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); + } + } +} -- cgit v1.2.3