summaryrefslogtreecommitdiff
path: root/www-ssl/admin/aktiv.php
diff options
context:
space:
mode:
authorroot <root@www.engelsystem.de>2010-12-28 15:06:37 +0100
committerroot <root@www.engelsystem.de>2010-12-28 15:06:37 +0100
commit19d3dbaffe78a3dd77941b72628e68d2afe1d364 (patch)
treeeee4dea12e54474dafed31dac87487b0246bb11b /www-ssl/admin/aktiv.php
parent7e0c270341b8424f5336d236604f9c040d2c63a6 (diff)
parent4ebc072511a144eb11c5c86651a3753c774a448c (diff)
Merge branch 'master' into spezial_includes
Diffstat (limited to 'www-ssl/admin/aktiv.php')
-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 f7a44c7d..ddc7c3e8 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..")