-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatchData.php
113 lines (88 loc) · 3.4 KB
/
matchData.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html>
<?php session_start();
include("header.php")?>
<body>
<?php include("navbar.php")?>
<div id="content">
<div class="container row-offcanvas row-offcanvas-left">
<div class="well column col-lg-112 col-sm-12 col-xs-12" id="content">
<h1>Match Data</h1>
<form action="" method="get">
Enter Match Number:
<input type="text" name="match" id="match" size="8">
<button id="submit" class="btn btn-primary" onclick="">Display</button>
<br>
<br>
<?php
include("databaseName.php");
$con= mysql_connect($servername, $username, $password, $dbname);
if (!$con){
die('Could not connect: ' . mysql_error());
}
//New Stuff that could potentially destroy everything 3-20-15
mysql_select_db($dbname, $con);
$result = mysql_query('select * from '.$headScoutTable.'');
$w=0;
echo('<div style="overflow-y:hidden;"><table class="sortable table table-hover" id="RawData" border="1">');
while ($row = mysql_fetch_array($result)){
if($w==0){
echo("<tr>");
foreach ($row as $key => $value){
if(!is_numeric($key)){
echo("<td>".$key."</td>");
}
}
$w++;
echo("</tr>");
}
echo("<tr>");
foreach ($row as $key => $value){
if(!is_numeric($key) and $row["matchNum"] == $_GET["match"]){
if($key == "matchNum"){
$value= '<a href="headScoutForm.php?match='.$value.'">'.$value.'</a>';
}
echo("<td align='center'>".$value."</td>");
}
}
echo("</tr>");
}
echo("</table>");
//end of new stuff
mysql_select_db($dbname, $con);
$result = mysql_query('select * from '.$matchScoutTable.'');
if (!$result){
die('Query failed: ' . mysql_error());
}
$i=0;
echo('<div><table class="table table-hover" id="RawData" border="1"></div>');
while ($row = mysql_fetch_array($result)){
if($i==0){
echo("<tr>");
foreach ($row as $key => $value){
if(!is_numeric($key)){
echo("<td>".$key."</td>");
}
}
$i++;
echo("</tr>");
}
echo("<tr>");
foreach ($row as $key => $value){
if(!is_numeric($key) and $row["matchNum"] == $_GET["match"]){
if($key == "matchNum"){
$value= '<a href="matchData.php?match='.$value.'">'.$value.'</a>';
}
echo("<td align='center'>".$value."</td>");
}
}
echo("</tr>");
}
echo("</table>");
?>
</div>
</div>
</div>
</body>
</html>
<?php include("footer.php") ?>