]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_payouts.php
All resets rewritten, missing svn:properties added
[mailer.git] / inc / modules / admin / what-config_payouts.php
index 71c3fb52b8bf54083c56cc0fd97b385d310a7a62..b3ce3c631e1e76fcaeaf1ec335add52c13ac827e 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -46,11 +47,11 @@ addMenuDescription('admin', __FILE__);
 
 if (isPostRequestParameterSet('rate')) setPostRequestParameter('rate', convertCommaToDot(postRequestParameter('rate')));
 
-if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
+if ((isFormSent('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
        // Add new payout type
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
        array(postRequestParameter('title')), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Add now
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_payout_types`
 (type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url)
@@ -83,7 +84,7 @@ VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')",
 $result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
 
 $display = true;
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs
@@ -98,16 +99,19 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
                        if ((isPostRequestParameterSet('title', $id)) && (postRequestParameter('rate', $id) > 0)) {
                                // Update entry
                                addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_payout_types` SET
-type='%s',
-rate=%s,
-min_points=%s,
-allow_url='%s'
-WHERE `id`='".$id."' LIMIT 1",
+       type='%s',
+       rate=%s,
+       min_points=%s,
+       allow_url='%s'
+WHERE
+       `id`=%s
+LIMIT 1",
                                array(
                                        postRequestParameter('title', $id),
                                        convertCommaToDot(postRequestParameter('rate', $id)),
                                        convertCommaToDot(postRequestParameter('min_points' , $id)),
                                        postRequestParameter('allow', $id),
+                                       bigintval($id)
                                ),__FILE__, __LINE__, false));
                        }
                }
@@ -134,7 +138,7 @@ WHERE `id`='".$id."' LIMIT 1",
                                'title' => $title,
                                'rate'  => translateComma($rate),
                                'min_points'  => translateComma($min_points),
-                               'allow' => addSelectionBox('yn', $allow, "allow[".$id."]"),
+                               'allow' => addSelectionBox('yn', $allow, 'allow[' . $id . ']'),
                        );
 
                        // Load row template and switch color
@@ -145,7 +149,7 @@ WHERE `id`='".$id."' LIMIT 1",
                // Load main template
                loadTemplate('admin_config_payouts_edit', false, $OUT);
        }
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs