Way more usage of EL code:
[mailer.git] / inc / modules / admin / what-list_bank_package.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 02/12/2004 *
4  * ===================                          Last change: 02/12/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-list_bank_package.php                       *
8  * -------------------------------------------------------------------- *
9  * Short description : List packages                                    *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Listet Angebotspakete auf                        *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
20  * For more information visit: http://www.mxchange.org                  *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if ((!defined('__SECURITY')) || (!isAdmin())) {
40         die();
41 } // END - if
42
43 // Add description as navigation point
44 addYouAreHereLink('admin', __FILE__);
45
46 // Check if there is enougth selected
47 $show = true;
48 if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) && (count(postRequestParameter('id')) > 0)) {
49         // Okay, which button was pressed?
50         if (isFormSent('change')) {
51                 // Change permissions
52                 adminChangeActivationStatus(postRequestParameter('id'), 'bank_packages', 'package_active');
53         } elseif (isFormSent('edit')) {
54                 // Delete entries (with confirmation)
55                 adminEditEntriesConfirm(
56                         postRequestParameter('id'),
57                         'bank_packages',
58                         array(
59                                 'id',
60                                 'title',
61                                 'description',
62                                 'account_fee',
63                                 'free_transfers',
64                                 'transfer_fee',
65                                 'output_system_mode',
66                                 'package_active',
67                                 'free_months_no_fee',
68                                 'interest_plus',
69                                 'interest_minus',
70                                 'first_payment',
71                                 'free_account_income',
72                                 'free_account_stuff',
73                                 'tan_lock'
74                         ),
75                         array(
76                                 'bigintval',
77                                 '',
78                                 '',
79                                 'translateComma',
80                                 'bigintval',
81                                 'translateComma',
82                                 '',
83                                 '',
84                                 'bigintval',
85                                 'translateComma',
86                                 'translateComma',
87                                 'translateComma',
88                                 'translateComma',
89                                 '',
90                                 'bigintval'
91                         ),
92                         array(
93                                 '',
94                                 '',
95                                 '',
96                                 '',
97                                 '',
98                                 '',
99                                 '',
100                                 '',
101                                 '',
102                                 '',
103                                 '',
104                                 '',
105                                 '',
106                                 '',
107                                 ''
108                         )
109                 );
110                 $show = false;
111         } elseif (isFormSent('do_edit')) {
112                 // Delete entries (with confirmation)
113                 adminEditEntriesConfirm(
114                         postRequestParameter('id'),
115                         'bank_packages',
116                         array(),
117                         array(),
118                         array(),
119                         true
120                 );
121         } elseif (isFormSent('delete')) {
122                 // Delete entries (with confirmation)
123                 adminDeleteEntriesConfirm(
124                         postRequestParameter('id'),
125                         'bank_packages',
126                         array(
127                                 'id',
128                                 'title',
129                                 'description',
130                                 'account_fee'
131                         ),
132                         array(
133                                 'bigintval',
134                                 '',
135                                 '',
136                                 'translateComma'
137                         ),
138                         array(
139                                 '',
140                                 '',
141                                 '',
142                                 ''
143                         )
144                 );
145                 $show = false;
146         } elseif (isFormSent('do_delete')) {
147                 // Delete entries (with confirmation)
148                 adminDeleteEntriesConfirm(
149                         postRequestParameter('id'),
150                         'bank_packages',
151                         array(),
152                         array(),
153                         array(),
154                         true
155                 );
156         }
157 } // END - if
158
159 // Skip showing old entries?
160 if ($show === false) return;
161
162 // Load all banking packages from DB
163 $result = SQL_QUERY("SELECT
164         `id`, `title`, `description`, `account_fee`, `package_active`, `interest_plus`, `interest_minus`
165 FROM
166         `{?_MYSQL_PREFIX?}_bank_packages`
167 ORDER BY
168         `id` ASC", __FILE__, __LINE__);
169
170 // Is there at lease one package?
171 if (!SQL_HASZERONUMS($result)) {
172         // List all packages
173         $OUT = '';
174         while ($content = SQL_FETCHARRAY($result)) {
175                 // Load row template
176                 $OUT .= loadTemplate('admin_list_bank_package_row', true, $content);
177         } // END - while
178
179         // Load main template
180         loadTemplate('admin_list_bank_package', false, $OUT);
181 } else {
182         // No packages found
183         displayMessage('{--ADMIN_BANK_NO_PACKAGES_FOUND--}');
184 }
185
186 // Free the result
187 SQL_FREERESULT($result);
188
189 // [EOF]
190 ?>