************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
-}
+} // END - if
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
// Check if there is enougth selected
$show = true;
if (isset($_POST['change'])) {
// Change permissions
ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "bank_packages", "package_active");
+ } elseif (isset($_POST['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("", "", "", "", "", "", "", "", "", "", "", "", "", "", "")
+ );
+ $show = false;
+ } elseif (isset($_POST['do_edit'])) {
+ // Delete entries (with confirmation)
+ ADMIN_EDIT_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array(), array(), array(), true);
} elseif (isset($_POST['delete'])) {
// Delete entries (with confirmation)
- ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", "package_active", array("id", "title", "description", "account_fee"), array("bigintval", "", "", "TRANSLATE_COMMA"));
+ ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array("id", "title", "description", "account_fee"), array("bigintval", "", "", "TRANSLATE_COMMA"), array("", "", "", ""));
$show = false;
} elseif (isset($_POST['remove'])) {
// Delete entries (with confirmation)
- ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", "package_active", array(), array(), true);
+ ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array(), array(), array(), true);
}
-}
+} // END - if
// Skip showing old entries?
if (!$show) 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__);
+FROM `{!_MYSQL_PREFIX!}_bank_packages`
+ORDER BY `id`", __FILE__, __LINE__);
// Is there at lease one package?
if (SQL_NUMROWS($result) > 0) {
// Load row template
$OUT .= LOAD_TEMPLATE("admin_list_bank_package_row", true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Prepare row(s) for output to template
define('__BANK_PACKAGE_ROWS', $OUT);
LOAD_TEMPLATE("admin_list_bank_package");
} else {
// No packages found!
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BANK_NO_PACKAGES_FOUND);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND'));
}
// Free the result