/
items.php
executable file
·105 lines (94 loc) · 2.9 KB
/
items.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
<!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;'>Table of Items</h2>
<form name="search" action="items.php" method="post">
Search Items: <input type="text" name="item"> with
<select id = "options" name = "options">
<option value= "IID"> IID</option>
<option value= "Type"> Type </option>
<option value= "Description"> Description </option>
</select>
<input type="submit" value="search">
</form>
<br>
<?php
if(isset($_POST['item'])){
$item = $_POST ['options'];
// echo $item;
}
$item = ucfirst(strtolower($_POST["item"]));
if($item !==null){
$result = executePlainSQL("SELECT * FROM item WHERE type = '" . $item . "' OR iid = '" . $item ."' OR Description LIKE '%" . $item . "%'");
}else{
$result = executePlainSQL("SELECT * FROM item");
}
printItem($result);
function printItem($result){
echo "<div class='Pokeguide'>";
echo "<table>";
echo "<tr><td>IID</td><td>Type</td><td>Description</td></tr>";
while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td></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>