public static function templateDelete()
 {
     $sql = 'DELETE FROM ' . $GLOBALS['table_prefix'] . 'template WHERE id=:id;';
     try {
         $db = PDO::getConnection();
         $stmt = $db->prepare($sql);
         $stmt->bindParam('id', $_REQUEST['id']);
         $stmt->execute();
         $db = null;
         Response::outputDeleted('Template', $_REQUEST['id']);
     } catch (PDOException $e) {
         Response::outputError($e);
     }
 }
 public static function templateDelete()
 {
     $sql = 'DELETE FROM ' . $GLOBALS['table_prefix'] . 'template WHERE id=:id';
     try {
         if (!is_numeric($_REQUEST['id'])) {
             Response::outputErrorMessage('invalid call');
         }
         $db = PDO::getConnection();
         $stmt = $db->prepare($sql);
         $stmt->bindParam('id', $_REQUEST['id'], PDO::PARAM_STR);
         $stmt->execute();
         $db = null;
         Response::outputDeleted('Template', $_REQUEST['id']);
     } catch (\Exception $e) {
         Response::outputError($e);
     }
 }
 /**
  * Unassigns a list from a campaign.
  * 
  * <p><strong>Parameters:</strong><br/>
  * [*list_id] {integer} the ID of the list.<br/>
  * [*campaign_id] {integer} the ID of the campaign.
  * </p>
  * <p><strong>Returns:</strong><br/>
  * System message of action.
  * </p>
  */
 public static function listCampaignDelete($list_id = 0, $campaign_id = 0)
 {
     if ($list_id == 0) {
         $list_id = $_REQUEST['list_id'];
     }
     if ($campaign_id == 0) {
         $campaign_id = $_REQUEST['campaign_id'];
     }
     $sql = 'DELETE FROM ' . $GLOBALS['tables']['listmessage'] . ' WHERE listid=:list_id AND messageid=:campaign_id;';
     try {
         $db = PDO::getConnection();
         $stmt = $db->prepare($sql);
         $stmt->bindParam('campaign_id', $campaign_id, PDO::PARAM_INT);
         $stmt->bindParam('list_id', $list_id, PDO::PARAM_INT);
         $stmt->execute();
         $db = null;
         Response::outputMessage('Campaign ' . $campaign_id . ' wsa removed from list ' . $list_id);
     } catch (\Exception $e) {
         Response::outputError($e);
     }
     die(0);
 }
 /**
  * Delete a Subscriber.
  * 
  * <p><strong>Parameters:</strong><br/>
  * [*id] {integer} the ID of the Subscriber.<br/>
  * </p>
  * <p><strong>Returns:</strong><br/>
  * The deleted Subscriber ID.
  * </p>
  */
 public static function subscriberDelete()
 {
     $sql = 'DELETE FROM ' . $GLOBALS['tables']['user'] . ' WHERE id=:id;';
     try {
         if (!is_numeric($_REQUEST['id'])) {
             Response::outputErrorMessage('invalid call');
         }
         $db = PDO::getConnection();
         $stmt = $db->prepare($sql);
         $stmt->bindParam('id', $_REQUEST['id'], PDO::PARAM_INT);
         $stmt->execute();
         $db = null;
         Response::outputDeleted('Subscriber', sprintf('%d', $_REQUEST['id']));
     } catch (\Exception $e) {
         Response::outputError($e);
     }
 }
 /**
  * Update existing message/campaign.
  * 
  * <p><strong>Parameters:</strong><br/>
  * [*id] {integer} <br/>
  * [*subject] {string} <br/>
  * [*fromfield] {string} <br/>
  * [*replyto] {string} <br/>
  * [*message] {string} <br/>
  * [*textmessage] {string} <br/>
  * [*footer] {string} <br/>
  * [*status] {string} <br/>
  * [*sendformat] {string} <br/>
  * [*template] {string} <br/>
  * [*embargo] {string} <br/>
  * [*rsstemplate] {string} <br/>
  * [owner] {string} <br/>
  * [htmlformatted] {string} <br/>
  * <p><strong>Returns:</strong><br/>
  * The message added.
  * </p>
  */
 public static function messageUpdate($id = 0)
 {
     if ($id == 0) {
         $id = $_REQUEST['id'];
     }
     $sql = 'UPDATE ' . $GLOBALS['table_prefix'] . 'message SET subject=:subject, fromfield=:fromfield, replyto=:replyto, message=:message, textmessage=:textmessage, footer=:footer, status=:status, sendformat=:sendformat, template=:template, sendstart=:sendstart, rsstemplate=:rsstemplate, owner=:owner, htmlformatted=:htmlformatted WHERE id=:id;';
     try {
         $db = PDO::getConnection();
         $stmt = $db->prepare($sql);
         $stmt->bindParam('id', $id);
         $stmt->bindParam('subject', $_REQUEST['subject']);
         $stmt->bindParam('fromfield', $_REQUEST['fromfield']);
         $stmt->bindParam('replyto', $_REQUEST['replyto']);
         $stmt->bindParam('message', $_REQUEST['message']);
         $stmt->bindParam('textmessage', $_REQUEST['textmessage']);
         $stmt->bindParam('footer', $_REQUEST['footer']);
         $stmt->bindParam('status', $_REQUEST['status']);
         $stmt->bindParam('sendformat', $_REQUEST['sendformat']);
         $stmt->bindParam('template', $_REQUEST['template']);
         $stmt->bindParam('embargo', $_REQUEST['embargo']);
         $stmt->bindParam('rsstemplate', $_REQUEST['rsstemplate']);
         $stmt->bindParam('owner', $_REQUEST['owner']);
         $stmt->bindParam('htmlformatted', $_REQUEST['htmlformatted']);
         $stmt->execute();
         $db = null;
         self::messageGet($id);
     } catch (PDOException $e) {
         Response::outputError($e);
     }
 }