-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathhc2.php
More file actions
217 lines (213 loc) · 7.74 KB
/
Copy pathhc2.php
File metadata and controls
217 lines (213 loc) · 7.74 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
function hcheader($title,$active)
{
echo "
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<!--
____________________________________________________________
| |
| DESIGN + Pat Heard { http://fullahead.org } |
| DATE + 2005.11.30 |
| COPYRIGHT + Free use if this notice is left in place |
|____________________________________________________________|
-->
<head>
<title>$title</title>
<meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=UTF-8\" />
<meta name=\"author\" content=\"fullahead.org\" />
<meta name=\"keywords\" content=\"Open Web Design, OWD, Free Web Template, Greenery, Fullahead\" />
<meta name=\"description\" content=\"A free web template designed by Fullahead.org and hosted on OpenWebDesign.org\" />
<meta name=\"robots\" content=\"index, follow, noarchive\" />
<meta name=\"googlebot\" content=\"noarchive\" />
<link rel=\"stylesheet\" type=\"text/css\" href=\"green800.css\" media=\"screen, print\" />
</head>
<body>
";
hcheadbar($title,$active);
}
function hcheadbar($title,$active)
{
echo "
<div id=\"header\">
<div id=\"menu\">
<ul>\n
";
$clarr = array
(
'', '', '', '', '', '', '', ''
);
$clarr[$active] = ' class="active"';
$comPk=intval($_REQUEST['comPk']);
echo "<li><a href=\"index.php?comPk=$comPk\" title=\"About\"" . $clarr[0]. ">About</a></li>\n";
if (!$comPk)
{
$comPk = 1;
}
echo "<li><a href=\"submit_track.php?comPk=$comPk\" title=\"Submit\"" . $clarr[1] . ">Submit</a></li>\n";
echo "<li><a href=\"comp_result.php?comPk=$comPk\" title=\"Results\"" . $clarr[2] . ">Results</a></li>\n";
if (array_key_exists('regPk', $_REQUEST))
{
$regPk=intval($_REQUEST['regPk']);
if ($regPk > 0)
{
echo "<li><a href=\"http://highcloud.net/xc/waypoint_map.php?regPk=$regPk\" title=\"Waypoints\"" . $clarr[3] . ">Waypoints</a></li>\n";
}
//echo "<li><a href=\"track.php\" title=\"submit tracks\"" . $clarr[4] . ">Tracks</a></li>";
}
echo "</ul>\n
<div id=\"title\">
<h1>$title</h1>\n
</div>
</div>
</div>
";
}
function hcimage($link,$comPk)
{
$image = "images/pilots.jpg";
if (0+$comPk > 0)
{
$sql = "select comClass from tblCompetition where comPk=$comPk";
$result = mysqli_query($link, $sql);
if ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
$comClass = $row['comClass'];
if ($comClass != 'PG')
{
$image = "images/pilots_$comClass.jpg";
}
}
}
echo "<div id=\"image\"><img src=\"$image\" alt=\"Pilots Flying\"/></div>";
}
function hcsidebar($link)
{
echo "
<div id=\"image\"><img src=\"images/pilots.jpg\" alt=\"Pilots Flying\"/></div>
<div id=\"sideBar\">
<h1><span>Longest 10</span></h1>
<div id=\"comments\"><ol>";
$count = 1;
$sql = "SELECT T.*, P.* FROM tblTrack T, tblPilot P, tblComTaskTrack CTT where T.pilPk=P.pilPk and CTT.traPk=T.traPk order by T.traLength desc limit 10";
$result = mysqli_query($link, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
$id = $row['traPk'];
$dist = round($row['traLength']/1000,2);
$name = $row['pilFirstName'];
echo "<span class=\"author\"><a href=\"tracklog_map.php?trackid=$id&comPk=5\"><li> $dist kms ($name)</a></span>\n";
$count++;
}
echo "</ol>";
echo "
<img src=\"images/comment_bg.gif\" alt=\"comment bottom\"/>
</div>
<h1><span>Recent 10</span></h1><ol>";
$count = 1;
$sql = "SELECT T.*, P.* FROM tblTrack T, tblPilot P, tblComTaskTrack CTT where T.pilPk=P.pilPk and CTT.traPk=T.traPk order by T.traStart desc limit 10";
$result = mysqli_query($link, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
$id = $row['traPk'];
$dist = round($row['traLength']/1000,2);
//$date = $row['traDate'];
$name = $row['pilFirstName'];
echo "<a href=\"tracklog_map.php?trackid=$id&comPk=5\"><li> $dist kms ($name)</a><br>\n";
$count++;
}
echo "</ol>";
echo "<img src=\"images/comment_bg.gif\" alt=\"comment bottom\"/>
</div>\n";
}
function hcregion($link)
{
echo "<h1><span>Tracks by Region</span></h1>\n";
$sql = "select R.*, RW.* from tblRegion R, tblRegionWaypoint RW where R.regCentre=RW.rwpPk and R.regDescription not like '%test%' order by R.regDescription";
$result = mysqli_query($link, $sql);
$regions = [];
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
$regPk=$row['regPk'];
$regions[] = "<a href=\"regional.php?${piln}regPk=$regPk\">" . $row['regDescription'] . "</a>";
}
echo fnl($regions);
//echo "<img src=\"images/comment_bg.gif\" alt=\"comment bottom\"/></div>\n";
}
function hcopencomps($link)
{
echo "<h1><span>Open Competitions</span></h1>";
$sql = "select * from tblCompetition where comName not like '%test%' and comDateTo > date_sub(now(), interval 1 day) order by comDateTo";
$result = mysqli_query($link, $sql);
$comps = [];
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
// FIX: if not finished & no tracks then submit_track page ..
// FIX: if finished no tracks don't list!
$cpk = $row['comPk'];
$comps[] = "<a href=\"comp_result.php?comPk=$cpk\">" . $row['comName'] . "</a>";
}
echo fnl($comps);
}
function hcclosedcomps($link)
{
echo "<h1><span>Closed Competitions</span></h1>";
$sql = "select * from tblCompetition where comName not like '%test%' and comDateTo < date_sub(now(), interval 1 day) order by comDateTo desc";
$result = mysqli_query($link, $sql);
$comps = [];
while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
// FIX: if not finished & no tracks then submit_track page ..
// FIX: if finished no tracks don't list!
$cpk = $row['comPk'];
if ($row['comType'] == 'Route')
{
$comps[] = "<a href=\"compview.php?comPk=$cpk\">" . $row['comName'] . "</a>";
}
else
{
$comps[] = "<a href=\"comp_result.php?comPk=$cpk\">" . $row['comName'] . "</a>";
}
}
echo fnl($comps);
}
function hcfooter()
{
echo "<div id=\"footer\">
<a href=\"http://fullahead.org\" title=\"designed by fullahead.org\" class=\"fullAhead\"></a>
<p>Valid <a href=\"http://validator.w3.org/check?uri=referer\" title=\"validate XHTML\">XHTML</a> & <a href=\"http://jigsaw.w3.org/css-validator\" title=\"validate CSS\">CSS</a></p>
</div>
</div>\n";
}
function hcmapjs()
{
echo '<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAPyz1XxP2rM79ZhAH2EmgwxQ1ylNcivz9k-2ubmbv1YwdT5nh3RQJsyJo_kuVL1UAWoydxDkwo_zsKw" type="text/javascript"></script>';
echo "\n";
echo '<script src="js/elabel.js" type="text/javascript"></script>';
echo "\n";
echo '<script src="js/einsert.js" type="text/javascript"></script>';
echo "\n";
}
function hccss()
{
echo '<link rel="stylesheet" type="text/css" href="green800.css" media="screen, print" />';
echo "\n";
}
function hchead()
{
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n";
echo "<head>\n";
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>';
echo "\n";
}
function hcscripts($arr)
{
foreach ($arr as $ele)
{
echo "<script src=\"$ele\" type=\"text/javascript\"></script>\n";
}
}
?>