* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isGetRequestElementSet('id')) {
+if (isGetRequestParameterSet('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`
WHERE `id`='%s' LIMIT 1",
- array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load sponsor details
// Check if an entry is empty
foreach ($content as $k => $v) {
if (empty($v)) $content[$k] = '---';
- }
-
- // Check for sponsor's orders (only count)
- $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE sponsorid='%s'",
- array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
- list($orders) = SQL_FETCHROW($result_orders);
- SQL_FREERESULT($result_orders);
- if (empty($orders)) $orders = '0';
+ } // END - foreach
// Prepare all data for the template
// Sponsor's id
- $content['id'] = getRequestElement('id');
- // Personal data
- $content['gender'] = translateGender($content['gender']);
+ $content['id'] = getRequestParameter('id');
// Contact data
$content['email_link'] = generateEmailLink($content['email'], 'sponsor_data');
- $content['url'] = generateDerefererUrl($content['url']);
// Timestamps
$content['created'] = generateDateTime($content['sponsor_created'], 2);
$content['last_online'] = generateDateTime($content['last_online'], 2);
$content['last_change'] = generateDateTime($content['last_change'], 2);
- // Sponsor points
- $content['points_amount'] = translateComma($content['points_amount']);
- $content['points_used'] = translateComma($content['points_used']);
- // Warning because low points
- $content['receive_warnings'] = translateYesNo($content['receive_warnings']);
- $content['warning_interval'] = createFancyTime($content['warning_interval']);
// Orders total
- $content['orders'] = $orders;
- // Other data
- $content['status'] = sponsorTranslateUserStatus($content['status']);
+ $content['orders'] = countSumTotalData(bigintval(getRequestParameter('id')), 'sponsor_orders', 'id', 'sponsorid', true);
// Load template
loadTemplate('admin_list_sponsor_details', false, $content);
} else {
// Sponsor not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), getRequestElement('id')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('id'))));
}
-} elseif (isGetRequestElementSet('rid')) {
+} elseif (isGetRequestParameterSet('rid')) {
// Search for sponsor
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' LIMIT 1",
- array(bigintval(getRequestElement('rid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
SQL_FREERESULT($result);
`refid`='%s'
ORDER BY
`id` ASC",
- array(bigintval(getRequestElement('rid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// List refs now
SQL_FREERESULT($result);
} else {
// No refs made so far
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_REFS_404'), "<a href=\"{?URL?}/modules.php?module=admin&what=list_sponsor&id=".bigintval(getRequestElement('rid'))."\">".bigintval(getRequestElement('rid'))."</a>"));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_REFS_404', '<a href="{%url=modules.php?module=admin&what=list_sponsor&id=' . bigintval(getRequestParameter('rid')) . '%}">' . bigintval(getRequestParameter('rid')) . '</a>'));
}
} else {
// Sponsor not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('rid'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('rid'))));
}
} else {
// List all sponsors
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_main)) {
// Transfer data to array
- // @TODO Rewritings: surname->surname,family->family,ip->remote_addr in template
$content = array(
- 'id' => $content['id'],
- 'sw' => $SW,
- 'gender' => translateGender($content['gender']),
- 'surname' => $content['surname'],
- 'family' => $content['family'],
- 'email' => generateEmailLink($content['email'], 'sponsor_data'),
- 'status' => sponsorTranslateUserStatus($content['status']),
- 'created' => generateDateTime($content['sponsor_created'], 2),
- 'last_online' => generateDateTime($content['last_online'], 2),
- 'points' => translateComma($content['points_amount'] - $content['points_used']),
- 'ip' => $content['remote_addr'],
+ 'id' => $content['id'],
+ 'sw' => $SW,
+ 'gender' => $content['gender'],
+ 'surname' => $content['surname'],
+ 'family' => $content['family'],
+ 'email' => generateEmailLink($content['email'], 'sponsor_data'),
+ 'status' => $content['status'],
+ 'created' => generateDateTime($content['sponsor_created'], 2),
+ 'last_online' => generateDateTime($content['last_online'], 2),
+ 'points' => translateComma($content['points_amount'] - $content['points_used']),
+ 'remote_addr' => $content['remote_addr'],
);
// Load row template