X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor_pay.php;h=7da0139c83cf770d3c34677c75241b71f071ad58;hb=1410e014d23f244e73d3a7916a61c2473416bab9;hp=3709b0f646a7ed18cc7bef52c5b7e77236ba2d5e;hpb=32fed28f469610c8bfdec7f18089cceea9e15df0;p=mailer.git diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index 3709b0f646..7da0139c83 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,7 +41,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); $message = ''; @@ -57,12 +55,12 @@ if (isFormSent('add')) { if ((postRequestParameter('pay_min_count') == '0') || (!isPostRequestParameterSet('pay_min_count'))) unsetPostRequestParameter('add'); if (!isPostRequestParameterSet('pay_currency')) unsetPostRequestParameter('add'); -} elseif ((isFormSent('edit')) || (isFormSent('del')) || (isFormSent('change')) || (isFormSent('remove'))) { +} elseif ((isFormSent('edit')) || (isFormSent('delete')) || (isFormSent('change')) || (isFormSent('remove'))) { // Check if at least one entry was selected if (!isPostRequestParameterSet('id')) { // Nothing selected for editing / deleting??? unsetPostRequestParameter('edit'); - unsetPostRequestParameter('del'); + unsetPostRequestParameter('delete'); unsetPostRequestParameter('change'); unsetPostRequestParameter('remove'); } elseif (isFormSent('change')) { @@ -80,7 +78,7 @@ SET `pay_min_count`='%s', `pay_currency`='%s' WHERE - `id`='%s' + `id`=%s LIMIT 1", array( postRequestParameter('name', $id), @@ -97,7 +95,7 @@ LIMIT 1", // Remove entries here... foreach (postRequestParameter('id') as $id => $sel) { // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } @@ -107,7 +105,7 @@ LIMIT 1", if (!empty($message)) { // Output message - loadTemplate('admin_settings_saved', false, $message); + displayMessage($message); } // END - if } @@ -136,27 +134,17 @@ if (isFormSent('add')) { SQL_FREERESULT($result); // Output message - loadTemplate('admin_settings_saved', false, $message); -} elseif ((isFormSent('edit')) || (isFormSent('del'))) { + displayMessage($message); +} elseif ((isFormSent('edit')) || (isFormSent('delete'))) { // Load all data $OUT = ''; foreach (postRequestParameter('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 `id`, `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 - list($name, $rate, $min, $curr) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - - // Transfer data to array - $content = array( - 'id' => bigintval($id), - 'name' => htmlspecialchars($name), - 'rate' => translateComma($rate), - 'min' => bigintval($min), - 'curr' => htmlspecialchars($curr) - ); + $content = SQL_FETCHARRAY($result); if (isFormSent('edit')) { // Edit entry @@ -169,6 +157,9 @@ if (isFormSent('add')) { // Entry invalid $OUT .= loadTemplate('admin_list_sponsor_pay_404', true, $id); } + + // Free result + SQL_FREERESULT($result); } // END - foreach // Load main template depending on mode (edit/delete) @@ -190,21 +181,12 @@ ORDER BY __FILE__, __LINE__); // Do we have some paytypes setup? - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // Prepare variables for listing $OUT = ''; // List alle found payment types while ($content = SQL_FETCHARRAY($result)) { - // Remember data in array - $content = array( - 'id' => $content['id'], - 'name' => $content['pay_name'], - 'rate' => translateComma($content['pay_rate']), - 'min' => $content['pay_min_count'], - 'currency' => $content['pay_currency'] - ); - // Add row $OUT .= loadTemplate('admin_list_sponsor_pay_row', true, $content); } // END - while @@ -213,7 +195,7 @@ ORDER BY $content['list_out'] = loadTemplate('admin_list_sponsor_pay', true, $OUT); } else { // Noting setup so far! - $content['list_out'] = loadTemplate('admin_settings_saved', true, '{--ADMIN_SPONSOR_NO_PAYTYPES--}'); + $content['list_out'] = displayMessage('{--ADMIN_SPONSOR_NO_PAYTYPES--}', true); } // Free memory