summaryrefslogtreecommitdiffstats
path: root/lib/class/democratic.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/democratic.class.php')
-rw-r--r--lib/class/democratic.class.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php
index 32ecbee2..922120d2 100644
--- a/lib/class/democratic.class.php
+++ b/lib/class/democratic.class.php
@@ -374,6 +374,32 @@ class Democratic extends tmpPlaylist {
} // delete_votes
/**
+ * delete
+ * This deletes a democratic playlist
+ */
+ public static function delete($democratic_id) {
+
+ $democratic_id = Dba::escape($democratic_id);
+
+ $sql = "DELETE FROM `democratic` WHERE `id`='$democratic_id'";
+ $db_results = Dba::query($sql);
+
+ return true;
+
+ } // delete
+
+ /**
+ * update
+ * This updates an existing democratic playlist item. It takes a key'd array just like the create
+ */
+ public function update($data) {
+
+
+
+
+ } // update
+
+ /**
* create
* This is the democratic play create function it inserts this into the democratic table
*/
@@ -387,8 +413,8 @@ class Democratic extends tmpPlaylist {
$default = Dba::escape($data['make_default']);
$user = Dba::escape($GLOBALS['user']->id);
- $sql = "INSERT INTO `democratic` (`name`,`cooldown`,`level`,`user`,`primary`) " .
- "VALUES ('$name','$cool','$level','$user','$default')";
+ $sql = "INSERT INTO `democratic` (`name`,`base_playlist`,`cooldown`,`level`,`user`,`primary`) " .
+ "VALUES ('$name','$base','$cool','$level','$user','$default')";
$db_results = Dba::query($sql);
return $db_results;