Extension ext-earning introduced (unfinished), renamings:
[mailer.git] / inc / modules / admin / what-list_bank_package.php
index 86de21ccc2f2a564ad034ca0384cba0cbd751551..72cce2f7f58710624f21b2ff2d05ccfc9353ab0f 100644 (file)
@@ -45,31 +45,118 @@ addYouAreHereLink('admin', __FILE__);
 
 // Check if there is enougth selected
 $show = true;
-if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) && (count(postRequestParameter('id')) > 0)) {
+if ((isPostRequestElementSet('id')) && (is_array(postRequestElement('id'))) && (count(postRequestElement('id')) > 0)) {
        // Okay, which button was pressed?
        if (isFormSent('change')) {
                // Change permissions
-               adminChangeActivationStatus(postRequestParameter('id'), 'bank_packages', 'package_active');
+               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')) {
+       } 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('', '', '', ''));
+               adminDeleteEntriesConfirm(
+                       array('id'),
+                       array('bank_packages'),
+                       postRequestElement('id'),
+                       array(
+                               'id',
+                               'title',
+                               'description',
+                               'account_fee'
+                       ),
+                       array(
+                               'bigintval',
+                               '',
+                               '',
+                               'translateComma'
+                       ),
+                       array(
+                               '',
+                               '',
+                               '',
+                               ''
+                       )
+               );
                $show = false;
-       } elseif (isFormSent('remove')) {
+       } 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
 
@@ -78,7 +165,7 @@ if ($show === false) return;
 
 // Load all banking packages from DB
 $result = SQL_QUERY("SELECT
-       `id`, `title`, `description`, `account_fee`, `package_active`, `interest_plus`, `interest_minus`
+       `id`,`title`,`description`,`account_fee`,`package_active`,`interest_plus`,`interest_minus`
 FROM
        `{?_MYSQL_PREFIX?}_bank_packages`
 ORDER BY
@@ -97,7 +184,7 @@ if (!SQL_HASZERONUMS($result)) {
        loadTemplate('admin_list_bank_package', false, $OUT);
 } else {
        // No packages found
-       loadTemplate('admin_settings_saved', false, '{--ADMIN_BANK_NO_PACKAGES_FOUND--}');
+       displayMessage('{--ADMIN_BANK_NO_PACKAGES_FOUND--}');
 }
 
 // Free the result