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 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", __FILE__);
43 if (!REQUEST_ISSET_GET(('mode'))) {
44 // Chosse the overview page as default
45 REQUEST_GET('mode', "overview");
47 // Set table title automatically
48 if (!REQUEST_ISSET_GET(('select'))) REQUEST_GET('select', "all");
49 $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper(REQUEST_GET('mode'))."', getMessage('ADMIN_DOUBLER_LIST_".strtoupper(REQUEST_GET('mode'))."_".strtoupper(REQUEST_GET('select'))."'));";
53 // Load data for the template
54 switch (REQUEST_GET('mode'))
56 case "already": // Already payed out points
59 case "overview": // General overview page
60 $SUM_ALREADY = 0; $SUM_WAITING = 0;
61 // Number of direct already payouts and referal
62 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__);
63 list($cnt) = SQL_FETCHROW($result);
64 SQL_FREERESULT($result);
66 if ((empty($cnt)) || ($cnt == "0"))
68 // Nothing payed out so far
69 define('__DOUBLER_ALREADY_DIRECT_LINK', "0");
73 // Something was payed out
75 define('__DOUBLER_ALREADY_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=direct\">".$cnt."</a>");
77 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__);
78 list($cnt) = SQL_FETCHROW($result);
79 SQL_FREERESULT($result);
81 if ((empty($cnt)) || ($cnt == "0"))
83 // Nothing payed out so far
84 define('__DOUBLER_ALREADY_REF_LINK', "0");
88 // Something was payed out
90 define('__DOUBLER_ALREADY_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=ref\">".$cnt."</a>");
92 define('__DOUBLER_ALREADY_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=all\">".$SUM_ALREADY."</a>");
94 // And the same for waiting pouts (direct and referal)
95 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__);
96 list($cnt) = SQL_FETCHROW($result);
97 SQL_FREERESULT($result);
99 if ((empty($cnt)) || ($cnt == "0"))
101 // Nothing payed out so far
102 define('__DOUBLER_WAITING_DIRECT_LINK', "0");
106 // Something was payed out
107 $SUM_WAITING += $cnt;
108 define('__DOUBLER_WAITING_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=direct\">".$cnt."</a>");
110 $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__);
111 list($cnt) = SQL_FETCHROW($result);
112 SQL_FREERESULT($result);
114 if ((empty($cnt)) || ($cnt == "0"))
116 // Nothing payed out so far
117 define('__DOUBLER_WAITING_REF_LINK', "0");
121 // Something was payed out
122 $SUM_WAITING += $cnt;
123 define('__DOUBLER_WAITING_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=ref\">".$cnt."</a>");
125 define('__DOUBLER_WAITING_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=all\">".$SUM_WAITING."</a>");
127 // All data is loaded here...
131 // Load mode template
132 LOAD_TEMPLATE("admin_list_doubler_".REQUEST_GET('mode'));