if (!empty($_GET['id'])) {
// Show detailed informations to a sponsor
$result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, status, sponsor_created, last_online, last_change, receive_warnings, points_amount, points_used, remote_addr, warning_interval, refid, ref_count
-FROM `"._MYSQL_PREFIX."_sponsor_data`
+FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
}
// Check for sponsor's orders (only count)
- $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `"._MYSQL_PREFIX."_sponsor_orders` WHERE sponsorid='%s'",
+ $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE sponsorid='%s'",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
list($orders) = SQL_FETCHROW($result_orders);
SQL_FREERESULT($result_orders);
LOAD_TEMPLATE("admin_list_sponsor_details");
} else {
// Sponsor not found
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.$_GET['id'].ADMIN_SPONSOR_404_2);
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_SPONSOR_404'), $_GET['id']));
}
} elseif (!empty($_GET['rid'])) {
// Search for sponsor
- $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['rid'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
// Sponsor found so let's list all his referals
$result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr, ref_count
-FROM `"._MYSQL_PREFIX."_sponsor_data`
-WHERE refid='%s' ORDER BY id",
+FROM `{!_MYSQL_PREFIX!}_sponsor_data`
+WHERE refid='%s' ORDER BY `id`",
array(bigintval($_GET['rid'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
SQL_FREERESULT($result);
} else {
// No refs made so far
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."<a href=\"".URL."/modules.php?module=admin&what=list_sponsor&id=".bigintval($_GET['rid'])."\">".bigintval($_GET['rid'])."</a>".ADMIN_SPONSOR_REFS_404_2);
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_SPONSOR_REFS_404'), "<a href=\"{!URL!}/modules.php?module=admin&what=list_sponsor&id=".bigintval($_GET['rid'])."\">".bigintval($_GET['rid'])."</a>"));
}
} else {
// Sponsor not found
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.bigintval($_GET['rid']).ADMIN_SPONSOR_404_2);
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval($_GET['rid'])));
}
} else {
// List all sponsors
$result_main = SQL_QUERY("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr
-FROM `"._MYSQL_PREFIX."_sponsor_data` ORDER BY id", __FILE__, __LINE__);
+FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// At least one sponsor found!
$OUT = ""; $SW = 2;
- while(list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) {
+ while (list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) {
// Transfer data to array
$content = array(
'id' => $id,
LOAD_TEMPLATE("admin_list_sponsor");
} else {
// No sponsors registered so far
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_REGISTERED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SPONSOR_NONE_REGISTERED'));
}
}