]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-unlock_emails.php
Huge rewrite:
[mailer.git] / inc / modules / admin / what-unlock_emails.php
index 18d6561cf1246ce25d39a608dce01611e7a42faf..676cc7c3c022c4472bbfdc2d2055cbd3fa4470e6 100644 (file)
@@ -65,7 +65,7 @@ if ((SQL_NUMROWS($result_main) > 0) || (REQUEST_ISSET_POST('lock'))) {
                } // END - if
        } // END - if
 
-       if (REQUEST_ISSET_POST(('accept'))) {
+       if (REQUEST_ISSET_POST('accept')) {
                if ($SEL > 0) {
                        // Accept mail orders
                        foreach (REQUEST_POST('sel') as $id => $value) {
@@ -73,11 +73,16 @@ if ((SQL_NUMROWS($result_main) > 0) || (REQUEST_ISSET_POST('lock'))) {
                                $id = bigintval($id);
 
                                // Order placed in queue...
-                               $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment, po.payment_id
-FROM `{!_MYSQL_PREFIX!}_pool` AS po
-INNER JOIN `{!_MYSQL_PREFIX!}_payments` AS pay
-ON po.payment_id=pay.id
-WHERE po.id=%s
+                               $result = SQL_QUERY_ESC("SELECT
+       po.url, po.subject, po.sender, pay.payment, po.payment_id
+FROM
+       `{!_MYSQL_PREFIX!}_pool` AS po
+INNER JOIN
+       `{!_MYSQL_PREFIX!}_payments` AS pay
+ON
+       po.payment_id=pay.id
+WHERE
+       po.id=%s
 LIMIT 1",
                                        array($id), __FILE__, __LINE__);
 
@@ -98,7 +103,7 @@ LIMIT 1",
                                        // Check for bonus extension version >= 0.4.4 for the order bonus
                                        if ((GET_EXT_VERSION('bonus') >= '0.4.4') && (getConfig('bonus_active') == 'Y')) {
                                                // Add points directly
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_order=bonus_order+".getConfig('bonus_order')." WHERE userid=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `bonus_order`=`bonus_order`+".getConfig('bonus_order')." WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($DATA['sender'])), __FILE__, __LINE__);
 
                                                // Subtract bonus points from system
@@ -106,13 +111,13 @@ LIMIT 1",
                                        } // END - if
 
                                        // Load email template
-                                       $msg_user = LOAD_EMAIL_TEMPLATE('order-accept', array(), $DATA['sender']);
+                                       $message_user = LOAD_EMAIL_TEMPLATE('order-accept', array(), $DATA['sender']);
 
                                        // Send email
-                                       sendEmail($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user);
+                                       sendEmail($DATA['sender'], MEMBER_ORDER_ACCEPTED, $message_user);
 
                                        // Unlock selected email
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW' WHERE `id`=%s AND data_type='ADMIN' LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET `data_type`='NEW' WHERE `id`=%s AND `data_type`='ADMIN' LIMIT 1",
                                                array($id), __FILE__, __LINE__);
                                } // END - if
                        } // END - foreach
@@ -135,7 +140,7 @@ LIMIT 1",
                                $id = bigintval($id);
 
                                // Load URL and subject from pool
-                               $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT `url`, `subject`, `sender` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                                        array($id), __FILE__, __LINE__);
 
                                // Load data
@@ -145,14 +150,14 @@ LIMIT 1",
                                SQL_FREERESULT($result);
 
                                // Load email template and send it away
-                               $msg_user = LOAD_EMAIL_TEMPLATE("order-reject", array(), $DATA['sender']);
-                               sendEmail($DATA['sender'], getMessage('MEMBER_ORDER_REJECTED'), $msg_user);
+                               $message_user = LOAD_EMAIL_TEMPLATE('order-reject', array(), $DATA['sender']);
+                               sendEmail($DATA['sender'], getMessage('MEMBER_ORDER_REJECTED'), $message_user);
 
                                // If you do not enter an URL to redirect to, your URL will be set!
                                if ((!REQUEST_ISSET_POST(('redirect'))) || (REQUEST_POST('redirect') == 'http://')) REQUEST_SET_POST('redirect', constant('URL'));
 
                                // Redirect URL
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET url='%s', data_type='NEW' WHERE `id`=%s LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET url='%s', `data_type`='NEW' WHERE `id`=%s LIMIT 1",
                                        array(REQUEST_POST('redirect'), $id),__FILE__, __LINE__);
 
                                // Prepare data for the row template
@@ -195,7 +200,7 @@ LIMIT 1",
 
                // Output message
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_URLS_BLOCKED'));
-       } elseif ((!REQUEST_ISSET_POST('lock')) && (!REQUEST_ISSET_POST(('accept'))) && (!REQUEST_ISSET_POST(('reject'))) && (getConfig('url_blacklist') == 'Y')) {
+       } elseif ((!REQUEST_ISSET_POST('lock')) && (!REQUEST_ISSET_POST('accept')) && (!REQUEST_ISSET_POST(('reject'))) && (getConfig('url_blacklist') == 'Y')) {
                // Mail orders are in pool so we can display them
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result_main)) {