<?php require __DIR__ . "/../includes/config.php"; //set class $data = new ABS(); //prepare ABS class with universal variables for ERP $data->dataSetId = "ABS_ANNUAL_ERP_ASGS"; //grab the concepts $data->defaultConcepts(); // = ("FREQUENCY", "REGIONTYPE", "MEASURE","ASGS_2011",); $data->yearValue = "2014"; //SA2? if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET["SA2"])) { //SA2 unique variables $data->conceptCodes = array("A", "SA2", "ERP", $_GET["SA2"]); } else { if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET["SA3"])) { //sa3 unique variables $data->conceptCodes = array("A", "SA3", "ERP", $_GET["SA3"]); } } //Build the URL $data->getDataURL(); //grab the JSON $data->loadJSON(); //serve the JSON $data->serveJSON();
<?php require __DIR__ . "/../includes/config.php"; //set class $data = new ABS(); //prepare ABS class with universal variables for Labour Price Index $data->dataSetId = "SEIFA_POA"; //grab the concepts $data->concepts = array("MEASURE", "INDEX_TYPE", "POA"); if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET["measure"]) && isset($_GET["postcode"])) { } //escape users input $postcode = urlencode($_GET["postcode"]); //it appears that for whatever reason the ABS doesn't like the Syndey postcodes between 1000 and 1999 so this deals with that if ($postcode >= 1000 && $postcode < 2000) { $postcode = 2000; } $data->conceptCodes = array($_GET["measure"], "IRSD", $postcode); //build the URL $data->getDataURL(); //grab JSON $data->loadJSON(); //serve the JSON $data->serveJSON();
<?php require __DIR__ . "/../includes/config.php"; $test = new ABS(); $test->dataSetId = "LABOUR_PRICE_INDEX"; $test->defaultConcepts(); var_dump($test->concepts); //$test->serveJSON(); ?>