2 /************************************************************************
3 * MXChange v0.2.1 Start: 01/28/2004 *
4 * ================ Last change: 06/10/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_refs.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Show all referrals made by a member *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Alle generierten Refs eines Mitgliedes anzeigen *
12 * -------------------------------------------------------------------- *
14 * Mod created by : Lars Moehlenbruch ( http://www.surfo.net ) *
16 * -------------------------------------------------------------------- *
18 * Highly modified by Roland Haeder *
20 * -------------------------------------------------------------------- *
21 * Copyright (c) 2003 - 2008 by Roland Haeder *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
42 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
46 // Add description as navigation point
47 ADD_DESCR("admin", basename(__FILE__));
49 if (!empty($_GET['u_id'])) {
50 // Check if the user already exists
51 $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
52 array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
53 if (SQL_NUMROWS($result) == 1) {
54 // Load all referal levels
55 $result_levels = SQL_QUERY_ESC("SELECT d.level, d.percents, r.counter
56 FROM "._MYSQL_PREFIX."_refdepths AS d
57 LEFT JOIN "._MYSQL_PREFIX."_refsystem AS r
60 ORDER BY d.level ASC",
61 array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
63 // Are there some levels (VERY BAD IF NONE!)
64 if (SQL_NUMROWS($result_levels) > 0) {
65 // List all ref levels
67 while ($levels = SQL_FETCHARRAY($result_levels)) {
70 $levels['level'] = ($levels['level'] + 1);
72 // Load all refs of this user
73 //$result_refs = SQL_QUERY_ESC("SELECT
74 // Load level template
75 $OUT .= LOAD_TEMPLATE("admin_list_refs_level", true, $levels);
84 'uid' => ADMIN_USER_PROFILE_LINK($_GET['u_id'])
88 LOAD_TEMPLATE("admin_list_refs", false, $content);
90 // No levels found, very bad!
91 LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_REF_LEVELS);
95 SQL_FREERESULT($result_levels);
98 LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_MEMBER_404, $_GET['u_id']));
102 SQL_FREERESULT($result);
104 // Output selection form with all confirmed user accounts listed
105 ADD_MEMBER_SELECTION_BOX();