Extension ext-earning introduced (unfinished), renamings:
[mailer.git] / inc / modules / admin / what-list_bank_package.php
index 1ca2d5a9746aba93ad01e6468d4c49b54b21587f..72cce2f7f58710624f21b2ff2d05ccfc9353ab0f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 02/12/2004 *
- * ================                             Last change: 02/12/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 02/12/2004 *
+ * ===================                          Last change: 02/12/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-list_bank_package.php                       *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Listet Angebotspakete auf                        *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
 } // END - if
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
 // Check if there is enougth selected
 $show = true;
-if ((isset($_POST['id'])) && (is_array($_POST['id'])) && (count($_POST['id']) > 0)) {
+if ((isPostRequestElementSet('id')) && (is_array(postRequestElement('id'))) && (count(postRequestElement('id')) > 0)) {
        // Okay, which button was pressed?
-       if (isset($_POST['change'])) {
+       if (isFormSent('change')) {
                // Change permissions
-               ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "bank_packages", "package_active");
-       } elseif (isset($_POST['edit'])) {
+               adminChangeActivationStatus(postRequestElement('id'), 'bank_packages', 'package_active');
+       } elseif (isFormSent('edit')) {
                // Delete entries (with confirmation)
-               ADMIN_EDIT_ENTRIES_CONFIRM(
-                       $_POST['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", "", "", "TRANSLATE_COMMA", "bigintval", "TRANSLATE_COMMA", "", "", "bigintval", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "", "bigintval"),
-                       array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "")
+               adminEditEntriesConfirm(
+                       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 (isset($_POST['do_edit'])) {
+       } elseif (isFormSent('do_edit')) {
                // Delete entries (with confirmation)
-               ADMIN_EDIT_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array(), array(), array(), true);
-       } elseif (isset($_POST['delete'])) {
+               adminEditEntriesConfirm(
+                       array('id'),
+                       array('bank_packages'),
+                       postRequestElement('id'),
+                       array(),
+                       array(),
+                       array(),
+                       array(true)
+               );
+       } elseif (isFormSent('delete')) {
                // Delete entries (with confirmation)
-               ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array("id", "title", "description", "account_fee"), array("bigintval", "", "", "TRANSLATE_COMMA"), array("", "", "", ""));
+               adminDeleteEntriesConfirm(
+                       array('id'),
+                       array('bank_packages'),
+                       postRequestElement('id'),
+                       array(
+                               'id',
+                               'title',
+                               'description',
+                               'account_fee'
+                       ),
+                       array(
+                               'bigintval',
+                               '',
+                               '',
+                               'translateComma'
+                       ),
+                       array(
+                               '',
+                               '',
+                               '',
+                               ''
+                       )
+               );
                $show = false;
-       } elseif (isset($_POST['remove'])) {
+       } elseif (isFormSent('do_delete')) {
                // Delete entries (with confirmation)
-               ADMIN_DELETE_ENTRIES_CONFIRM($_POST['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) 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", __FILE__, __LINE__);
+$result = SQL_QUERY("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 (!SQL_HASZERONUMS($result)) {
        // List all packages
-       $OUT = ""; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
-               // "Translate" some data
-               $content['active'] = TRANSLATE_YESNO($content['active']);
-               $content['fee']    = TRANSLATE_COMMA($content['fee']);
-               $content['plus']   = TRANSLATE_COMMA($content['plus']);
-               $content['minus']  = TRANSLATE_COMMA($content['minus']);
-               $content['sw']     = $SW;
-
                // Load row template
-               $OUT .= LOAD_TEMPLATE("admin_list_bank_package_row", true, $content);
-               $SW = 3 - $SW;
+               $OUT .= loadTemplate('admin_list_bank_package_row', true, $content);
        } // END - while
 
-       // Prepare row(s) for output to template
-       define('__BANK_PACKAGE_ROWS', $OUT);
-
        // Load main template
-       LOAD_TEMPLATE("admin_list_bank_package");
+       loadTemplate('admin_list_bank_package', false, $OUT);
 } else {
-       // No packages found!
-       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BANK_NO_PACKAGES_FOUND);
+       // No packages found
+       displayMessage('{--ADMIN_BANK_NO_PACKAGES_FOUND--}');
 }
 
 // Free the result
 SQL_FREERESULT($result);
 
-//
+// [EOF]
 ?>