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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 // Add description as navigation point
42 ADD_DESCR("admin", basename(__FILE__));
44 if (empty($_GET['mode']))
46 // Chosse the overview page as default
47 $_GET['mode'] = "overview";
51 // Set table title automatically
52 if (empty($_GET['select'])) $_GET['select'] = "all";
53 $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."', ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."_".strtoupper($_GET['select']).");";
57 // Load data for the template
58 switch ($_GET['mode'])
60 case "already": // Already payed out points
63 case "overview": // General overview page
64 $SUM_ALREADY = 0; $SUM_WAITING = 0;
65 // Number of direct already payouts and referral
66 $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__);
67 list($cnt) = SQL_FETCHROW($result);
68 SQL_FREERESULT($result);
70 if ((empty($cnt)) || ($cnt == "0"))
72 // Nothing payed out so far
73 define('__DOUBLER_ALREADY_DIRECT_LINK', "0");
77 // Something was payed out
79 define('__DOUBLER_ALREADY_DIRECT_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=direct\">".$cnt."</A>");
81 $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__);
82 list($cnt) = SQL_FETCHROW($result);
83 SQL_FREERESULT($result);
85 if ((empty($cnt)) || ($cnt == "0"))
87 // Nothing payed out so far
88 define('__DOUBLER_ALREADY_REF_LINK', "0");
92 // Something was payed out
94 define('__DOUBLER_ALREADY_REF_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=ref\">".$cnt."</A>");
96 define('__DOUBLER_ALREADY_ALL_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=all\">".$SUM_ALREADY."</A>");
98 // And the same for waiting pouts (direct and referral)
99 $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__);
100 list($cnt) = SQL_FETCHROW($result);
101 SQL_FREERESULT($result);
103 if ((empty($cnt)) || ($cnt == "0"))
105 // Nothing payed out so far
106 define('__DOUBLER_WAITING_DIRECT_LINK', "0");
110 // Something was payed out
111 $SUM_WAITING += $cnt;
112 define('__DOUBLER_WAITING_DIRECT_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=direct\">".$cnt."</A>");
114 $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__);
115 list($cnt) = SQL_FETCHROW($result);
116 SQL_FREERESULT($result);
118 if ((empty($cnt)) || ($cnt == "0"))
120 // Nothing payed out so far
121 define('__DOUBLER_WAITING_REF_LINK', "0");
125 // Something was payed out
126 $SUM_WAITING += $cnt;
127 define('__DOUBLER_WAITING_REF_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=ref\">".$cnt."</A>");
129 define('__DOUBLER_WAITING_ALL_LINK', "<A href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=all\">".$SUM_WAITING."</A>");
131 // All data is loaded here...
135 // Load mode template
136 LOAD_TEMPLATE("admin_list_doubler_".$_GET['mode']);