/
location.php
111 lines (96 loc) · 2.83 KB
/
location.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
<!DOCTYPE HTML>
<html>
<head>
<title>PokeGuide</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Condensed' rel='stylesheet' type='text/css'>
<script src="js/jquery.min.js"></script>
<script src="js/config.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-panels.min.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel-noscript.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<link rel="stylesheet" href="cssmain/table.css" />
<!--[if lte IE 9]><link rel="stylesheet" href="css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]-->
</head>
<body>
<!-- ********************************************************* -->
<div id="header-wrapper">
<div class="container">
<div class="row">
<div class="12u">
<?php require 'topMenubar.php';?>
</div>
</div>
</div>
</div>
<div id="main">
<div class="container">
<div class="row main-row">
<div class="12u">
<h2 style='text-align:center;'>List of Locations</h2>
<form name="input" action="location.php" method="get">
Location: <input type="text" name="location">
<input type="submit" value="search">
</form>
<br>
<?php
//SEARCH
$location = strtolower($_GET["location"]);
if($location != null){
//$pokemon = ucfirst($_POST["pokemon"]);
$locations = array_map('ucfirst', explode(" " , $location));
$location = implode(" " , $locations);
$result = executePlainSQL("SELECT * FROM location WHERE lname = '" . $location . "' OR lname LIKE '%" . $location . "%'");
}
else{
$result = executePlainSQL("SELECT * FROM location");
}
printLocation($result);
//Print result
function printLocation($result){
echo "<div class='Pokeguide'>";
echo '<table>';
echo '<tr><td>Location</td><td>Description</td></tr>';
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
if((strpos($row[0],'Evolve') === false) and (strpos($row[0],'LName') === false)){
echo '<tr>';
echo '<td>' . $row[0] . '</td>';
echo '<td>' . $row[1] . '</td>';
echo '</tr>';
}
}
echo "</table>";
echo "</div>";
}
?>
</div>
</div>
</div>
</div>
<div id="footer-wrapper">
<div class="container">
<div class="row">
<div class="8u">
</div>
<div class="4u">
</div>
</div>
<div class="row">
<div class="12u">
<div id="copyright">
© CS304 - PokeGuide. All rights reserved. | Design: HTML5 UP | Images: fotogrph
</div>
</div>
</div>
</div>
</div>
<!-- ********************************************************* -->
</body>
</html>