-
Notifications
You must be signed in to change notification settings - Fork 0
/
currentscores.php
executable file
·85 lines (69 loc) · 2.15 KB
/
currentscores.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php session_start();
$sql = "select count(contactid) as contactcnt from ospotalog";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$totalcontacts = $row["contactcnt"];
}
$sql = "select count(distinct parkid) as parkcnt from ospotalog where parkid <> 76";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
if ($row["parkcnt"] == 0) {
$totalparks = 0;
} else {
$totalparks = $row["parkcnt"];
}
}
$sql = "select count(distinct stateid) as statecnt from ospotalog where stateid <> 52";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$totalstates = $row["statecnt"];
}
$sql = "select cabrillo from ospotasettings";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$submittedcabrillo = $row["cabrillo"];
}
echo "<b>Current Statistics</b><br>";
echo "<table border = 1 cellpadding = 15>";
echo "<tr><td>";
echo "<b>Total Contacts: </b>" . $totalcontacts;
echo "<br>";
echo "<b>Total Parks Worked: </b> " . $totalparks . "<br>";
echo "<b>Total States/DX Worked: </b> " . $totalstates;
echo "<br><br>";
echo "<b>Current QSO Score:</b> " . $totalcontacts . "<br>";
echo "<b>Current Multiplier Points:</b> ". $totalparks . "<br>";
echo "<b>Cabrillo Submission?:</b> ";
switch ($submittedcabrillo){
case 1:
$bonuspoints = 25;
break;
default:
$bonuspoints = 0;
break;
}
echo $bonuspoints;
echo "<br><br>";
$totalpoints = ($totalcontacts * ($totalparks+1)) + $bonuspoints;
echo "<b>Total Points:</b> " . $totalpoints . "<br>";
echo "<br>";
$sql = "select count(contactid) as contactcnt, sysbands.band from ospotalog ol join sysbands on ol.bandid=sysbands.sysbandsid group by ol.bandid";
$result = $conn->query($sql);
echo "<b>Total Contacts by Band: </b><br>";
echo "<center>";
echo "<table border=1>";
echo "<tr>";
echo "<th>Band</th><th>Count</th>";
echo "</tr>";
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["band"] . "</td>";
echo "<td>" . $row["contactcnt"] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "</center>";
echo "<br>";
echo "</td></tr>";
echo "</table>";
?>