X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_bank_package.php;h=ed1427960b498126b2dfdb4485d4516709547add;hp=a5519e2537bdc52fc6d18770cf29a0dcf7eb8c39;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=d92a340159ca45047eafc111fcac64933a7babeb diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php index a5519e2537..ed1427960b 100644 --- a/inc/modules/admin/what-list_bank_package.php +++ b/inc/modules/admin/what-list_bank_package.php @@ -14,11 +14,10 @@ * $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 * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * 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 * @@ -42,72 +41,160 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // Check if there is enougth selected -$show = true; -if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) && (count(postRequestParameter('id')) > 0)) { +$show = TRUE; +if (ifPostContainsSelections('id')) { // Okay, which button was pressed? - if (isPostRequestParameterSet('change')) { + if (isFormSent('change')) { // Change permissions - adminChangeActivationStatus(postRequestParameter('id'), 'bank_packages', 'package_active'); - } elseif (isPostRequestParameterSet('edit')) { + adminChangeActivationStatus(postRequestElement('id'), 'bank_packages', 'package_active'); + } elseif (isFormSent('edit')) { // Delete entries (with confirmation) adminEditEntriesConfirm( - postRequestParameter('id'), - 'bank_packages', - array('id', 'title', 'description', 'account_fee', 'free_transfers', 'transfer_fee', 'output_system_mode', 'package_active', 'free_months_no_fee', 'interest_plus', 'interest_minus', 'first_payment', 'free_account_income', 'free_account_stuff', 'tan_lock'), - array('bigintval', '', '', 'translateComma', 'bigintval', 'translateComma', '', '', 'bigintval', 'translateComma', 'translateComma', 'translateComma', 'translateComma', '', 'bigintval'), - array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '') + array('id'), + array('bank_packages'), + postRequestElement('id'), + array( + 'id', + 'title', + 'description', + 'account_fee', + 'free_transfers', + 'transfer_fee', + 'output_system_mode', + 'package_active', + 'free_months_no_fee', + 'interest_plus', + 'interest_minus', + 'first_payment', + 'free_account_income', + 'free_account_stuff', + 'tan_lock' + ), + array( + 'bigintval', + '', + '', + 'translateComma', + 'bigintval', + 'translateComma', + '', + '', + 'bigintval', + 'translateComma', + 'translateComma', + 'translateComma', + 'translateComma', + '', + 'bigintval' + ), + array( + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '' + ) ); - $show = false; - } elseif (isPostRequestParameterSet('do_edit')) { + $show = FALSE; + } elseif (isFormSent('do_edit')) { // Delete entries (with confirmation) - adminEditEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true); - } elseif (isPostRequestParameterSet('delete')) { + adminEditEntriesConfirm( + array('id'), + array('bank_packages'), + postRequestElement('id'), + array(), + array(), + array(), + array(TRUE) + ); + } elseif (isFormSent('delete')) { // Delete entries (with confirmation) - adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', '')); - $show = false; - } elseif (isPostRequestParameterSet('remove')) { + adminDeleteEntriesConfirm( + array('id'), + array('bank_packages'), + postRequestElement('id'), + array( + 'id', + 'title', + 'description', + 'account_fee' + ), + array( + 'bigintval', + '', + '', + 'translateComma' + ), + array( + '', + '', + '', + '' + ) + ); + $show = FALSE; + } elseif (isFormSent('do_delete')) { // Delete entries (with confirmation) - adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true); + adminDeleteEntriesConfirm( + array('id'), + array('bank_packages'), + postRequestElement('id'), + array(), + array(), + array(), + array(TRUE) + ); } } // END - if // Skip showing old entries? -if ($show === false) return; +if ($show === FALSE) return; // Load all banking packages from DB -$result = SQL_QUERY("SELECT id, title, description, account_fee AS 'fee', package_active AS 'active', interest_plus AS 'plus', interest_minus AS 'minus' -FROM `{?_MYSQL_PREFIX?}_bank_packages` -ORDER BY `id` ASC", __FILE__, __LINE__); +$result = sqlQuery('SELECT + `id`, + `title`, + `description`, + `account_fee`, + `package_active`, + `interest_plus`, + `interest_minus` +FROM + `{?_MYSQL_PREFIX?}_bank_packages` +ORDER BY + `id` ASC', __FILE__, __LINE__); // Is there at lease one package? -if (SQL_NUMROWS($result) > 0) { +if (!ifSqlHasZeroNumRows($result)) { // List all packages - $OUT = ''; $SW = 2; - while ($content = SQL_FETCHARRAY($result)) { - // "Translate" some data - $content['active'] = translateYesNo($content['active']); - $content['fee'] = translateComma($content['fee']); - $content['plus'] = translateComma($content['plus']); - $content['minus'] = translateComma($content['minus']); - $content['sw'] = $SW; - + $OUT = ''; + while ($content = sqlFetchArray($result)) { // Load row template - $OUT .= loadTemplate('admin_list_bank_package_row', true, $content); - $SW = 3 - $SW; + $OUT .= loadTemplate('admin_list_bank_package_row', TRUE, $content); } // END - while // Load main template - loadTemplate('admin_list_bank_package', false, $OUT); + loadTemplate('admin_list_bank_package', FALSE, $OUT); } else { - // No packages found! - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND')); + // No packages found + displayMessage('{--ADMIN_BANK_NO_PACKAGES_FOUND--}'); } // Free the result -SQL_FREERESULT($result); +sqlFreeResult($result); -// +// [EOF] ?>