change aktive rating

main
Angelo Cuccato 14 years ago
parent 7778db921e
commit 4ebc072511

@ -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_Nick"). "</td>\n";
echo "\t<td>". Get_Text("pub_aktive_Anzahl"). "</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"). "</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 "\t<td>". Get_Text("pub_aktive_Active"). "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
$SQL = "SELECT ShiftEntry.UID, COUNT(ShiftEntry.UID) AS NR, SUM(Shifts.Len) as LEN ". $SQL = "
"FROM `ShiftEntry` ". 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
"LEFT JOIN `Shifts` ON ShiftEntry.SID=Shifts.SID ". FROM
"WHERE NOT UID=0 ". (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
"GROUP BY UID ". LEFT JOIN
"ORDER BY LEN DESC, NR DESC, UID "; (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); $Erg = mysql_query($SQL, $con);
echo mysql_error($con); echo mysql_error($con);
$rowcount = mysql_num_rows($Erg); $rowcount = mysql_num_rows($Erg);
@ -63,12 +70,18 @@ for ($i=0; $i<$rowcount; $i++)
{ {
echo "\n\n\t<tr class=\"content\">\n"; echo "\n\n\t<tr class=\"content\">\n";
echo "\t\t<td>". UID2Nick(mysql_result($Erg, $i, "UID")). "</td>\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, "nr"). "x</td>\n";
echo "\t\t<td>". mysql_result($Erg, $i, "LEN"). "h</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>"; echo "\t\t<td>";
if (IsSet($_POST["Anzahl"])) if (IsSet($_POST["Anzahl"]))
{ {
if( $_POST["Anzahl"] < mysql_result($Erg, $i, "LEN") ) if( $_POST["Anzahl"] < mysql_result($Erg, $i, "lenReal") )
{ {
$aktivecount++; $aktivecount++;
if( $_POST["SendType"]=="Show..") if( $_POST["SendType"]=="Show..")

Loading…
Cancel
Save