X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor.php;h=717664472904b6529c764ca9c722b57b0f3f7b49;hb=00974432ffe0ed217b993e1ea5aaaac7dc31e82b;hp=51d355d9993ae72532454a4a45394219e933952e;hpb=0715fa7aa8e5e70bcf1d957fb09ae655c3896c4e;p=mailer.git diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index 51d355d999..7176644729 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -40,7 +40,7 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point addMenuDescription('admin', __FILE__); @@ -60,37 +60,19 @@ WHERE `id`='%s' LIMIT 1", // 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(getRequestParameter('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'] = getRequestParameter('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); @@ -146,19 +128,18 @@ ORDER BY $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