-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclubs.php
67 lines (52 loc) · 1.9 KB
/
clubs.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
<?php
$where="";
$header="";
if (isset($_GET['lid'])) {
$lid=$_GET['lid'];
$where=$where." tbl_clubs.club_league = ".$lid." and ";
$subset="league";
$header='<ul class="rounded"><li>'.str_replace("'","",$lid).'</li></ul>';
$back="leagues";
}
if (isset($_GET['vnm'])) {
$vnm=$_GET['vnm'];
$where=$where." tbl_venues.venue = ".$vnm." and ";
$subset="venue_name";
$header='<ul class="rounded"><li>'.str_replace("'","",$vnm).'</li></ul>';
$back="venue_details.php?vnm='".$vnm."'";
}
if (isset($_GET['vid'])) {
$vid=$_GET['vid'];
$back="venue_details.php?vid='".$vid."'";
}
$title="Clubs";
include("head.php");
if (isset($_GET['vid'])) {
$get_sql = "SELECT * FROM tbl_venues where venue_id = $vid";
$get_results = mysql_query($get_sql,$cn) or die(mysql_error());
$get_row = mysql_fetch_array($get_results);
$vnm = "'".$get_row['venue']."'";
$where=$where." tbl_venues.venue = $vnm and ";
$subset="venue_name";
$header='<ul class="rounded"><li>'.str_replace("'","",$vnm).'</li></ul>';
}
if (strlen($where)>0) {
$where=" WHERE ".substr($where, 0, -5);
}
print $header;
print '<ul class="rounded">';
$get_sql = "SELECT distinct tbl_clubs.club_name, tbl_clubs.summary_name FROM tbl_clubs
INNER JOIN tbl_club_venues ON tbl_club_venues.club_reference = tbl_clubs.club_reference
INNER JOIN tbl_venues ON tbl_club_venues.venue_id = tbl_venues.venue_id
INNER JOIN tbl_week_days ON tbl_club_venues.day_id = tbl_week_days.day_id"
.$where." ORDER BY tbl_clubs.club_name";
$get_results = mysql_query($get_sql,$cn) or die(mysql_error());
while ($get_row = mysql_fetch_array($get_results)) {
$name = $get_row['club_name'];
$summary_name = $get_row['summary_name'];
$link = "club_details.php?snm=".$summary_name;
print '<li><a href="'.$link.'" target="_webapp">'.$name.'</a></li>';
}
print '</ul>';
include("foot.php");
?>