Exemple #1
0
<?php

include_once "../../includes/basics/basics.inc";
?>
<link href="<?php 
echo HOME_URL;
?>
includes/ecss/getsvgimage.css" media="all" rel="stylesheet" type="text/css" />
<?php 
if (!empty($_GET['find_result'])) {
    if (!empty($_GET['query_v']) && !empty($_GET['chart_label']) && !empty($_GET['chart_value'])) {
        $svgimg = new getsvgimage();
        $result = $result1 = dbObject::find_by_sql($_GET['query_v']);
        $chart_label = str_replace('.', '__', $_GET['chart_label']);
        $chart_value = str_replace('.', '__', $_GET['chart_value']);
        $chart_name = !empty($_GET['chart_name']) ? $_GET['chart_name'] : 'Custom View Chart';
        $chart_width = !empty($_GET['chart_width']) ? $_GET['chart_width'] : '450';
        $chart_height = !empty($_GET['chart_height']) ? $_GET['chart_height'] : '450';
        $chart_type = !empty($_GET['chart_type']) ? $_GET['chart_type'] : 'clustered_column';
        $legend_name = !empty($_GET['chart_legend']) ? $_GET['chart_legend'] : '';
        $legend_name = str_replace('.', '__', $legend_name);
        //getSvgData($result, $legend_name, $chart_label, $chart_value, $legend, $labels, $data);
        $svgimg->setProperty('_chart_name', $chart_name);
        $svgimg->setProperty('_chart_width', $chart_width);
        $svgimg->setProperty('_chart_height', $chart_height);
        $svgimg->setProperty('_chart_type', $chart_type);
        $svgimg->result = $result;
        $svgimg->legend_name = $legend_name;
        $svgimg->chart_label = $chart_label;
        $svgimg->chart_value = $chart_value;
        $svg_chart = $svgimg->getSvgChart_forView();
Exemple #2
0
        $program_name = $_POST['program_name'][0];
        if (!empty($_POST['download_as_text'])) {
            $download_as_text = 1;
        } else {
            $download_as_text = 0;
        }
        ${$class} = new $class();
        $result = call_user_func(array(${$class}, $program_name), $_POST);
        $array_var = json_decode(json_encode($result), true);
        $download_format = !empty($_POST['download_format'][0]) ? $_POST['download_format'][0] : 'text_format';
    }
} else {
    $str_var = $_POST["data"];
    if (!empty($_POST['data_type']) && $_POST['data_type'] == 'sql_query') {
        $sql = unserialize(base64_decode($str_var));
        $array_var = json_decode(json_encode(dbObject::find_by_sql($sql)), true);
    } else {
        $array_var = unserialize(base64_decode($str_var));
    }
    if (!empty($_POST['download_format'])) {
        $download_format = is_array($_POST['download_format']) ? $_POST['download_format'][0] : 'text_format';
    } else {
        $download_format = 'text_format';
    }
}
switch ($download_format) {
    case 'excel_format':
        $format_extn = '.csv';
        break;
    case 'xml_format':
        $format_extn = '.txt';