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",
+ $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(getRequestParameter('id'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Contact data
$content['email_link'] = generateEmailLink($content['email'], 'sponsor_data');
// Timestamps
- $content['created'] = generateDateTime($content['sponsor_created'], 2);
- $content['last_online'] = generateDateTime($content['last_online'], 2);
- $content['last_change'] = generateDateTime($content['last_change'], 2);
+ $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
+ $content['last_online'] = generateDateTime($content['last_online'], 2);
+ $content['last_change'] = generateDateTime($content['last_change'], 2);
// Orders total
$content['orders'] = countSumTotalData(bigintval(getRequestParameter('id')), 'sponsor_orders', 'id', 'sponsorid', true);
`id` ASC",
array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List refs now
// Free memory
SQL_FREERESULT($result);
ORDER BY
`id` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// At least one sponsor found!
- $OUT = ''; $SW = 2;
+ $OUT = '';
while ($content = SQL_FETCHARRAY($result_main)) {
// Transfer data to array
$content = array(
- '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'],
+ 'id' => $content['id'],
+ 'gender' => $content['gender'],
+ 'surname' => $content['surname'],
+ 'family' => $content['family'],
+ 'email' => generateEmailLink($content['email'], 'sponsor_data'),
+ 'status' => $content['status'],
+ 'sponsor_created' => generateDateTime($content['sponsor_created'], 2),
+ 'last_online' => generateDateTime($content['last_online'], 2),
+ 'points' => ($content['points_amount'] - $content['points_used']),
+ 'remote_addr' => $content['remote_addr'],
);
// Load row template
$OUT .= loadTemplate('admin_list_sponsor_row', true, $content);
- $SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result_main);