X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor_pay.php;h=758b749703ba9f97bfd673b271b9f0a8f52c9849;hb=6c763653e88b9d10627e651ca59c7201d4b7d62b;hp=8564656c69885ca9491124f49f1e9594e79d2e94;hpb=d18075f375db1b9db40773cdf80a5d6f2c36cd3a;p=mailer.git diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index 8564656c69..758b749703 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -15,9 +15,10 @@ * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * - * This program is free software. You can redistribute it and/or modify * + * 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 * - * the Free Software Foundation; either version 2 of the License. * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -31,13 +32,14 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } // Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); +ADD_DESCR("admin", __FILE__); + $MSG = ""; if (isset($_POST['add'])) { @@ -57,7 +59,7 @@ if (isset($_POST['add'])) { unset($_POST['remove']); } elseif (isset($_POST['change'])) { // Change entries here... - foreach ($_POST['id'] as $id=>$sel) { + foreach ($_POST['id'] as $id => $sel) { // Secure ID $id = bigintval($id); @@ -72,7 +74,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id $MSG = SPONSOR_PAY_ENTRIES_CHANGED; } elseif (isset($_POST['remove'])) { // Remove entries here... - foreach ($_POST['id'] as $id=>$sel) { + foreach ($_POST['id'] as $id => $sel) { // Remove entry $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); @@ -85,7 +87,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id if (!empty($MSG)) { // Output message LOAD_TEMPLATE("admin_settings_saved", false, $MSG); - OUTPUT_HTML("
"); + OUTPUT_HTML("
"); } } @@ -96,8 +98,8 @@ if (isset($_POST['add'])) { if (SQL_NUMROWS($result) == 0) { // No entry found so add this line $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_rate, pay_min_count, pay_currency) - VALUES ('%s', '%s', '%s', '%s')", - array(htmlspecialchars($_POST['pay_name']), str_replace(",", ".", $_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])), + VALUES ('%s','%s','%s','%s')", + array(htmlspecialchars($_POST['pay_name']), REVERT_COMMA($_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])), __FILE__, __LINE__); // Payment type added! @@ -112,11 +114,11 @@ if (isset($_POST['add'])) { // Output message LOAD_TEMPLATE("admin_settings_saved", false, $MSG); - OUTPUT_HTML("
"); + OUTPUT_HTML("
"); } elseif ((isset($_POST['edit'])) || (isset($_POST['del']))) { // Load all data $OUT = ""; $SW = 2; - foreach ($_POST['id'] as $id=>$sel) { + foreach ($_POST['id'] as $id => $sel) { // Load entry $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);