A lot double-quotes rewritten to single-quotes, some redirect URLs fixed
[mailer.git] / inc / modules / admin / what-config_points.php
index 69b400320f750f1e8f46b6bc9c5f39193b4bba08..a13f1cdd2036cf63b9cfeb4922ce462657830152 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Einstellen der Willkommensgutschrift usw.        *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
 
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+ADD_DESCR('admin', __FILE__);
 
 // Init variables
-$message = "";
+$message = '';
 
 // Is the 'sub' parameter set?
-if (REQUEST_ISSET_GET(('sub'))) {
+if (REQUEST_ISSET_GET('sub')) {
        // Yes, then do some sanity-checks
        switch (REQUEST_GET('sub'))
        {
@@ -55,8 +60,8 @@ if (REQUEST_ISSET_GET(('sub'))) {
                break;
 
        case "ref":
-               if (REQUEST_ISSET_GET(('do'))) {
-                       if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == "add")) {
+               if (REQUEST_ISSET_GET('do')) {
+                       if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == 'add')) {
                                REQUEST_UNSET_POST('ok');
                        }
                }
@@ -78,7 +83,7 @@ if (IS_FORM_SENT()) {
        case "ref":
                switch (REQUEST_GET('do'))
                {
-               case "add":
+               case 'add':
                        ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')");
                        break;
 
@@ -107,7 +112,7 @@ if (IS_FORM_SENT()) {
                }
 
                // Update cache file
-               if (GET_EXT_VERSION("cache") >= "0.1.2") {
+               if (GET_EXT_VERSION('cache') >= '0.1.2') {
                        if ($GLOBALS['cache_instance']->loadCacheFile("refdepths")) $GLOBALS['cache_instance']->destroyCacheFile();
                }
                break;
@@ -164,27 +169,27 @@ WHERE mails_confirmed < %s", $REF, $REF));
        // Shall we display a message?
        if (!empty($message)) {
                // When do so...
-               LOAD_TEMPLATE("admin_settings_saved", false, $message);
+               LOAD_TEMPLATE('admin_settings_saved', false, $message);
        }
 } elseif (REQUEST_GET('sub') == "settings") {
        // Setup some settings like direct pay and so on
        // Including new add-mode for one-time referal bonus
        switch (getConfig('allow_direct_pay')) {
-       case "Y":
-               define('__DIRECT_Y', " checked=\"checked\"");
-               define('__DIRECT_N', "");
+       case 'Y':
+               define('__DIRECT_Y', ' chkecked="checked"');
+               define('__DIRECT_N', '');
                break;
 
-       case "N":
-               define('__DIRECT_Y', "");
-               define('__DIRECT_N', " checked=\"checked\"");
+       case 'N':
+               define('__DIRECT_Y', '');
+               define('__DIRECT_N', ' chkecked="checked"');
                break;
        }
 
        // One-time referal bonus add-mode
        switch (getConfig('reg_points_mode')) {
-               case "ref"   : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', "");         break;
-               case "direct": define('__MODE_REF', "");         define('__MODE_DIRECT', " checked=\"checked\""); break;
+               case "ref"   : define('__MODE_REF', ' chkecked="checked"'); define('__MODE_DIRECT', '');         break;
+               case "direct": define('__MODE_REF', '');         define('__MODE_DIRECT', ' chkecked="checked"'); break;
        }
 
        // Referal payout value
@@ -196,7 +201,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 +226,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 +254,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