-
Notifications
You must be signed in to change notification settings - Fork 0
/
nesen.php
67 lines (62 loc) · 2.03 KB
/
nesen.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
<?php
include_once("data.inc.php");
include_once("function.inc.php");
?>
<table width="680" border="1" class="reference" align="center">
<thead>
<tr>
<th width="30">Nr.</th>
<th width="150">Dalībnieks</th>
<th width="70">Dz. gads</th>
<th width="50">Grupa</th>
<th width="65">Starts</th>
<th width="65">Finišs</th>
<th width="70">Rezultāts</th>
<th>Komentārs</th>
</tr>
</thead>
<tbody class="scrollingContent">
<?php
//Pieslēdzamies MySQL
mysql_connect($host, $user, $pass);
mysql_select_db($dbName);
mysql_set_charset('utf8');
$act = $_GET['act'];
if(isset($act)) {
if ($act == "fin")
$query = "SELECT Numurs, Vards, Starts, Finiss, Grupa, Gads, Komentars FROM registracija WHERE Finiss != '' ORDER BY Finiss DESC LIMIT 0,10";
if ($act == "sta")
$query = "SELECT Numurs, Vards, Starts, Finiss, Grupa, Gads, Komentars FROM registracija WHERE Starts != '' ORDER BY Starts DESC LIMIT 0,10";
if ($act == "apg")
$query = "SELECT Numurs, Vards, Starts, Apgrieziens, Grupa, Gads, Komentars FROM registracija WHERE Apgrieziens != '' ORDER BY Apgrieziens DESC LIMIT 0,10";
}
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
if ($row['Starts'] != 0) { $starts = strTime($row['Starts']); }
if ($row['Starts'] == 0) { $starts = ""; }
if ($row['Finiss'] != 0) { $finiss = strTime($row['Finiss']); }
if ($row['Finiss'] == 0) { $finiss = ""; }
if (isset($act)) {
if ($act == 'apg') {
$rezultats = strTime($row['Apgrieziens']-$row['Starts']);
} else {
$rezultats = strTime($row['Finiss']-$row['Starts']);
}
}
echo "
<tr>
<td>".$row['Numurs']."</td>
<td><a href=\"javascript:info('".$row['Numurs']."')\">".$row['Vards']."</a></td>
<td>".$row['Gads']."</td>
<td>".$row['Grupa']."</td>
<td>".$starts."</td>
<td>".$finiss."</td>
<td>".$rezultats."</td>
<td>".$row['Komentars']."</td>
</tr>
";
}
mysql_close();
?>
</tbody>
</table>