* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
} elseif ((isFormSent('change')) && (isPostRequestParameterSet('id'))) {
// Change all status
adminChangeActivationStatus(postRequestParameter('id'), 'countries', 'is_active');
} elseif ((isFormSent('change')) && (isPostRequestParameterSet('id'))) {
// Change all status
adminChangeActivationStatus(postRequestParameter('id'), 'countries', 'is_active');
// Show next link
loadTemplate('admin_next_link', false, array(
'url' => 'modules.php?module=admin&what=list_country',
// Show next link
loadTemplate('admin_next_link', false, array(
'url' => 'modules.php?module=admin&what=list_country',
));
} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('delete'))) && (isPostRequestParameterSet('id'))) {
if (count(postRequestParameter('id')) > 0) {
));
} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('delete'))) && (isPostRequestParameterSet('id'))) {
if (count(postRequestParameter('id')) > 0) {
- $class = 'admin_submit';
- $submit = getMessage('ADMIN_COUNTRY_EDIT_NOW');
- $title = getMessage('ADMIN_COUNTRY_EDIT_TITLE');
- $reset = '<input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}" /> ';
+ $class = 'form_submit';
+ $submit = '{--ADMIN_COUNTRY_EDIT_NOW--}';
+ $title = '{--ADMIN_COUNTRY_EDIT_TITLE--}';
+ $reset = '<input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" /> ';
- $class = 'admin_delete';
- $submit = getMessage('ADMIN_COUNTRY_DELETE_NOW');
- $title = getMessage('ADMIN_COUNTRY_DELETE_TITLE');
+ $class = 'form_delete';
+ $submit = '{--ADMIN_COUNTRY_DELETE_NOW--}';
+ $title = '{--ADMIN_COUNTRY_DELETE_TITLE--}';
- $result = SQL_QUERY_ESC("SELECT code, descr FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
- list($code, $descr) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data, load row template and switch colors
- $content = array(
- 'id' => $id,
- 'code' => $code,
- 'descr' => $descr,
- 'sw' => $SW,
- );
+ $content = SQL_FETCHARRAY($result);
- $content['status'] = generateOptionList('/ARRAY/', array('Y', 'N'), array(getMessage('YES'), getMessage('NO')), $status);
+ $content['is_active'] = generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $isActive);
}
// Insert row template and switch color
$OUT .= loadTemplate($row, true, $content);
}
// Insert row template and switch color
$OUT .= loadTemplate($row, true, $content);
// Modify
foreach (postRequestParameter('id') as $id => $sel) {
addSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET `code`='" . postRequestParameter('code', $id) . "', `descr`='" . postRequestParameter('descr', $id) . "', `is_active`='" . postRequestParameter('is_active', $id) . "' WHERE `id`=" . bigintval($id) . " LIMIT 1");
// Modify
foreach (postRequestParameter('id') as $id => $sel) {
addSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET `code`='" . postRequestParameter('code', $id) . "', `descr`='" . postRequestParameter('descr', $id) . "', `is_active`='" . postRequestParameter('is_active', $id) . "' WHERE `id`=" . bigintval($id) . " LIMIT 1");
} elseif ((isFormSent('remove')) && (isPostRequestParameterSet('id'))) {
// Remove
$IDs = implode(',', array_keys(postRequestParameter('id')));
addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(postRequestParameter('id'))."");
// Create message
} elseif ((isFormSent('remove')) && (isPostRequestParameterSet('id'))) {
// Remove
$IDs = implode(',', array_keys(postRequestParameter('id')));
addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(postRequestParameter('id'))."");
// Create message
- $result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY code',
+ $result = SQL_QUERY('SELECT `id`, `code`, `descr`, `is_active` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `code` ASC',
// Load row template and switch colors
$OUT .= loadTemplate('admin_list_country_row', true, $content);
// Load row template and switch colors
$OUT .= loadTemplate('admin_list_country_row', true, $content);