- LOAD_TEMPLATE("admin_config_point_settings");
-}
- elseif ($_GET['sub'] == "ref")
-{
- if ((isset($_POST['del'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0]))))
- {
- // Delete entries
- $SW = 2; $OUT = "";
- foreach ($_POST['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__);
- list($lvl, $perc) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data for the row template
- $content = array(
- 'sw' => $SW,
- 'id' => $id,
- 'lvl' => $lvl,
- 'per' => TRANSLATE_COMMA($perc),
- );
-
- // Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_points_del_row", true, $content);
- $SW = 3 - $SW;
- }
- define('__LEVEL_ROWS', $OUT);
-
- // Load main template
- LOAD_TEMPLATE("admin_points_del");
- }
- elseif ((isset($_POST['edit'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0]))))
- {
- // Edit entries
- $SW = 2; $OUT = "";
- foreach ($_POST['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__);
- list($lvl, $perc) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data for the row template
- $content = array(
- 'sw' => $SW,
- 'id' => $id,
- 'lvl' => $lvl,
- 'per' => TRANSLATE_COMMA($perc),
- );
-
- // Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_points_edit_row", true, $content);
- $SW = 3 - $SW;
- }
- define('__LEVEL_ROWS', $OUT);
-
- // Load main template
- LOAD_TEMPLATE("admin_points_edit");
- }
- else
- {
- // Referal levels
- $result = SQL_QUERY("SELECT id, level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
- // Make referal levels editable and deletable
- $SW = 2; $OUT = "";
-
- // List already existing categories for editing
- while (list($id, $lvl, $perc) = SQL_FETCHROW($result))
- {
- // Prepare data for the row template
- $content = array(
- 'sw' => $SW,
- 'id' => $id,
- 'lvl' => $lvl,
- 'per' => TRANSLATE_COMMA($perc),
- );
-
- // Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_points_row", true, $content);
- $SW = 3 - $SW;
- }
-
- // Free memory
- SQL_FREERESULT($result);
- define('__LEVEL_ROWS', $OUT);
-
- // Load main template
- LOAD_TEMPLATE("admin_points");
- }
-
- // Form for adding new referal levels
- LOAD_TEMPLATE("admin_add_reflvl");
- }
-}
- elseif ($_GET['sub'] == "points")
-{
- // First points for registration and other fixed points including new add-mode for one-time referal bonus...
- define('P_REG_VALUE', $_CONFIG['points_register']);
- define('P_REF_VALUE', $_CONFIG['points_ref']);
-
- // Load templates
- LOAD_TEMPLATE("admin_config_sub_points");
-}
- else
-{