Example #1
0
function AJgetStatData()
{
    $start = getContinuationVar("start");
    $end = getContinuationVar("end");
    $affilid = getContinuationVar("affilid");
    $divid = getContinuationVar('divid');
    $mode = getContinuationVar('mode');
    $provid = getContinuationVar('provid');
    if ($divid == 'resbyday') {
        $data = getStatGraphDayData($start, $end, $affilid, $mode, $provid);
    } elseif ($divid == 'maxconcurresday') {
        $data = getStatGraphDayConUsersData($start, $end, $affilid, $mode, $provid);
    } elseif ($divid == 'maxconcurbladeday') {
        $data = getStatGraphConBladeUserData($start, $end, $affilid, $mode, $provid);
    } elseif ($divid == 'maxconcurvmday') {
        $data = getStatGraphConVMUserData($start, $end, $affilid, $mode, $provid);
    } elseif ($divid == 'resbyhour') {
        $data = getStatGraphHourData($start, $end, $affilid, $mode, $provid);
    } elseif (preg_match('/^resbyday/', $divid)) {
        $data = getStatGraphDayData($start, $end, $affilid, $mode, $provid);
    } elseif (preg_match('/^maxconcurresday/', $divid)) {
        $data = getStatGraphDayConUsersData($start, $end, $affilid, $mode, $provid);
    } elseif (preg_match('/^maxconcurbladeday/', $divid)) {
        $data = getStatGraphConBladeUserData($start, $end, $affilid, $mode, $provid);
    } elseif (preg_match('/^maxconcurvmday/', $divid)) {
        $data = getStatGraphConVMUserData($start, $end, $affilid, $mode, $provid);
    }
    $data['id'] = $divid;
    sendJSON($data);
}
Example #2
0
function sendStatGraphHour()
{
    global $xaxislabels, $inContinuation;
    if (!$inContinuation) {
        return;
    }
    $start = getContinuationVar("start");
    $end = getContinuationVar("end");
    $affilid = getContinuationVar("affilid");
    $graphdata = getStatGraphHourData($start, $end, $affilid);
    $graph = new Graph(300, 300, "auto");
    $graph->SetScale("textlin");
    $plot = new LinePlot($graphdata["points"]);
    $graph->Add($plot);
    $graph->xaxis->SetLabelFormatCallback('statXaxisHourCallback');
    $graph->xaxis->SetLabelAngle(90);
    $graph->xaxis->SetTextLabelInterval(2);
    $graph->yaxis->SetTitle('Active reservations during given hour', 'high');
    $graph->SetMargin(40, 40, 20, 80);
    $graph->Stroke();
}