Exemplo n.º 1
0
}
// create image
$ImageHandle = CreateImageHandle($width, $height);
$arrX = array();
// data points X
$arrY = array();
// data points Y
$arrayX = array();
// axis X
$arrayY = array();
// axis Y
/******************************************************
			Get data
*******************************************************/
$arF = array("COUNTRY_ID" => $find_country_id, "DATE1" => $find_date1, "DATE2" => $find_date2);
$arrDays = CCity::GetGraphArray($arF, $arrLegend, $find_data_type, 20);
reset($arrDays);
while (list($keyD, $arD) = each($arrDays)) {
    $date = mktime(0, 0, 0, $arD["M"], $arD["D"], $arD["Y"]);
    $date_tmp = 0;
    $next_date = AddTime($prev_date, 1, "D");
    if ($date > $next_date && intval($prev_date) > 0) {
        $date_tmp = $next_date;
        while ($date_tmp < $date) {
            $arrX[] = $date_tmp;
            reset($arrLegend);
            while (list($keyL, $arrL) = each($arrLegend)) {
                $arrY_data[$keyL][] = 0;
                $arrY[] = 0;
            }
            $date_tmp = AddTime($date_tmp, 1, "D");
Exemplo n.º 2
0
    } else {
        $find_data_type = "SESSIONS";
    }
} elseif ($saved_group_by != $find_data_type) {
    //Set if changed
    $saved_group_by = $find_data_type;
}
InitFilterEx($arSettings, $sTableID . "_settings", "set");
$arrDays = array();
AdminListCheckDate($lAdmin, array("find_date1" => $find_date1, "find_date2" => $find_date2));
$arrLegend = array();
$arrTotalLegend = array();
$arFilter = array("COUNTRY_ID" => $find_country_id < 0 ? "" : $find_country_id, "DATE1" => $find_date1, "DATE2" => $find_date2);
if (strlen($arFilter["COUNTRY_ID"]) == 2) {
    $arrDays = CCity::GetGraphArray($arFilter, $arrLegend, $find_data_type, 20);
    $arrTotalDays = CCity::GetGraphArray($arFilter, $arrTotalLegend, "TOTAL_" . $find_data_type, 20);
} else {
    $lAdmin->AddFilterError(GetMessage("STAT_NO_COUNTRY_ID"));
}
$lAdmin->BeginCustomContent();
if (!function_exists("ImageCreate")) {
    ShowError(GetMessage("STAT_GD_NOT_INSTALLED"));
} else {
    $width = COption::GetOptionString("statistic", "GRAPH_WEIGHT");
    $height = COption::GetOptionString("statistic", "GRAPH_HEIGHT");
    $diameter = COption::GetOptionString("statistic", "DIAGRAM_DIAMETER");
    $found = false;
    foreach ($arrLegend as $key => $val) {
        if ($val[$find_data_type] > 0) {
            $found = true;
            break;