]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-del_email.php
Rewrote script to use more EL, introduced wrappers for sending pool:
[mailer.git] / inc / modules / admin / what-del_email.php
index 60705d4ea662fe530f06f2ae96ac71c599faecc2..f367fb9a017e9b13b08f374de965d080375cfad6 100644 (file)
@@ -48,15 +48,11 @@ $count = '0';
 
 if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
        // Load email data
-       $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `cat_id`, `payment_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
-               array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+       // @TODO Unused: cat_id
+       $content getPoolDataFromId(getRequestElement('id'));
 
        // Delete mail only once
-       if (SQL_NUMROWS($result) == 1) {
-               // Load data
-               // @TODO Unused: cat_id
-               $content = SQL_FETCHARRAY($result);
-
+       if (count($content) > 0) {
                // Prepare data for the template
                $content['timestamp'] = generateDateTime($content['timestamp'], 0);
 
@@ -189,9 +185,6 @@ LIMIT 1",
                // Mail already deleted!
                displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
        }
-
-       // Free result
-       SQL_FREERESULT($result);
 } elseif ((isGetRequestElementSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
        // Load data from bonus mail
        $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",