* -------------------------------------------------------------------- *
* 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');
- $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,
- );
+ $content = SQL_FETCHARRAY($result);
- $content['status'] = generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--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);
} // END - if
}
// Insert row template and switch color
$OUT .= loadTemplate($row, true, $content);
} // END - if
// 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");
- $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);
} // END - while
// Load row template and switch colors
$OUT .= loadTemplate('admin_list_country_row', true, $content);
} // END - while