2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 * DAO for "mail_queue" table
20 if (!defined('TR_INCLUDE_PATH')) exit;
22 require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
24 class MailQueueDAO extends DAO {
30 * @return mail_queue_id: if success
34 function Create($to_email, $to_name, $from_email, $from_name, $subject, $body, $charset)
36 $sql = "INSERT INTO ".TABLE_PREFIX."mail_queue
37 VALUES (NULL, '$to_email', '$to_name', '$from_email', '$from_name', '$charset', '$subject', '$body')";
39 if ($this->execute($sql))
41 return mysql_insert_id($this->db);
58 $sql = "SELECT * FROM ".TABLE_PREFIX."mail_queue";
60 return $this->execute($sql);
64 * Delete a record by mail ids
66 * @param $mids : mail IDs, for example: "1, 2, 3"
67 * @return true: if successful
68 * false: if unsuccessful
71 function DeleteByIDs($mids)
73 $sql = "DELETE FROM ".TABLE_PREFIX."mail_queue WHERE mail_id IN (".$mids.")";
75 return $this->execute($sql);