This repository has been archived by the owner on Sep 5, 2021. It is now read-only.
forked from avs-code/PREM-Podium-race-E-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsim_results.php
45 lines (45 loc) · 1.44 KB
/
sim_results.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
<? if (!defined("CONFIG"))
exit();
if ($simresultID = intval($_GET['sres']))
$sim_results = "SELECT simresults_url FROM sim_results WHERE `id` = '$simresultID' LIMIT 1";
else
$sim_results = "SELECT `sim_results`.`id`, `sim_results`.`race_name` , `season`.`name` AS season_name, `sim_results`.`simresults_url` FROM sim_results LEFT JOIN season ON `sim_results`.`season` = `season`.`id` ORDER BY `season`.`name`, `sim_results`.`id` ASC LIMIT 0 , 30";
require_once("functions.php"); // import mysql function
$link = mysqlconnect(); // call mysql function to get the link to the database
$result = mysqli_query($link,$sim_results);
if (!$result) {
show_error("MySQL Error: " . mysqli_error($link) . "\n");
return;
}
?>
<h1>Simresults</h1>
<?php
if ($simresultID) {
$sitem = mysqli_fetch_array($result);
?>
<h2><a href="?page=sim_results">↞ Go back</a></h2>
<iframe src="<?=$sitem['simresults_url'];?>" width="100%" height="600px"></iframe>
<?php
return;
}
?>
<div class="w3-container">
<table class="w3-table-all">
<tr class="w3-dark-grey">
<td><h1>Name</h1></td>
<td><h1><strong>Season</strong></h1></td>
<td><h1>Simresults_URL</h1></td>
</tr>
<?
while ($sitem = mysqli_fetch_array($result)) {
?>
<tr class="w3-hover-green">
<td><?= $sitem['race_name'] ?></td>
<td><?= $sitem['season_name'] ?></td>
<td><a href="?page=sim_results&sres=<?=$sitem['id'];?>">simresults</a></td>
</tr>
<?
}
?>
</table>
</div>