summaryrefslogtreecommitdiff
path: root/www-ssl/admin
diff options
context:
space:
mode:
authorAngelo Cuccato <cuccato@web.de>2010-12-28 15:05:59 +0100
committerAngelo Cuccato <cuccato@web.de>2010-12-28 15:05:59 +0100
commit4ebc072511a144eb11c5c86651a3753c774a448c (patch)
tree6f21e73ae1a601088e0d521b87b82a1433b61745 /www-ssl/admin
parent7778db921eacd6c6ffdcd1c4b692a59b9e1fb499 (diff)
change aktive rating
Diffstat (limited to 'www-ssl/admin')
-rwxr-xr-xwww-ssl/admin/aktiv.php31
1 files changed, 22 insertions, 9 deletions
diff --git a/www-ssl/admin/aktiv.php b/www-ssl/admin/aktiv.php
index 9c6174f8..1dc24011 100755
--- a/www-ssl/admin/aktiv.php
+++ b/www-ssl/admin/aktiv.php
@@ -45,15 +45,22 @@ echo "<tr class=\"contenttopic\">\n";
echo "\t<td>". Get_Text("pub_aktive_Nick"). "</td>\n";
echo "\t<td>". Get_Text("pub_aktive_Anzahl"). "</td>\n";
echo "\t<td>". Get_Text("pub_aktive_Time"). "</td>\n";
+echo "\t<td>". Get_Text("pub_aktive_Time"). " Weight</td>\n";
+echo "\t<td>Freeloader ". Get_Text("pub_aktive_Anzahl"). "</td>\n";
+echo "\t<td>Freeloader ". Get_Text("pub_aktive_Time"). "</td>\n";
+echo "\t<td>". Get_Text("pub_aktive_Time"). " result</td>\n";
echo "\t<td>". Get_Text("pub_aktive_Active"). "</td>\n";
echo "</tr>\n";
-$SQL = "SELECT ShiftEntry.UID, COUNT(ShiftEntry.UID) AS NR, SUM(Shifts.Len) as LEN ".
- "FROM `ShiftEntry` ".
- "LEFT JOIN `Shifts` ON ShiftEntry.SID=Shifts.SID ".
- "WHERE NOT UID=0 ".
- "GROUP BY UID ".
- "ORDER BY LEN DESC, NR DESC, UID ";
+$SQL = "
+SELECT d.UID, d.nr, d.len, d.lenWeight, f.nr AS nrFree, f.len AS lenFree, d.lenWeight - COALESCE(f.len, 0) as lenReal
+ FROM
+ (SELECT e.UID, COUNT(s.Len) as nr, SUM(s.Len) as len, SUM( s.Len*(1+(((HOUR(s.DateS)+2)%24)<10 and ((HOUR(s.DateE)+2)%24)<10)) ) as lenWeight FROM `Shifts` AS s INNER JOIN `ShiftEntry` AS e USING(SID) WHERE NOT UID=0 GROUP BY UID) as d
+ LEFT JOIN
+ (SELECT UID, COUNT(Length) AS nr, SUM(Length) AS len FROM `ShiftFreeloader` GROUP BY UID) AS f
+ USING(UID)
+ ORDER BY lenReal DESC, nr DESC, UID";
+
$Erg = mysql_query($SQL, $con);
echo mysql_error($con);
$rowcount = mysql_num_rows($Erg);
@@ -63,12 +70,18 @@ for ($i=0; $i<$rowcount; $i++)
{
echo "\n\n\t<tr class=\"content\">\n";
echo "\t\t<td>". UID2Nick(mysql_result($Erg, $i, "UID")). "</td>\n";
- echo "\t\t<td>". mysql_result($Erg, $i, "NR"). "</td>\n";
- echo "\t\t<td>". mysql_result($Erg, $i, "LEN"). "h</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "nr"). "x</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "len"). "h</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "lenWeight"). "h</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "nrFree"). "x</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "lenFree"). "h</td>\n";
+ echo "\t\t<td>". mysql_result($Erg, $i, "lenReal"). "h</td>\n";
+
+
echo "\t\t<td>";
if (IsSet($_POST["Anzahl"]))
{
- if( $_POST["Anzahl"] < mysql_result($Erg, $i, "LEN") )
+ if( $_POST["Anzahl"] < mysql_result($Erg, $i, "lenReal") )
{
$aktivecount++;
if( $_POST["SendType"]=="Show..")