Browse Source

prevent invalid states. highlight calls on score table (mouse over)

master
Fabian Kurz 2 years ago
parent
commit
5eecd0d1b7
  1. 26
      functions.php

26
functions.php

@ -573,6 +573,10 @@ function parse_adif($adif, $members, $ign, $startdate) {
$qso['was'] = "";
}
if ($qso['was'] == "--") {
$qso['was'] = "";
}
# finally, some hard-coded exceptions:
if ($qso['call'] == "K7SV") {
$qso['waz'] = 5;
@ -971,7 +975,7 @@ function score_table() {
echo "<table><tr><th>Call</th><th>ACA</th><th>CMA</th></tr>\n";
while ($r = mysqli_fetch_row($q)) {
if ($r[0] != "TEST") {
echo "<tr><td>$r[0]</td><td class='score'>$r[1]</td><td class='score'>$r[2]</tr>\n";
echo "<tr><td onmouseout=\"hlcall('$r[0]', 0);\" onmouseover=\"hlcall('$r[0]', 1);\" name=\"$r[0]\">$r[0]</td><td class='score'>$r[1]</td><td class='score'>$r[2]</tr>\n";
}
}
echo "</table>";
@ -982,11 +986,29 @@ function score_table() {
$q = mysqli_query($db, "select cwops_users.callsign as callsign, cwops_scores.$i as $i from cwops_users inner join cwops_scores on cwops_users.id = cwops_scores.uid order by $i desc;");
echo "<table><tr><th>Call</th><th>".strtoupper($i)."</th></tr>\n";
while ($r = mysqli_fetch_row($q)) {
echo "<tr><td>$r[0]</td><td class='score'>$r[1]</td></tr>\n";
echo "<tr><td onmouseout=\"hlcall('$r[0]', 0);\" onmouseover=\"hlcall('$r[0]', 1);\" name=\"$r[0]\">$r[0]</td><td class='score'>$r[1]</td></tr>\n";
}
echo "</table>";
}
echo "</div>";
?>
<script>
function hlcall(c, o) {
var el = document.getElementsByName(c);
for (var i = 0; i < el.length; i++) {
if (o) {
el[i].style.background = "LightGreen";
}
else {
el[i].style.background = "White";
}
}
}
</script>
<?
}

Loading…
Cancel
Save