Oops, I forgot to add this file to my previous commit
diff --git a/ranking.php b/ranking.php
index d1124b8..3d90f1d 100644
--- a/ranking.php
+++ b/ranking.php
@@ -1,5 +1,6 @@
<html>
<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
<link rel="stylesheet" href="./css/ranking.css" />
</head>
@@ -9,12 +10,12 @@
<?php
require './credentials.php';
require './php/utils.php';
-
+
// $getranking = "SELECT morts.assassi AS id, users.grau, users.curs, count(morts.assassi) AS kills FROM morts INNER JOIN users ON morts.assassi = users.id GROUP BY morts.assassi";
// $getranking = "SELECT morts.assassi AS id, users.grau, users.curs, count(morts.assassi) AS kills, sum(CASE WHEN morts.grau = users.grau THEN 1 ELSE 2 END) AS kills_pondered FROM morts INNER JOIN users ON morts.assassi = users.id GROUP BY morts.assassi ORDER BY kills_pondered DESC";
// Mateix grau i curs => 1, Mateix grau diferent curs => 2, Diferent grau => 3
// $getranking = "SELECT morts.assassi AS id, users.grau, users.curs, count(morts.assassi) AS kills, sum(CASE WHEN morts.grau = users.grau AND morts.curs = users.curs THEN 1 WHEN morts.grau = users.grau AND morts.curs != users.curs THEN 2 ELSE 3 END) AS kills_pondered FROM morts INNER JOIN users ON morts.assassi = users.id GROUP BY morts.assassi ORDER BY kills_pondered DESC";
-
+
// Mateix grau i curs => 100, Mateix grau diferent curs => 150, Diferent grau => 200
$getranking = "SELECT morts.assassi AS id, users.nom, users.grau, users.curs, count(morts.assassi) AS kills,
sum(morts.grau = users.grau AND morts.curs = users.curs) AS companys_classe,
@@ -22,7 +23,7 @@
sum(morts.grau != users.grau) AS companys_facu,
sum(CASE WHEN morts.grau = users.grau AND morts.curs = users.curs THEN 100 WHEN morts.grau = users.grau AND morts.curs != users.curs THEN 150 ELSE 200 END) AS score
FROM morts INNER JOIN users ON morts.assassi = users.id GROUP BY morts.assassi ORDER BY score DESC";
-
+
$results = query($getranking);
?>
@@ -32,9 +33,9 @@
<div id="leftlinks"><a id="info" href="javascript:void(0);" onclick="js: toggleinfo();">+Info</a></div>
<div id="rightlinks"><a href="./index.php">Tornar a l'inici</a></div>
</header>
-
+
<p><img src="./bin/images/info.png" width="32px" /> La puntuació de cada jugador es calcula com a una suma ponderada depenent del caràcter de les seves víctimes: companys de <b>c</b>lasse (mateix curs, mateix grau), companys de <b>g</b>rau (mateix grau) i companys de <b>f</b>acultat (diferents grau). Amb puntuacions +100, +150 i +200; respectivament.</p>
-
+
<div id="table-container">
<table id="ranking" cellspacing="0" cellpadding="0">
<tr id="header">
@@ -49,14 +50,14 @@
<?php
$id = 0;
$i = 1;
-
+
while ($row = $results->fetch_object()) {
if ($i == 1) echo "<tr class='gold top3'>";
else if ($i == 2) echo "<tr class='silver top3'>";
else if ($i == 3) echo "<tr class='bronze top3'>";
else if ($row->id == $id) echo "<tr class='me'>";
else echo "<tr>";
-
+
echo "<td>". ($i > 3 ? $i : '') ."</td>";
echo "<td class='name'><div>
<div class='username'>$row->nom</div>
@@ -68,7 +69,7 @@
echo "<td>$row->companys_grau</td>";
echo "<td>$row->companys_facu</td>";
echo "</tr>";
-
+
$i = $i + 1;
}
?>