]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_rallye_prices.php
Even more rewritten
[mailer.git] / inc / modules / admin / what-config_rallye_prices.php
index 761b0beeebd702e78184798ed618c50304d6a0e4..3723a4a1684a41ffb4a1d8fe5f8d42a54242b8c7 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Rallye-Preise einrichten                         *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $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__);
 
 if (REQUEST_ISSET_GET(('rallye'))) {
        // Price submitted?
@@ -58,16 +63,16 @@ VALUES ('%s','%s','%s','%s')",
        REQUEST_POST('points'),
        REQUEST_POST('info')
 ), __FILE__, __LINE__);
-                               LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_PRICE_LEVEL_SAVED'));
+                               LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PRICE_LEVEL_SAVED'));
                        } else {
                                // Free memory
                                SQL_FREERESULT($result);
 
                                // Price level found!
-                               LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_PRICE_ALREADY_FOUND'));
+                               LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PRICE_ALREADY_FOUND'));
                        }
                }
-       } elseif (REQUEST_ISSET_POST(('remove'))) {
+       } elseif (REQUEST_ISSET_POST('remove')) {
                // Check if at last one line is selected
                $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
                if ($SEL > 0) {
@@ -78,11 +83,11 @@ VALUES ('%s','%s','%s','%s')",
                        }
 
                        // Output message
-                       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_ENTRIES_DELETED'));
+                       LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_DELETED'));
                } else {
-                       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_ENTRIES_NOT_DELETED'));
+                       LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_NOT_DELETED'));
                }
-       } elseif (REQUEST_ISSET_POST(('change'))) {
+       } elseif (REQUEST_ISSET_POST('change')) {
                // Change entries
                foreach (REQUEST_POST('level') as $id => $level) {
                        // Secure ID
@@ -100,7 +105,7 @@ VALUES ('%s','%s','%s','%s')",
                }
 
                // Output message
-               LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_ENTRIES_CHANGED'));
+               LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_CHANGED'));
        }
 
        if (REQUEST_ISSET_POST('edit')) {
@@ -108,7 +113,7 @@ VALUES ('%s','%s','%s','%s')",
                $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
                if ($SEL > 0) {
                        // Make selected editable
-                       $OUT = ""; $SW = 2;
+                       $OUT = ''; $SW = 2;
                        foreach (REQUEST_POST('sel') as $id => $sel) {
                                // Load data to selected rallye
                                $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1",
@@ -140,14 +145,14 @@ VALUES ('%s','%s','%s','%s')",
                } else {
                        // Nothing selected
                        $content = sprintf(getMessage('RALLYE_NO_PRICES_SELECTED'), "<a href=\"{!URL!}/modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=".REQUEST_GET('rallye')."\">", "</a>");
-                       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+                       LOAD_TEMPLATE('admin_settings_saved', false, $content);
                }
        } elseif (REQUEST_ISSET_POST('del')) {
                // Check if at last one line is selected
                $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
                if ($SEL > 0) {
                        // List all prices
-                       $OUT = ""; $SW = 2;
+                       $OUT = ''; $SW = 2;
                        foreach (REQUEST_POST('sel') as $id => $sel) {
                                // Load data to selected rallye
                                $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1",
@@ -180,7 +185,7 @@ VALUES ('%s','%s','%s','%s')",
                } else {
                        // Nothing selected
                        $content = RALLYE_NO_PRICES_SELECTED_1."<a href=\"{!URL!}/modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=".REQUEST_GET('rallye')."\">".RALLYE_NO_PRICES_SELECTED_2."</a>".RALLYE_NO_PRICES_SELECTED_3;
-                       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+                       LOAD_TEMPLATE('admin_settings_saved', false, $content);
                }
        } else {
                // a rallye was selected, so check if there are already prices assigned...
@@ -189,7 +194,7 @@ VALUES ('%s','%s','%s','%s')",
 
                if (SQL_NUMROWS($result) > 0) {
                        // Load all prices for the selected rallye
-                       $OUT = ""; $SW = 2;
+                       $OUT = ''; $SW = 2;
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Fix empty info
                                if (empty($content['info'])) $content['info'] = "---";
@@ -234,10 +239,10 @@ FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a
 WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List found rallyes
-               $OUT = ""; $SW = 2;
+               $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        $select = "<input type=\"checkbox\" name=\"sel[".$content['id']."]\" class=\"admin_normal\" value=\"1\">";
-                       if ($content['is_active'] == "Y") $select = "<div class=\"big\">".$content['id']."</div>";
+                       if ($content['is_active'] == 'Y') $select = "<div class=\"big\">".$content['id']."</div>";
 
                        // Prepare data for the row template
                        // @TODO Rewritings: aid->admin_id, alogin->login in template
@@ -266,7 +271,7 @@ WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
                LOAD_TEMPLATE("admin_list_rallye_prices");
        } else {
                // No rallyes setup so far
-               LOAD_TEMPLATE("admin_settings_saved", false, getMessage('RALLYE_NO_RALLYES_SETUP'));
+               LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_NO_RALLYES_SETUP'));
        }
 }
 //