2 /************************************************************************
3 * MXChange v0.2.1 Start: 02/12/2004 *
4 * ================ Last change: 02/12/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_doubler.php *
8 * -------------------------------------------------------------------- *
9 * Short description : List doubler entries *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Verdoppler-Eintraege auflisten *
12 * -------------------------------------------------------------------- *
14 * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009) $ *
15 * $Tag:: 0.2.1-FINAL $ *
16 * $Author:: stelzi $ *
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 - 2008 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 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
45 // Add description as navigation point
46 ADD_DESCR("admin", __FILE__);
48 if (!REQUEST_ISSET_GET(('mode'))) {
49 // Chosse the overview page as default
50 REQUEST_GET('mode', "overview");
52 // Set table title automatically
53 if (!REQUEST_ISSET_GET(('select'))) REQUEST_GET('select', "all");
54 $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper(REQUEST_GET('mode'))."', getMessage('ADMIN_DOUBLER_LIST_".strtoupper(REQUEST_GET('mode'))."_".strtoupper(REQUEST_GET('select'))."'));";
58 // Load data for the template
59 switch (REQUEST_GET('mode'))
61 case "already": // Already payed out points
64 case "overview": // General overview page
65 $SUM_ALREADY = 0; $SUM_WAITING = 0;
66 // Number of direct already payouts and referal
67 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__);
68 list($cnt) = SQL_FETCHROW($result);
69 SQL_FREERESULT($result);
71 if ((empty($cnt)) || ($cnt == "0"))
73 // Nothing payed out so far
74 define('__DOUBLER_ALREADY_DIRECT_LINK', "0");
78 // Something was payed out
80 define('__DOUBLER_ALREADY_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=direct\">".$cnt."</a>");
82 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__);
83 list($cnt) = SQL_FETCHROW($result);
84 SQL_FREERESULT($result);
86 if ((empty($cnt)) || ($cnt == "0"))
88 // Nothing payed out so far
89 define('__DOUBLER_ALREADY_REF_LINK', "0");
93 // Something was payed out
95 define('__DOUBLER_ALREADY_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=ref\">".$cnt."</a>");
97 define('__DOUBLER_ALREADY_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=all\">".$SUM_ALREADY."</a>");
99 // And the same for waiting pouts (direct and referal)
100 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__);
101 list($cnt) = SQL_FETCHROW($result);
102 SQL_FREERESULT($result);
104 if ((empty($cnt)) || ($cnt == "0"))
106 // Nothing payed out so far
107 define('__DOUBLER_WAITING_DIRECT_LINK', "0");
111 // Something was payed out
112 $SUM_WAITING += $cnt;
113 define('__DOUBLER_WAITING_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=direct\">".$cnt."</a>");
115 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__);
116 list($cnt) = SQL_FETCHROW($result);
117 SQL_FREERESULT($result);
119 if ((empty($cnt)) || ($cnt == "0"))
121 // Nothing payed out so far
122 define('__DOUBLER_WAITING_REF_LINK', "0");
126 // Something was payed out
127 $SUM_WAITING += $cnt;
128 define('__DOUBLER_WAITING_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=ref\">".$cnt."</a>");
130 define('__DOUBLER_WAITING_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=all\">".$SUM_WAITING."</a>");
132 // All data is loaded here...
136 // Load mode template
137 LOAD_TEMPLATE("admin_list_doubler_".REQUEST_GET('mode'));