X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor.php;h=ca6488743674bc0df580081b45cf77b469055e05;hb=refs%2Fheads%2F0.2.1-FINAL;hp=8b8e451bf9e1518448b9546bf2131aa63e2db93e;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689;p=mailer.git diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index 8b8e451bf9..ca64887436 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -45,24 +45,24 @@ addYouAreHereLink('admin', __FILE__); if (isGetRequestElementSet('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`, + $result = sqlQueryEscaped("SELECT + `company`, `position`, `sex`, `surname`, `family`, `street_nr1`, `street_nr2`, `zip`, `city`, `country`, + `phone`, `fax`, `cell`, `email`, `url`, `tax_ident`, `status`, UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`, UNIX_TIMESTAMP(`last_online`) AS `last_online`, UNIX_TIMESTAMP(`last_change`) AS `last_change`, `receive_warnings`, - `points_amount`,`points_used`,`remote_addr`,`warning_interval`,`refid`,`ref_count` + `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__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Load sponsor details - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); // Check if an entry is empty foreach ($content as $k => $v) { @@ -79,32 +79,39 @@ WHERE $content['last_online'] = generateDateTime($content['last_online'], 2); $content['last_change'] = generateDateTime($content['last_change'], 2); // Orders total - $content['orders'] = countSumTotalData(bigintval(getRequestElement('id')), 'sponsor_orders', 'id', 'sponsor_id', true); + $content['orders'] = countSumTotalData(bigintval(getRequestElement('id')), 'sponsor_orders', 'id', 'sponsor_id', TRUE); // Load template - loadTemplate('admin_list_sponsor_details', false, $content); + loadTemplate('admin_list_sponsor_details', FALSE, $content); } else { // Sponsor not found displayMessage('{%message,ADMIN_SPONSOR_404=' . bigintval(getRequestElement('id')) . '%}'); } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); } elseif (isGetRequestElementSet('refid')) { // Search for sponsor - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1", array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); - // Sponsor found so let's list all his referals - $result = SQL_QUERY_ESC("SELECT - `id`,`gender`,`surname`,`family`,`email`,`status`, + // Sponsor found so let's list all his referrals + $result = sqlQueryEscaped("SELECT + `id`, + `sex`, + `surname`, + `family`, + `email`, + `status`, UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`, UNIX_TIMESTAMP(`last_online`) AS `last_online`, - `points_amount`,`points_used`, - `remote_addr`,`ref_count` + `points_amount`, + `points_used`, + `remote_addr`, + `ref_count` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE @@ -113,10 +120,10 @@ ORDER BY `id` ASC", array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result)) { + if (!ifSqlHasZeroNumRows($result)) { // List refs now // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); } else { // No refs made so far displayMessage(getMaskedMessage('ADMIN_SPONSOR_REFS_404', '' . bigintval(getRequestElement('refid')) . '')); @@ -127,11 +134,11 @@ ORDER BY } } else { // List all sponsors - $result_main = SQL_QUERY("SELECT - `id`,`gender`,`surname`,`family`,`email`,`status`, + $result_main = sqlQuery("SELECT + `id`, `sex`, `surname`, `family`, `email`, `status`, UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`, UNIX_TIMESTAMP(`last_online`) AS `last_online`, - `points_amount`,`points_used`, + `points_amount`, `points_used`, (`points_amount` + `points_used`) AS `points`, `remote_addr` FROM @@ -139,24 +146,24 @@ FROM ORDER BY `id` ASC", __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result_main)) { + if (!ifSqlHasZeroNumRows($result_main)) { // At least one sponsor found $OUT = ''; - while ($content = SQL_FETCHARRAY($result_main)) { + while ($content = sqlFetchArray($result_main)) { // Transfer data to array $content['email'] = generateEmailLink($content['email'], 'sponsor_data'); $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2); $content['last_online'] = generateDateTime($content['last_online'], 2); // Load row template - $OUT .= loadTemplate('admin_list_sponsor_row', true, $content); + $OUT .= loadTemplate('admin_list_sponsor_row', TRUE, $content); } // END - while // Free memory - SQL_FREERESULT($result_main); + sqlFreeResult($result_main); // Load final template - loadTemplate('admin_list_sponsor', false, $OUT); + loadTemplate('admin_list_sponsor', FALSE, $OUT); } else { // No sponsors registered so far displayMessage('{--ADMIN_SPONSOR_NONE_REGISTERED--}');