switch ($_GET['sub'])
{
case "points":
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_config` SET points_register='".$_POST['points_register']."', points_ref='".$_POST['points_ref']."' WHERE config=0 LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_config` SET points_register='".$_POST['points_register']."', points_ref='".$_POST['points_ref']."' WHERE config=0 LIMIT 1";
break;
case "ref":
switch ($_GET['do'])
{
case "add":
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')";
break;
case "edit": // Change entries
$_POST['perc'][$id] = REVERT_COMMA($_POST['perc'][$id]);
// Update entry
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__);
}
$message = REF_DEPTHS_SAVED;
case "del":
foreach ($_POST['id'] as $id => $value) {
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
$message = REF_DEPTHS_DELETED;
case "settings":
$REF = bigintval($_POST['ref_payout']);
- $SQLs[] = sprintf("UPDATE `{!MYSQL_PREFIX!}_config` SET
+ $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_config` SET
allow_direct_pay='%s',
reg_points_mode='%s',
ref_payout='%s'
);
if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0)) {
// Update account's ref_payout for "must-confirm"
- $SQLs[] = sprintf("UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_payout=(%s - mails_confirmed)
+ $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=(%s - mails_confirmed)
WHERE mails_confirmed < %s", $REF, $REF);
} elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0)) {
// Update account's ref_payout for "not-must-confirm"
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_payout=0 WHERE ref_payout > 0";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_points` SET points=points+locked_points WHERE locked_points>0";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=0 WHERE ref_payout > 0";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+locked_points WHERE locked_points>0";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0";
}
break;
}
if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) {
if (strpos($SQLs[0], "INSERT") > -1) {
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
SQL_FREERESULT($result);
} // END - if
REBUILD_CACHE("config", "config");
} else {
// Prepare failed-message
- $message = "<span class=\"admin_failed\">".SETTINGS_NOT_SAVED."</span>";
+ $message = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
}
// Remove SQL queries
// 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",
+ $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);
// 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",
+ $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);
LOAD_TEMPLATE("admin_points_edit");
} else {
// Referal levels
- $result = SQL_QUERY("SELECT id, level, percents FROM `{!MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
+ $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 = "";