2 /************************************************************************
3 * MXChange v0.2.1 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 - 2008 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')) || (!IS_ADMIN())) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
45 // Add description as navigation point
46 ADD_DESCR('admin', __FILE__);
48 // Check if there is enougth selected
50 if ((REQUEST_ISSET_POST('id')) && (is_array(REQUEST_POST('id'))) && (count(REQUEST_POST('id')) > 0)) {
51 // Okay, which button was pressed?
52 if (REQUEST_ISSET_POST('change')) {
54 ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), 'bank_packages', 'package_active');
55 } elseif (REQUEST_ISSET_POST('edit')) {
56 // Delete entries (with confirmation)
57 ADMIN_EDIT_ENTRIES_CONFIRM(
60 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'),
61 array('bigintval', '', '', 'translateComma', 'bigintval', 'translateComma', '', '', 'bigintval', 'translateComma', 'translateComma', 'translateComma', 'translateComma', '', 'bigintval'),
62 array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
65 } elseif (REQUEST_ISSET_POST('do_edit')) {
66 // Delete entries (with confirmation)
67 ADMIN_EDIT_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array(), array(), array(), true);
68 } elseif (REQUEST_ISSET_POST('delete')) {
69 // Delete entries (with confirmation)
70 ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', ''));
72 } elseif (REQUEST_ISSET_POST('remove')) {
73 // Delete entries (with confirmation)
74 ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array(), array(), array(), true);
78 // Skip showing old entries?
81 // Load all banking packages from DB
82 $result = SQL_QUERY("SELECT id, title, description, account_fee AS 'fee', package_active AS 'active', interest_plus AS 'plus', interest_minus AS 'minus'
83 FROM `{!_MYSQL_PREFIX!}_bank_packages`
84 ORDER BY `id`", __FILE__, __LINE__);
86 // Is there at lease one package?
87 if (SQL_NUMROWS($result) > 0) {
90 while ($content = SQL_FETCHARRAY($result)) {
91 // "Translate" some data
92 $content['active'] = translateYesNo($content['active']);
93 $content['fee'] = translateComma($content['fee']);
94 $content['plus'] = translateComma($content['plus']);
95 $content['minus'] = translateComma($content['minus']);
99 $OUT .= LOAD_TEMPLATE('admin_list_bank_package_row', true, $content);
103 // Prepare row(s) for output to template
104 define('__BANK_PACKAGE_ROWS', $OUT);
106 // Load main template
107 LOAD_TEMPLATE('admin_list_bank_package');
109 // No packages found!
110 LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND'));
114 SQL_FREERESULT($result);