-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch_match.php
96 lines (73 loc) · 3.54 KB
/
search_match.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
<?php
include("include/adminheader.php");
?>
<?php
echo("<h1 style= \"text-align: center\">Matches Of the League</h1><br><br><br>");
echo("
<form \"form-search\" action=\"search_match.php\" method=\"post\" >
<div class=\"input-append\" style=\" float:right; margin-bottom:5px;\">
<select name=\"catagory\" class=\"btn\" style=\"background: black;color: white; width: 140px\">
<option value=\"h.club_name\" >Home Club</option>
<option value=\"a.club_name\">Away Club</option>
<option value=\"stadium_name\">Stadium Name</option>
<option value=\"pfirst_name||' '||plast_name\">Man of Match</option>
</select>
<input name=\"param\" class=\"span2\" id=\"appendedInputButtons\" type=\"text\" style=\"background: black;color: white;\" required>
<button class=\"btn\" type=\"submit\" style=\"background: black;color: white;\">GO!</button>
</div>
</form>");
$att = $_POST["catagory"];
$src= $_POST["param"];
$db = oci_connect('system','1234','xe');
$sql="select
match_id,
h.club_id,
h.club_name,
a.club_id,
a.club_name,
match_date,
match_time,
stadium_name,
(pfirst_name ||' '|| plast_name) as name,
home_score,
away_score
from matches
join stadiums on matches.stadium_id = stadiums.stadium_id
join clubs h on matches.home_id = h.club_id
join clubs a on matches.away_id = a.club_id
join players on players.player_id = matches.mom_id
where {$att} like '%{$src}%'";
$result=oci_parse($db,$sql);
oci_execute($result);
//echo $result;
echo ("<table class = \"table table-bordered\" style= \"background: black;color:white; border-radius:10px\" >");
echo " <tr>
<th>Match ID</a></th>
<th>Home Club</a></th>
<th>Away Club</a></th>
<th>Stadium</a></th>
<th>Home Score</a></th>
<th>Away Score</a></th>
<th>Match Date</a></th>
<th>Match Time</a></th>
<th>Man of Match</a></th>
</tr>";
while($row=oci_fetch_array($result))
{
echo "<tr>
<td><a href=\"club_details.php?id={$row[0]}\"> {$row[0]} </a></td>
<td> {$row[2]}</td>
<td> {$row[4]}</td>
<td> {$row[7]}</td>
<td> {$row[9]}</td>
<td> {$row[10]}</td>
<td> {$row[5]}</td>
<td> {$row[6]}</td>
<td> {$row[8]}</td>
</tr>";
}
echo "</table>";
?>
<?php
include("include/adminfooter.php");
?>