Bad things are now 'classified' as bad (CSS class 'bad' is being used instead of...
[mailer.git] / inc / modules / admin / what-config_payouts.php
index 6b5994dbba51de72b03868a92ea6a9beeda26dda..022278ebe6648fc471ee39b60ba589365f4134c8 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -43,11 +43,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-// Convert 'rate' if set
-if (isPostRequestElementSet('rate')) {
-       convertCommaToDotInPostData('rate');
-} // END - if
-
+// Do we add an entry?
 if ((isFormSent('add')) && (isPostRequestElementSet('title')) && (postRequestElement('rate') > 0)) {
        // Add new payout type
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
@@ -81,7 +77,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('title')) && (postRequestEle
                SQL_FREERESULT($result);
 
                // Does already exist
-               $message = '<div class="notice">{--ADMIN_PAYOUT_TYPE_ALREADY--}</div>';
+               $message = '<div class="bad">{--ADMIN_PAYOUT_TYPE_ALREADY--}</div>';
        }
 }
 
@@ -120,7 +116,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections())) {
                $id = bigintval($id);
 
                // Edit only if something is entered
-               if ((isPostRequestElementSet('title', $id)) && (postRequestElement('rate', $id) > 0)) {
+               if ((isPostRequestElementSet('type', $id)) && (postRequestElement('rate', $id) > 0)) {
                        // Update entry
                        addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_payout_types` SET
        `type`='%s',
@@ -135,7 +131,7 @@ LIMIT 1",
                                convertCommaToDot(postRequestElement('rate', $id)),
                                convertCommaToDot(postRequestElement('min_points' , $id)),
                                postRequestElement('allow_url', $id),
-                               bigintval($id)
+                               $id
                        ),__FILE__, __LINE__, false));
                }
        }
@@ -223,7 +219,7 @@ SQL_FREERESULT($result_mem);
 
 // Add new payout type
 if ($display === true) {
-       loadTemplate('admin_payout_add_new');
+       loadTemplate('admin_add_payout');
 } // END - if
 
 // [EOF]