1) $filter['id_grupo'] = $ev_group; if ($status == 1) $filter['estado'] = 1; if ($status == 0) $filter['estado'] = 0; if ($search != "") $filter[] = 'evento LIKE "%'.$search.'%"'; if (($event_type != "all") AND ($event_type != 0)) $filter['event_type'] = $event_type; if ($severity != -1) $filter[] = 'criticity >= '.$severity; if ($id_agent != -1) $filter['id_agente'] = $id_agent; $filter['order'] = 'timestamp DESC'; $now = date ("Y-m-d"); // Show contentype header Header ("Content-type: text/txt"); header ('Content-Disposition: attachment; filename="pandora_export_event'.$now.'.txt"'); echo "timestamp, agent, group, event, status, user, event_type, severity"; echo chr (13); $fields = array ('id_grupo', 'id_agente', 'evento', 'estado', 'id_usuario', 'event_type', 'criticity', 'timestamp'); $events = get_events ($filter, $fields); if ($events === false) $events = array (); foreach ($events as $event) { if (! give_acl ($config["id_user"], $event["id_grupo"], "AR")) continue; echo $event["timestamp"]; echo ","; echo get_db_value ('nombre', 'tagente', 'id_agente', $event["id_agente"]); echo ","; echo get_db_value ('nombre', 'tgrupo', 'id_grupo', $event["id_grupo"]); echo ","; echo $event["evento"]; echo ","; echo $event["estado"]; echo ","; echo $event["id_usuario"]; echo ","; echo $event["event_type"]; echo ","; echo $event["criticity"]; echo chr (13); } ?>