This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class app { | |
public function RunHooks($hook, $value = NULL) { | |
global $x_events; | |
if (isset($x_events[$hook])) { | |
foreach($x_events[$hook] as $function) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Main index.php, could be combined with router to add hooks to entire site. | |
// https://jroffey.me | |
$x_events = array(); | |
global $x_events; | |
//Include App Class & create variable. | |
require("app.class.php"); | |
$app = new app(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Calculate the distance between 2 coordinates | |
* By James Roffey - https://jroffey.me | |
*/ | |
function distance($start, $last){ | |
$theta = $start[1] - $end[1]; | |
$dist = sin(deg2rad($start["0"])) * sin(deg2rad($last[0])) + cos(deg2rad($start[0])) * cos(deg2rad($last[0])) * cos(deg2rad($theta)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Calculate the distance between 2 coordinates | |
* By James Roffey - https://jroffey.me | |
*/ | |
if(isset($_GET["lat"]) && isset($_GET["lon"])){ | |
$pickup = array($_GET["lat"], $_GET["lon"]); | |
$taxis = array( | |
0 => array ('id' => '1','driverid' => '1','lat' => '51.873675','lon' => '0.544403','online' => '1','number_plate' => 'FE07 RAB'), |