]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-unlock_sponsor.php
Naming convention, internal TODOs solved:
[mailer.git] / inc / modules / admin / what-unlock_sponsor.php
index e8676e512ac9274e2e097c1e0105d5afc06f7ad8..ba14bdff29967cd59c62d9688777359b2dabb2df 100644 (file)
@@ -48,7 +48,7 @@ addMenuDescription('admin', __FILE__);
 // Check if admin has submitted form
 if (isFormSent()) {
        // Does he have selected at least one sponsor?
-       if (countSelection(postRequestParameter('id')) > 0) {
+       if (ifPostContainsSelections('id')) {
                // At least one entry selected
                foreach (postRequestParameter('id') as $id => $selected) {
                        // Secure id number and init $content
@@ -87,14 +87,14 @@ WHERE
 ORDER BY
        sp.pay_name ASC",
                                        array($content['id']), __FILE__, __LINE__);
-                               if (SQL_NUMROWS($result) > 0) {
+                               if (!SQL_HASZERONUMS($result)) {
                                        // Payment does exist
                                        while ($content2 = SQL_FETCHARRAY($result)) {
                                                // Merge both arrays
                                                $content = merge_array($content, $content2);
 
                                                // Set default email
-                                               $content['email'] = getMessage('SPONSOR_NO_ADMIN');
+                                               $content['email'] = '{--SPONSOR_NO_ADMIN--}';
                                                if ($content['admin_id'] > 0) {
                                                        // Load admin's email address for contact
                                                        $content['email'] = getAdminEmail($content['admin_id']);
@@ -113,7 +113,7 @@ ORDER BY
                                        }
                                } else {
                                        // No payments found
-                                       $content['message'] = getMessage('SPONSOR_NO_PAYMENTS_FOUND');
+                                       $content['message'] = '{--SPONSOR_NO_PAYMENTS_FOUND--}';
                                }
 
                                // Free memory
@@ -165,7 +165,7 @@ LIMIT 1",
                                        if ($REFERAL['receive_warnings'] == 'Y') {
                                                // Send notification to referal
                                                $REF_MSG = loadEmailTemplate('sponsor_ref_notify', $REFERAL);
-                                               sendEmail($REFERAL['email'], getMessage('SPONSOR_REF_NOTIFY_SUBJ'), $REF_MSG);
+                                               sendEmail($REFERAL['email'], '{--SPONSOR_REF_NOTIFY_SUBJECT--}', $REF_MSG);
                                        } // END - if
 
                                        // Free memory
@@ -178,7 +178,7 @@ LIMIT 1",
 
                        // So let's send the email away
                        $message = loadEmailTemplate('sponsor_unlocked', $content);
-                       sendEmail($content['email'], getMessage('SPONSOR_UNLOCKED_SUBJ'), $message);
+                       sendEmail($content['email'], '{--SPONSOR_UNLOCKED_SUBJECT--}', $message);
                } // END - foreach
        } else {
                // Nothing selected
@@ -196,13 +196,12 @@ WHERE
 ORDER BY
        `id`", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Entries found so let's list them!
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Transfer data to array
                $content = array(
-                       'sw'              => $SW,
                        'id'              => $content['id'],
                        'gender'          => $content['gender'],
                        'surname'         => $content['surname'],
@@ -214,7 +213,6 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_unlock_sponsor_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Load template