summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-03 15:07:40 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-03 15:07:40 +0200
commitc9d80308ccb63a74f7dab723dd4e73a67b7fb597 (patch)
tree19e01c8d2146f345bd6da3fb2119d1627735c93e
parent60af9af46e4c80db1bd41d77991e2cf24ed69641 (diff)
downloadgigologadmin-c9d80308ccb63a74f7dab723dd4e73a67b7fb597.tar.gz
gigologadmin-c9d80308ccb63a74f7dab723dd4e73a67b7fb597.tar.bz2
gigologadmin-c9d80308ccb63a74f7dab723dd4e73a67b7fb597.zip
Handle updating concert status again.
-rw-r--r--includes/admin/views/giglog_admin_page.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 248f175..4cb7dad 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -305,13 +305,14 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
header("Refresh: 1; URL=$url3"); //reload page
}
- //handling the admin drop down menu
- if(isset($_POST['selectstatus']) && (isset($_POST['edit']) && $_POST['edit']!="EDIT") && !empty($_POST['cid']))
+ // handle the status drop down
+ if (isset($_POST['selectstatus']) && !empty($_POST['selectstatus']) && !empty($_POST['cid']))
{
- $usql = "UPDATE wpg_concertlogs SET wpgcl_status=".$_POST['selectstatus']." WHERE wpgcl_concertid=".$_POST['cid'];
- $uresults = $wpdb->get_results($usql);
- //$url2=$_SERVER['REQUEST_URI']; //doesn't seem to be needed actually, leaving here just in case
- //header("Refresh: 1; URL=$url2"); //reload page
+ if ($_POST['selectstatus'] > 0 && $_POST['selectstatus'] < count(self::STATUS_LABELS)) {
+ $concert = GiglogAdmin_Concert::get(intval($_POST['cid']));
+ $concert->set_status(intval($_POST['selectstatus']));
+ $concert->save();
+ }
}
if(isset($_POST['newconcert'])) {