]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_points.php
A lot while() conditions rewritten to SQL_FETCHARRAY(), see bug #107, @TODO tags...
[mailer.git] / inc / modules / admin / what-config_points.php
index 69b400320f750f1e8f46b6bc9c5f39193b4bba08..5302566f1c7fecd4f2e832c5e1877affbe6a433b 100644 (file)
@@ -196,7 +196,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
        // 12                  3     32    2                  3     32    2               3            4     43    21
        if ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
                // Delete entries
-               $SW = 2; $OUT = "";
+               $OUT = ""; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
@@ -221,7 +221,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                LOAD_TEMPLATE("admin_points_del");
        } elseif ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
                // Edit entries
-               $SW = 2; $OUT = "";
+               $OUT = ""; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
                         array(bigintval($id)), __FILE__, __LINE__);
@@ -249,16 +249,17 @@ WHERE mails_confirmed < %s", $REF, $REF));
                $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
                if (SQL_NUMROWS($result) > 0) {
                        // Make referal levels editable and deletable
-                       $SW = 2; $OUT = "";
+                       $OUT = ""; $SW = 2;
 
                        // List already existing categories for editing
-                       while (list($id, $lvl, $perc) = SQL_FETCHROW($result)) {
+                       while ($content = SQL_FETCHARRAY($result)) {
                                // Prepare data for the row template
+                               // @TODO Rewritings: lvl->level, per->percents in template
                                $content = array(
                                        'sw'  => $SW,
-                                       'id'  => $id,
-                                       'lvl' => $lvl,
-                                       'per' => TRANSLATE_COMMA($perc),
+                                       'id'  => $content['id'],
+                                       'lvl' => $content['level'],
+                                       'per' => TRANSLATE_COMMA($content['percents']),
                                );
 
                                // Load row template and switch color