PHP Fucked?

This commit is contained in:
Fred Boniface 2022-11-26 20:42:40 +00:00
parent 850aa66d80
commit bac8e50363
3 changed files with 70 additions and 6 deletions

65
eg.php Normal file
View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>TESTING</title>
</head>
<body>
<?php
require './php/openLDBWS.php';
require './php/submitIssue.php';
require '/srv/keys/athena/apiKeys.php';
echo cleanInput($_SERVER['QUERY_STRING']);
date_default_timezone_set("Europe/London");
$OpenLDBWS = new OpenLDBWS($ldbKey);
$response = $OpenLDBWS->GetDepartureBoardByCRS(10,"BRI",date("H:i:s",time()),120,"","","","","True");
$template["header"] = "
<table>
<thead>
<tr>
<th>ID</th>
<th>Org.</th>
<th>Dest.</th>
<th>Plat.</th>
<th>Sch</th>
<th>Exp</th>
</tr>
</thead>
<tbody>
";
$template["row"] = "
<tr>
<td>{id}</td>
<td>{org}</td>
<td>{dest}</td>
<td>{plat}</td>
<td>{sch}</td>
<td>{act}</td>
</tr>
";
$template["footer"] = "
</tbody>
</table>
";
if (isset($response->GetBoardResult->trainServices->service))
{
print $template["header"];
foreach($response->GetBoardResult->trainServices->service as $service)
{
$row = $template["row"];
$destinations = array();
$row = str_replace("{id}",$service->trainid,$row);
$row = str_replace("{org}",$service->origin->location->tiploc,$row);
$row = str_replace("{dest}",$service->destination->location->tiploc,$row);
$row = str_replace("{plat}",$service->platform,$row);
$row = str_replace("{sch}",$servoce->std,$row);
$row = str_replace("{act}",$service->etd,$row);
print $row;
}
print $template["footer"];
}
?>
</body>
</html>

View File

@ -2,6 +2,5 @@
include("./php/OpenLDBWS.php"); include("./php/OpenLDBWS.php");
include("/srv/keys/athena/apiKeys.php"); include("/srv/keys/athena/apiKeys.php");
$OpenLDBWS = new OpenLDBWS($ldbKey); $OpenLDBWS = new OpenLDBWS($ldbKey);
$response = $OpenLDBWS->GetDepartureBoard(10,"PAD"); $response = $OpenLDBWS->GetArrDepBoardWithDetails(10,BRI,getNonPassengerServices="TRUE");
header("Content-Type: text/plain"); echo $response
print_r($response);

View File

@ -5,15 +5,15 @@
</head> </head>
<body> <body>
<?php <?php
require './php/openLDBSVWS.php'; require './php/openLDBWS.php';
require './php/submitIssue.php'; require './php/submitIssue.php';
require '/srv/keys/athena/apiKeys.php'; require '/srv/keys/athena/apiKeys.php';
echo cleanInput($_SERVER['QUERY_STRING']); echo cleanInput($_SERVER['QUERY_STRING']);
date_default_timezone_set("Europe/London"); date_default_timezone_set("Europe/London");
$OpenLDBSVWS = new OpenLDBSVWS($ldbKey); $OpenLDBWS = new OpenLDBWS($ldbKey);
$response = $OpenLDBSVWS->GetDepartureBoardByCRS(10,"BRI",date("H:i:s",time()),120,"","","","","True"); $response = $OpenLDBWS->GetDepartureBoardByCRS(10,"BRI",date("H:i:s",time()),120,"","","","","True");
$template["header"] = " $template["header"] = "
<table> <table>
<thead> <thead>