summaryrefslogtreecommitdiff
path: root/www-ssl/admin/user.php
blob: 3e8e98c9b38807a79672f9c392c9f1552916ac40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?PHP

$title = "User-Liste";
$header = "Editieren der Engelliste";
include ("../../../27c3/includes/header.php");
include ("../../../27c3/includes/funktion_db_list.php");

if (!IsSet($_GET["enterUID"]))
{
	// Userliste, keine UID uebergeben...

	echo "<a href=\"../makeuser.php\">Neuen Engel eintragen</a><br><br>\n";
	
	if( !isset($_GET["OrderBy"]) ) $_GET["OrderBy"] = "Nick";
	$SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` ".
		"LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID ".
		"LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ".
		"ORDER BY `". $_GET["OrderBy"]. "` ASC";
	$Erg = mysql_query($SQL, $con);
	echo mysql_error($con);

	// anzahl zeilen
	$Zeilen  = mysql_num_rows($Erg);

	echo "Anzahl Engel: $Zeilen<br><br>\n";

	?><table width="100%" class="border" cellpadding="2" cellspacing="1"> 
	<tr class="contenttopic">
		<td>
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Nick">Nick</a> |
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=CreateDate">CreateDate</a>
		</td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Name">Name</a></td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Vorname">Vorname</a></td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Alter">Alter</a></td>
		<td>
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=email">@</a> | 
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=DECT">DECT</a> | 
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Hometown">Hometown</a> | 
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=lastLogIn">lastLogIn</a> | 
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Art">Type</a> | 
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=ICQ">ICQ</a> |
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=jabber">jabber</a> |
			<a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Group">Group</a> 
		</td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Size">Gr&ouml;&szlig;e</a></td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Gekommen">G</a></td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Aktiv">A</a></td>
		<td><a href="<?PHP echo $_SERVER["PHP_SELF"]; ?>?OrderBy=Tshirt">T</a></td>
		<td>&Auml;nd.</td>
		<td>Secure</td>
	</tr>


	<?PHP
	$Gekommen = 0;
	$Active = 0;
	$Tshirt = 0;
	
	for ($n = 0 ; $n < $Zeilen ; $n++) {
		echo "<tr class=\"content\">\n";
		echo "\t<td>".mysql_result($Erg, $n, "Nick"). "<br>(Create: ". mysql_result($Erg, $n, "CreateDate"). ")</td>\n";
		echo "\t<td>".mysql_result($Erg, $n, "Name")."</td>\n";
		echo "\t<td>".mysql_result($Erg, $n, "Vorname")."</td>\n";
		echo "\t<td>".mysql_result($Erg, $n, "Alter")."</td>\n";
		echo "\t<td>";
			if( strlen( mysql_result($Erg, $n, "Telefon"))>0)
				echo "\n\t\tTel: ". mysql_result($Erg, $n, "Telefon"). "<br>";
			if( strlen( mysql_result($Erg, $n, "Handy"))>0)
				echo "\n\t\tHandy: ". mysql_result($Erg, $n, "Handy"). "<br>";
			if( strlen( mysql_result($Erg, $n, "DECT"))>0)
				echo "\n\t\tDECT: <a href=\"./dect.php?custum=". mysql_result($Erg, $n, "DECT"). "\">".
					mysql_result($Erg, $n, "DECT"). "</a><br>";
			if( strlen( mysql_result($Erg, $n, "email"))>0)
				echo "\n\t\temail: <a href=\"mailto:".mysql_result($Erg, $n, "email")."\">".
					mysql_result($Erg, $n, "email")."</a><br>";
			if( strlen( mysql_result($Erg, $n, "Hometown"))>0)
				echo "\n\t\tHometown: ". mysql_result($Erg, $n, "Hometown"). "<br>";
			if( strlen( mysql_result($Erg, $n, "lastLogIn"))>0)
				echo "\n\t\tlastLogIn: ". mysql_result($Erg, $n, "lastLogIn"). "<br>";
			if( strlen( mysql_result($Erg, $n, "Art"))>0)
				echo "\n\t\tType: ". mysql_result($Erg, $n, "Art"). "<br>";
			if( strlen( mysql_result($Erg, $n, "ICQ"))>0)
				echo "\n\t\tICQ: ". mysql_result($Erg, $n, "ICQ"). "<br>";
			if( strlen( mysql_result($Erg, $n, "jabber"))>0)
				echo "\n\t\tjabber: ". mysql_result($Erg, $n, "jabber"). "<br>";
			echo "\n\t\tGroup: ". mysql_result($Erg, $n, "Group"). "<br>";
			echo "</td>\n";
		echo "\t<td>".mysql_result($Erg, $n, "Size")."</td>\n";
		$Gekommen += mysql_result($Erg, $n, "Gekommen");
		echo "\t<td>".mysql_result($Erg, $n, "Gekommen")."</td>\n";
		$Active += mysql_result($Erg, $n, "Aktiv");
		echo "\t<td>".mysql_result($Erg, $n, "Aktiv")."</td>\n";
		$Tshirt += mysql_result($Erg, $n, "Tshirt");
		echo "\t<td>".mysql_result($Erg, $n, "Tshirt")."</td>\n";
		echo "\t<td>". funktion_isLinkAllowed_addLink_OrEmpty( 
				"admin/userChangeNormal.php?enterUID=". 
					mysql_result($Erg, $n, "UID")."&Type=Normal",
				"&Auml;nd.").
			"</td>\n";
		echo "\t<td>". funktion_isLinkAllowed_addLink_OrEmpty( 
				"admin/userChangeSecure.php?enterUID=". 
					mysql_result($Erg, $n, "UID")."&Type=Secure",
				"Secure").
			"</td>\n";
		echo "</tr>\n";
	}
	echo "<tr>".
		"<td></td><td></td><td></td><td></td><td></td><td></td>".
		"<td>$Gekommen</td><td>$Active</td><td>$Tshirt</td><td></td></tr>\n";
	echo "\t</table>\n";
	// Ende Userliste

	echo "<h1>Statistics</h1>";
	funktion_db_element_list_2row( "Hometown",
        	                        "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`");

	echo "<br>\n";

	funktion_db_element_list_2row( "Engeltypen",
                                        "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`");

	echo "<br>\n";

	funktion_db_element_list_2row( "Used Groups",
		"SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` ".
		"LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ".
		"WHERE (UserCVS.GroupID!='NULL') ".
		"GROUP BY `GroupName` ".
		"");
}
else
{
	echo "error";
}

include ("../../../27c3/includes/footer.php");
?>