<?php
/*
(c) copyright 2011 nadlabs.co.uk. All rights reserved.
Please read the full text of the nl-DFLA-mini licence for this software at
http://www.nadlabs.co.uk/licence.php
*/
require_once("../../config/config_mini.php");
require_once("../../includes/bootstrap_mini.php");
require_once("../../includes/lightwork_mini_smlm.php");
session_start();
$postList = array("id","type","days");
if (globalIsSet($_POST,$postList)){
$elementid = globalMagic($_POST['id']);
$type = globalMagic($_POST['type']);
$days = globalMagic($_POST['days']);
//$days = ($days < 0 || $days >365)?0:$days;
smlm::trackstat($elementid,$type); //ignore response unless you want to log failures
$dataArray = smlm::get_stats($elementid,$type,$days);
}
else{
// log failure of post data if you want
$dataArray = array("Ack"=>"fail", "Msg"=>"Oops. Refesh the page and try again.");
}
echo json_encode($dataArray);
?>