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); }
function sendStatGraphDay() { global $xaxislabels, $inContinuation; if (!$inContinuation) { return; } $start = getContinuationVar("start"); $end = getContinuationVar("end"); $affilid = getContinuationVar("affilid"); $graphdata = getStatGraphDayData($start, $end, $affilid); $count = count($graphdata["labels"]); if ($count < 8) { $labelinterval = 1; } else { $labelinterval = $count / 7; } $xaxislabels = $graphdata["labels"]; $graph = new Graph(300, 300, "auto"); $graph->SetScale("textlin"); $plot = new BarPlot($graphdata["points"]); $graph->Add($plot); $graph->xaxis->SetLabelFormatCallback('statXaxisDayCallback'); $graph->xaxis->SetLabelAngle(90); $graph->xaxis->SetTextLabelInterval($labelinterval); $graph->yaxis->SetTitle('Reservations with start time on given day', 'high'); $graph->SetMargin(40, 40, 20, 80); $graph->Stroke(); }