- loadTemplate('admin_config_point_settings', false, $content);
-} elseif (getRequestElement('sub') == 'ref') {
- // 12 3 32 2 3 32 2 3 4 43 21
- if ((isPostRequestElementSet('del')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
- // Delete entries
- $OUT = ''; $SW = 2;
- foreach (postRequestElement('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__);
- $content = SQL_FETCHARRAY($result);
- SQL_FREERESULT($result);
-
- // 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;
- }
-
- // Load main template
- loadTemplate('admin_points_del', false, $OUT);
- } elseif ((isPostRequestElementSet('edit')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
- // Edit entries
- $OUT = ''; $SW = 2;
- foreach (postRequestElement('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__);
- $content = SQL_FETCHARRAY($result);
- SQL_FREERESULT($result);
-
- // 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;
- }
-
- // Load main template
- loadTemplate('admin_points_edit', false, $OUT);
- } else {
- // Referal levels
- $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;
-
- // 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;
- }
-
- // Free memory
- SQL_FREERESULT($result);
-
- // Load main template
- loadTemplate('admin_points', false, $OUT);
- }
-
- // Form for adding new referal levels
- loadTemplate('admin_add_reflevel');
- }