]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_payouts.php
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 2b016d0b3e9aaf2621c1accf892c8bd031ca04bb..022278ebe6648fc471ee39b60ba589365f4134c8 100644 (file)
@@ -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]