]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_sponsor.php
Code cleanup, more usage of API functions
[mailer.git] / inc / modules / admin / what-list_sponsor.php
index 864e6fe6fdbdd50371159856e85019ba915c6d2c..70ee8d05e06377e1482806ff9c32a7bb38a740ce 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -50,7 +48,11 @@ if (isGetRequestParameterSet('id')) {
        $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`,
+       `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`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
@@ -99,7 +101,9 @@ WHERE
                // 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`,
+       UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+       UNIX_TIMESTAMP(`last_online`) AS `last_online`,
+       `points_amount`, `points_used`,
        `remote_addr`, `ref_count`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
@@ -125,7 +129,11 @@ ORDER BY
        // List all sponsors
        $result_main = SQL_QUERY("SELECT
        `id`, `gender`, `surname`, `family`, `email`, `status`,
-       `sponsor_created`, `last_online`, `points_amount`, `points_used`, `remote_addr`
+       UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+       UNIX_TIMESTAMP(`last_online`) AS `last_online`,
+       `points_amount`, `points_used`,
+       (`points_amount` + `points_used`) AS `points`,
+       `remote_addr`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 ORDER BY
@@ -139,7 +147,6 @@ ORDER BY
                        $content['email']           = generateEmailLink($content['email'], 'sponsor_data');
                        $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
                        $content['last_online']     = generateDateTime($content['last_online'], 2);
-                       $content['points']          = ($content['points_amount'] - $content['points_used']);
 
                        // Load row template
                        $OUT .= loadTemplate('admin_list_sponsor_row', true, $content);