// 12 3 32 2 3 32 2 3 4 43 21
if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Delete entries
- $OUT = ''; $SW = 2;
+ $OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
// Prepare data for the row template
$content = array(
- 'sw' => $SW,
'id' => $id,
'level' => $content['level'],
'percents' => translateComma($content['percents']),
// Load row template and switch color
$OUT .= loadTemplate('admin_points_del_row', true, $content);
- $SW = 3 - $SW;
- }
+ } // END - foreach
// Load main template
loadTemplate('admin_points_del', false, $OUT);
} elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Edit entries
- $OUT = ''; $SW = 2;
+ $OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
// Prepare data for the row template
$content = array(
- 'sw' => $SW,
'id' => $id,
'level' => $content['level'],
'percents' => translateComma($content['percents']),
// Load row template and switch color
$OUT .= loadTemplate('admin_points_edit_row', true, $content);
- $SW = 3 - $SW;
- }
+ } // END - foreach
// Load main template
loadTemplate('admin_points_edit', false, $OUT);
$result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Make referal levels editable and deletable
- $OUT = ''; $SW = 2;
+ $OUT = '';
// List already existing categories for editing
while ($content = SQL_FETCHARRAY($result)) {
// Prepare data for the row template
- $content['sw'] = $SW;
$content['percents'] = translateComma($content['percents']);
// Load row template and switch color
$OUT .= loadTemplate('admin_points_row', true, $content);
- $SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);