// Edit all selected country codes
$OUT = '';
- foreach (postRequestParameter('id') as $id => $status) {
+ foreach (postRequestParameter('id') as $id => $isActive) {
// Load data from DB
$result = SQL_QUERY_ESC("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if ($post == 'modify') {
// Generate default selection in edit-mode
- $content['status'] = generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $status);
+ $content['is_active'] = generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $isActive);
} else {
// Only display status when in delete-mode
- $content['status'] = translateYesNo($status);
+ $content['is_active'] = translateYesNo($isActive);
}
// Insert row template and switch color
// 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");
- }
+ } // END - foreach
// Create message
$message = '{--ADMIN_COUNTRIES_MODIFIED--}';
} // END - if
// Load currenty setup country codes to list
- $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',
__FILE__, __LINE__);
+
+ // Do we have entries?
if (!SQL_HASZERONUMS($result)) {
// List all countries
$OUT = '';