]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-payments.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / what-payments.php
index b62197a5f635dd5ca81431148b476d3755de9e4b..4dc746ee8a953ceaf6ce7d43f8ef7bdf7daece9d 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -48,7 +48,7 @@ if (((!isPostRequestElementSet('t_wait')) || (!isPostRequestElementSet('payment'
 } // END - if
 
 // Init SQL array
 } // END - if
 
 // Init SQL array
-nitSqls();
+initSqls();
 
 if (isFormSent()) {
        switch (getRequestElement('do')) {
 
 if (isFormSent()) {
        switch (getRequestElement('do')) {
@@ -121,7 +121,7 @@ LIMIT 1");
        // Delete entries here
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
        // Delete entries here
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
-               $result = SQL_QUERY_ESC("SELECT
+               $result = sqlQueryEscaped("SELECT
        `id`,
        `time`,
        `payment`,
        `id`,
        `time`,
        `payment`,
@@ -133,10 +133,10 @@ WHERE
        `id`=%s
 LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
        `id`=%s
 LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Free result
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_delete_payments_row', TRUE, $content);
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_delete_payments_row', TRUE, $content);
@@ -148,7 +148,7 @@ LIMIT 1",
        // Edit entries
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
        // Edit entries
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
-               $result = SQL_QUERY_ESC("SELECT
+               $result = sqlQueryEscaped("SELECT
        `id`,
        `time`,
        `payment`,
        `id`,
        `time`,
        `payment`,
@@ -160,10 +160,10 @@ WHERE
        `id`=%s
 LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
        `id`=%s
 LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Free result
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_edit_payments_row', TRUE, $content);
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_edit_payments_row', TRUE, $content);
@@ -173,7 +173,7 @@ LIMIT 1",
        loadTemplate('admin_edit_payments', FALSE, $OUT);
 } else {
        // Referral levels
        loadTemplate('admin_edit_payments', FALSE, $OUT);
 } else {
        // Referral levels
-       $result = SQL_QUERY("SELECT
+       $result = sqlQuery("SELECT
        `id`,
        `time`,
        `payment`,
        `id`,
        `time`,
        `payment`,
@@ -183,18 +183,19 @@ FROM
        `{?_MYSQL_PREFIX?}_payments`
 ORDER BY
        `time` ASC", __FILE__, __LINE__);
        `{?_MYSQL_PREFIX?}_payments`
 ORDER BY
        `time` ASC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result)) {
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // Make referral levels editable and deletable
                $OUT = '';
 
                // List already existing categories for editing
                // Make referral levels editable and deletable
                $OUT = '';
 
                // List already existing categories for editing
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_list_payments_row', TRUE, $content);
                } // END - switch
 
                // Free memory
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_list_payments_row', TRUE, $content);
                } // END - switch
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load main template
                loadTemplate('admin_list_payments', FALSE, $OUT);
 
                // Load main template
                loadTemplate('admin_list_payments', FALSE, $OUT);