forked from SimonT-STHS/STHS-DynamicWebsite-Production
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLegacyPages.php
49 lines (43 loc) · 1.52 KB
/
LegacyPages.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
<?php include "Header.php";
$Title = (string)"";
$Number = (integer)0;
$HTML = (string)"";
If (file_exists($DatabaseFile) == false){
Goto STHSErrorLegacyPages;
}else{try{
$db = new SQLite3($DatabaseFile);
$Query = "Select Name from LeagueGeneral";
$LeagueGeneral = $db->querySingle($Query,true);
$LeagueName = $LeagueGeneral['Name'];
if(isset($_GET['Number'])){$Number = filter_var($_GET['Number'], FILTER_SANITIZE_NUMBER_INT);}
If ($Number > 0){
If (file_exists($LegacyHTMLDatabaseFile) == false){
echo "<title>" . $DatabaseNotFound . "</title>";
$GameHTML = "<h1>" . $DatabaseNotFound . "</h1>";
}else{
$Legacydb = new SQLite3($LegacyHTMLDatabaseFile);
$Query = "Select * from LegacyPage WHERE Number = '" . $Number . "'";
$Result = $Legacydb ->querySingle($Query,true);
If ($Result != Null){
echo "<title>" . $LeagueName . " - " . $Result['Title'] . "</title>";
$HTML = gzdecode(base64_decode($Result['HTML']));
}else{
echo "<title>" . $IncorrectLegacyPagesQuery . "</title>";
$HTML = "<h1>" . $IncorrectLegacyPagesQuery . "</h1>";
}
}
}else{
echo "<title>" . $IncorrectLegacyPagesQuery . "</title>";
$HTML = "<h1>" . $IncorrectLegacyPagesQuery . "</h1>";
}
} catch (Exception $e) {
STHSErrorLegacyPages:
$LeagueName = $DatabaseNotFound;
echo "<title>" . $DatabaseNotFound . "</title>";
$HTML = "<h1>" . $DatabaseNotFound . "</h1>";
}}?>
</head><body>
<?php
include "Menu.php";
echo($HTML);
include "Footer.php";?>