-
Notifications
You must be signed in to change notification settings - Fork 1
/
pitData.php
150 lines (137 loc) · 4.15 KB
/
pitData.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Stronghold - 2016</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" type="image/png" href="../img/favicon-128.png" sizes="128x128" />
<!-- Custom CSS -->
<link href="css/disableXScroll.css" rel="stylesheet">
<link href="css/sheet.css" rel="stylesheet">
<link href="css/global.css" rel="stylesheet">
<link href="css/navbar.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<style>
input[type=text] {
background-color: #000;
color: #fff;
padding-left:10px;
width: 100%;
height: 100%;
text-align: center;
}
input[type=button], input[type=text]{
border: 0;
}
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
#footer {
background: #fff;
line-height: 2;
text-align: right;
color: #042E64;
font-size: 30px;
font-family: sans-serif;
font-weight: bold;
}
</style>
</head>
<body>
<nav class="navbar navbar-default" style="margin-bottom:0px;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Sandman</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="../index.html">Home <span class="sr-only">(current)</span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Scouting <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="sheets/2016global.html">Game Scouting</a></li>
<li><a href="sheets/2016globalpit.html">Pit Scouting</a></li>
</ul>
</li>
<li><a href="../report3.php">Results </a></li>
<li class="active"><a href="../removePage.php">DB Managment</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<br>
<form action="../php/searchPit.php" method="post">
<div class="container">
<div class="row">
<div class="col-md-4">
<h3 style="text-align: right;">Search a team # or Category</h3>
</div>
<div class="col-md-4" style="height:57px">
<input class="textBox" id="searchtb" type="text" maxlength="20" name="input"/>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-danger btn-lg" style="width:100%">Submit</button>
</div>
</div>
</div>
<?php
$con=mysqli_connect("localhost","data","mxwZsnKw5FtD8uX8","sandman");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//$result = mysqli_query($con,"SELECT * FROM `matchdata`");
$result = mysqli_query($con, "SELECT * FROM `pitdata` ORDER BY id DESC");
echo "<div class='container' style='width:90%'><table align='center' class='table table-striped'>
<thead>
<tr>
<th>ID</th>
<th>Team #</th>
<th>Category</th>
<th>Comments</th>
</tr>
</thead><tbody>";
while($row = mysqli_fetch_array($result))
{
$cat = "NULL";
if ($row['category'] == 0) {
$cat = "Robust";
}
if ($row['category'] == 1) {
$cat = "Sensitive";
}
if ($row['category'] == 2) {
$cat = "Defense";
}
if ($row['category'] == 3) {
$cat = "Low Goal Cycle";
}
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['teamnum'] . "</td>";
echo "<td>" . $cat . "</td>";
echo "<td>" . $row['notes'] . "</td>";
echo "</tr>";
}
echo "</tbody></table></div>";
mysqli_close($con);
?>
</form>
</body>
</html>