2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 11/13/2004 *
4 * =================== Last change: 11/14/2004 *
6 * -------------------------------------------------------------------- *
7 * File : show_bonus.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Show ranking list for turbo-bonus *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Rankliste fuer Turbo-Bonus anzeigen *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Load security stuff here
40 require('inc/libs/security_functions.php');
43 $GLOBALS['startTime'] = microtime(true);
45 // Set this because we have no module in URI
46 $GLOBALS['module'] = 'show_bonus';
47 $GLOBALS['output_mode'] = '0';
49 // Load the required file(s)
50 require('inc/config-global.php');
53 setContentType('text/html');
55 // Is the 'bonus' extension active?
56 redirectOnUninstalledExtension('bonus');
59 loadIncludeOnce('inc/header.php');
61 if ((getRequestParameter('userid') > 0) && (getRequestParameter('d') > 0) && (isGetRequestParameterSet('t'))) {
64 switch (getRequestParameter('t')) {
65 case 'bonusid': // Bonus mail
69 case 'mailid': // Regular member mail
73 default: // Invalid type
74 logDebugMessage(__FILE__, __LINE__, sprintf("Invalid type %s detected.", getRequestParameter('t')));
81 $result = SQL_QUERY_ESC("SELECT d.gender, d.surname, d.family, b.level, b.points
83 `{?_MYSQL_PREFIX?}_user_data` AS d
85 `{?_MYSQL_PREFIX?}_bonus_turbo` AS b
89 d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s
92 bigintval(getRequestParameter('userid')),
94 bigintval(getRequestParameter('d'))
95 ), __FILE__, __LINE__);
98 if (SQL_NUMROWS($result) == 1) {
100 $content = SQL_FETCHARRAY($result);
102 // Prepare constants for the pre-template
103 $content['gender'] = translateGender($content['gender']);
104 $content['points'] = translateComma($content['points']);
105 $content['mailid'] = bigintval(getRequestParameter('d'));
106 $content['rows'] = addBonusRanks(bigintval(getRequestParameter('d')), $t, bigintval(getRequestParameter('userid')));
108 // Get some prepared content
109 $content = merge_array($content, $GLOBALS['ranking_content']);
112 $content['message'] = loadTemplate('show_bonus_msg', true, $content);
115 $content['message'] = "<span class=\"guest_failed\">{--BONUS_SHOW_NO_DATA--}</span>";
119 SQL_FREERESULT($result);
121 // Wrong type entered
122 $content['message'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_TYPE--}</span>";
126 $content['message'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_CALL--}</span>";
129 // Load send_bonus header template (for your banners, e.g.?)
130 $content['header'] = loadTemplate('show_bonus_header', true);
132 // Load show_bonus footer template (for your banners, e.g.?)
133 $content['footer'] = loadTemplate('show_bonus_footer', true);
135 // Load final template
136 loadTemplate('show_bonus', false, $content);
139 loadIncludeOnce('inc/footer.php');