X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor_pay.php;h=32dfa7dd037e5d92480305bff07c20ecbeb0e56d;hb=4e828541f3977c085ef54d3490b3e0069eb09a06;hp=e6c83b70457156f5c42e0dd10ef394c714fd0d16;hpb=21b7ff95974945f80a5569c49071406527e22066;p=mailer.git
diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php
index e6c83b7045..32dfa7dd03 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'])) {
@@ -62,7 +64,7 @@ if (isset($_POST['add'])) {
$id = bigintval($id);
// Save entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_paytypes
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_paytypes`
SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id='%s' LIMIT 1",
array($_POST['name'][$id], $_POST['rate'][$id], bigintval($_POST['min'][$id]), $_POST['curr'][$id], $id),
__FILE__, __LINE__);
@@ -74,8 +76,8 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id
// Remove entries here...
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__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
}
// Generate message
@@ -85,19 +87,18 @@ 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("
");
}
}
if (isset($_POST['add'])) {
// Check if entry with same name does exists
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE pay_name='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1",
array($_POST['pay_name']), __FILE__, __LINE__);
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'])),
+ 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']), REVERT_COMMA($_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
__FILE__, __LINE__);
// Payment type added!
@@ -112,13 +113,12 @@ if (isset($_POST['add'])) {
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("
");
} elseif ((isset($_POST['edit'])) || (isset($_POST['del']))) {
// Load all data
$OUT = ""; $SW = 2;
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",
+ $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__);
if (SQL_NUMROWS($result) == 1) {
// Load data
@@ -164,7 +164,7 @@ if (isset($_POST['add'])) {
}
} else {
// Load all payment types
- $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name",
+ $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name",
__FILE__, __LINE__);
// Do we have some paytypes setup?
@@ -173,7 +173,7 @@ if (isset($_POST['add'])) {
$SW = 2; $OUT = "";
// List alle found payment types
- while(list($id, $name, $rate, $min, $currency) = SQL_FETCHROW($result)) {
+ while (list($id, $name, $rate, $min, $currency) = SQL_FETCHROW($result)) {
// Remember data in array
$content = array(
'sw' => $SW,