diff --git a/www/where/index.php b/www/where/index.php index 64ab742..5ad22c8 100644 --- a/www/where/index.php +++ b/www/where/index.php @@ -1,5 +1,5 @@ array( 'method' => 'GET', @@ -18,6 +18,18 @@ echo json_encode($output['device_tracker.jasonsphone_jason']); exit(); + elseif (isset($_GET["calendar"])): + $options = array( + 'http' => array( + 'header' => 'Host: internal.jnf.me' + ) + ); + + $context = stream_context_create($options); + + header('Content-Type: application/json'); + echo file_get_contents("http://192.168.0.25/public/pages/display/calendar.php?location", false, $context); + else: ?> @@ -60,7 +72,7 @@ }); function updateLocation() { - $.getJSON('?data', function(data) { + $.getJSON('?location', function(data) { $('h1').html((data.state == 'not_home') ? 'Nobody Knows' : 'At ' + data.state.replace(/^\w/, c => c.toUpperCase())); var locLive = new google.maps.LatLng(data.attributes.latitude, data.attributes.longitude); map.setCenter(locLive);