X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/7ef22e2126b630156852e59acdb9d54283ab3462..6ba8e4d31ed75b27167ef4841ba5cc0ba8936716:/lib/db_mysqli.inc.php diff --git a/lib/db_mysqli.inc.php b/lib/db_mysqli.inc.php index 822cae8..9203f6d 100644 --- a/lib/db_mysqli.inc.php +++ b/lib/db_mysqli.inc.php @@ -1,5 +1,5 @@ root .'lib/db_implementation.php'; class DBMysqli extends DBImpl { @@ -146,6 +146,26 @@ class DBMysqli extends DBImpl { return $row; } + public function getRecipient($id) { + $recipient = false; + + $query = "SELECT recipient.email as recipient FROM quarantine q LEFT JOIN msgrcpt "; + $query .= "ON msgrcpt.mail_id = q.mail_id LEFT JOIN msgs ON "; + $query .= "msgs.mail_id = q.mail_id LEFT JOIN maddr AS recipient "; + $query .= "ON msgrcpt.rid = recipient.id LEFT JOIN maddr AS sender ON "; + $query .= "msgs.sid = sender.id WHERE q.mail_id = '$id'"; + + if ($result = $this->con->query($query, MYSQLI_USE_RESULT)) { + $obj = $result->fetch_object(); + if ($obj) { + $recipient = $obj->recipient; + } + $result->free(); + } + + return $recipient; + } + } ?>