]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-unlock_sponsor.php
Some sponsor API functions added, expression function for user moved:
[mailer.git] / inc / modules / admin / what-unlock_sponsor.php
index ba14bdff29967cd59c62d9688777359b2dabb2df..3bff5d845507dca7938ad6947a2e7e8355720a55 100644 (file)
@@ -81,9 +81,9 @@ FROM
 LEFT JOIN
        `{?_MYSQL_PREFIX?}_sponsor_paytypes` AS sp
 ON
-       sp.id=so.payid
+       sp.id=so.payment_id
 WHERE
-       so.sponsorid='%s'
+       so.sponsor_id=%s
 ORDER BY
        sp.pay_name ASC",
                                        array($content['id']), __FILE__, __LINE__);
@@ -164,8 +164,8 @@ LIMIT 1",
                                        // Send warnings out?
                                        if ($REFERAL['receive_warnings'] == 'Y') {
                                                // Send notification to referal
-                                               $REF_MSG = loadEmailTemplate('sponsor_ref_notify', $REFERAL);
-                                               sendEmail($REFERAL['email'], '{--SPONSOR_REF_NOTIFY_SUBJECT--}', $REF_MSG);
+                                               $REFERAL_MSG = loadEmailTemplate('sponsor_ref_notify', $REFERAL);
+                                               sendEmail($REFERAL['email'], '{--SPONSOR_REFERAL_NOTIFY_SUBJECT--}', $REFERAL_MSG);
                                        } // END - if
 
                                        // Free memory
@@ -173,9 +173,6 @@ LIMIT 1",
                                } // END - if
                        } // END - if
 
-                       // Transfer data to array
-                       $content['points']   = translateComma($content['points_amount']);
-
                        // So let's send the email away
                        $message = loadEmailTemplate('sponsor_unlocked', $content);
                        sendEmail($content['email'], '{--SPONSOR_UNLOCKED_SUBJECT--}', $message);
@@ -192,7 +189,7 @@ $result = SQL_QUERY("SELECT
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 WHERE
-       `status`='PENDING'
+       `status`='PENDING' OR `status`='UNCONFIRMED'
 ORDER BY
        `id`", __FILE__, __LINE__);
 
@@ -200,16 +197,8 @@ if (!SQL_HASZERONUMS($result)) {
        // Entries found so let's list them!
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
-               // Transfer data to array
-               $content = array(
-                       'id'              => $content['id'],
-                       'gender'          => $content['gender'],
-                       'surname'         => $content['surname'],
-                       'family'          => $content['family'],
-                       'email'           => generateEmailLink($content['email'], 'sponsor_data'),
-                       'remote_addr'     => $content['remote_addr'],
-                       'sponsor_created' => generateDateTime($content['sponsor_created'], 2),
-               );
+               // Translate some data
+               $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_unlock_sponsor_row', true, $content);