2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 02/12/2004 *
4 * =================== Last change: 02/12/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_bank_package.php *
8 * -------------------------------------------------------------------- *
9 * Short description : List packages *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Listet Angebotspakete auf *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!isAdmin())) {
44 // Add description as navigation point
45 addMenuDescription('admin', __FILE__);
47 // Check if there is enougth selected
49 if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) && (count(postRequestParameter('id')) > 0)) {
50 // Okay, which button was pressed?
51 if (isPostRequestParameterSet('change')) {
53 adminChangeActivationStatus(postRequestParameter('id'), 'bank_packages', 'package_active');
54 } elseif (isPostRequestParameterSet('edit')) {
55 // Delete entries (with confirmation)
56 adminEditEntriesConfirm(
57 postRequestParameter('id'),
59 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'),
60 array('bigintval', '', '', 'translateComma', 'bigintval', 'translateComma', '', '', 'bigintval', 'translateComma', 'translateComma', 'translateComma', 'translateComma', '', 'bigintval'),
61 array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
64 } elseif (isPostRequestParameterSet('do_edit')) {
65 // Delete entries (with confirmation)
66 adminEditEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true);
67 } elseif (isPostRequestParameterSet('delete')) {
68 // Delete entries (with confirmation)
69 adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', ''));
71 } elseif (isPostRequestParameterSet('remove')) {
72 // Delete entries (with confirmation)
73 adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true);
77 // Skip showing old entries?
78 if ($show === false) return;
80 // Load all banking packages from DB
81 $result = SQL_QUERY("SELECT id, title, description, account_fee AS 'fee', package_active AS 'active', interest_plus AS 'plus', interest_minus AS 'minus'
82 FROM `{?_MYSQL_PREFIX?}_bank_packages`
83 ORDER BY `id` ASC", __FILE__, __LINE__);
85 // Is there at lease one package?
86 if (SQL_NUMROWS($result) > 0) {
89 while ($content = SQL_FETCHARRAY($result)) {
90 // "Translate" some data
91 $content['active'] = translateYesNo($content['active']);
92 $content['fee'] = translateComma($content['fee']);
93 $content['plus'] = translateComma($content['plus']);
94 $content['minus'] = translateComma($content['minus']);
98 $OUT .= loadTemplate('admin_list_bank_package_row', true, $content);
102 // Load main template
103 loadTemplate('admin_list_bank_package', false, $OUT);
105 // No packages found!
106 loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND'));
110 SQL_FREERESULT($result);