summaryrefslogtreecommitdiffstats
path: root/includes/venue.php
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2021-04-11 22:51:03 +0200
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2021-04-11 22:51:03 +0200
commit50ab799d1789d666dc1bea546701bc0ee8f8bc31 (patch)
tree650dc0494b318a0567b9f16bde22e6298d089907 /includes/venue.php
parent029f4d7a5b9aff1f7b35f060d172611ef81a2943 (diff)
downloadgigologadmin-50ab799d1789d666dc1bea546701bc0ee8f8bc31.tar.gz
gigologadmin-50ab799d1789d666dc1bea546701bc0ee8f8bc31.tar.bz2
gigologadmin-50ab799d1789d666dc1bea546701bc0ee8f8bc31.zip
Added small forms to add new venue and band
Made form for concert both functional to edit existing concert or add new concert
Diffstat (limited to 'includes/venue.php')
-rw-r--r--includes/venue.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/venue.php b/includes/venue.php
index 08e8bb5..08ab3da 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -40,20 +40,21 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
$this->webpage = isset($attrs->wpgvenue_webpage) ? $attrs->wpgvenue_webpage : NULL;
}
- static function create($name)
- {
+ static function create($name,$city)
+ { if(empty($city)) $city='Oslo';
$attrs = new stdClass();
$attrs->wpgvenue_name = $name;
+ $attrs->wpgvenue_city = $city;
$venue = new GiglogAdmin_Venue($attrs);
$venue->save();
return $venue;
}
- static function find_or_create($name)
+ static function find_or_create($name, $city)
{
global $wpdb;
-
+ if(empty($city)) $city='Oslo';
$venuesql = 'SELECT * FROM wpg_venues WHERE upper(wpgvenue_name)="' . $name . '"';
$results = $wpdb->get_results($venuesql);
@@ -61,7 +62,7 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
return new GiglogAdmin_Venue($results[0]);
}
else {
- return GiglogAdmin_Venue::create($name);
+ return GiglogAdmin_Venue::create($name, $city);
}
}