Example #1
0
if ($export_csv_audit) {
    $permission = give_acl($config["id_user"], 0, "IM");
    if (!$permission) {
        exit;
    }
    $where_clause = clean_output(get_parameter('where_clause'));
    $date = get_parameter('date');
    $filename = clean_output('audit_export') . '-' . date("YmdHi");
    $sql = sprintf('SELECT * FROM tsesion %s ORDER by utimestamp DESC', $where_clause);
    $rows = get_db_all_rows_sql($sql);
    if ($rows === false) {
        return;
    }
}
if ($export_csv_tickets) {
    $filter = unserialize_in_temp($config["id_user"]);
    $rows = incidents_search_result($filter, false, true, false, false, true, false, true);
    if ($rows === false) {
        return;
    }
    $filename = clean_output('tickets_export') . '-' . date("YmdHi");
}
if (empty($rows)) {
    die(__('Empty data'));
}
$csv_lines = array();
$search = array();
// Delete \r !!!
$search[] = "
";
$search[] = "\r";
// Delete \n !!!
// Default values
$antialiasing = true;
$font = '../fonts/unicode.ttf';
$xaxisname = '';
$yaxisname = '';
$legend = null;
$colors = null;
$font_size = 8;
$force_steps = true;
$graph_type = get_parameter('graph_type', '');
$id_graph = get_parameter('id_graph', false);
if (!$id_graph) {
    exit;
}
$ttl = get_parameter('ttl', 1);
$graph = unserialize_in_temp($id_graph, true, $ttl);
if (!isset($graph)) {
    exit;
}
$data = $graph['data'];
$width = $graph['width'];
$height = $graph['height'];
if (isset($graph['color'])) {
    $colors = $graph['color'];
}
if (isset($graph['legend'])) {
    $legend = $graph['legend'];
}
if (isset($graph['xaxisname'])) {
    $xaxisname = $graph['xaxisname'];
}