-
Notifications
You must be signed in to change notification settings - Fork 0
/
PersonalJob_Speaks.php
44 lines (42 loc) · 1.3 KB
/
PersonalJob_Speaks.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
<?php
session_start();
$TName = $_SESSION["TName"];
//export.php
$connect = mysqli_connect("localhost", "root", "password", "dbtournament");
$output = '';
$query = "SELECT * FROM wins ORDER BY Wins DESC, Margins DESC, TotalScore DESC";
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0) {
$output .= '
<table class="table" bordered="1">
<tr>
<th>Position</th>
<th>TeamName</th>
<th>Wins</th>
<th>Margins</th>
<th>TotalScore</th>
</tr>
';
$i = 0;
while($row = mysqli_fetch_array($result))
{
$i = $i +1;
$output .= '
<tr>
<td>'.($i).'</td>
<td>'.$row["TeamName"].'</td>
<td>'.$row["Wins"].'</td>
<td>'.$row["Margins"].'</td>
<td>'.$row["TotalScore"].'</td>
</tr>
';
}
$output .= '</table>';
header('Content-Type: application/xls');
header('Content-Disposition: attachment; filename=Breaks.xls');
echo $output;
}
if (isset($_POST["btnGo"])) {
header("Location:PersonalJob_Speaks");
}
?>