$groups = retrieve_groups($only_open);
    $file = Alarm_groups::change_status($groups, "open");
    @system("php /usr/share/ossim/scripts/alarms/bg_alarms.php {$user} {$file} > /dev/null 2>&1 &");
    $db->close();
    exit;
}
$entities = array();
if (Session::is_pro()) {
    $_entities = Acl::get_entities($conn);
    foreach ($_entities[0] as $e_id => $e) {
        $entities[$e_id] = Util::utf8_encode2($e['name']);
    }
}
$entity_types = Session::get_entity_types($conn, TRUE);
$name = $name == _('Unknown Directive') ? '' : $name;
list($list, $num_rows) = Alarm_groups::get_alarms($conn, $sensor_query, $src_ip, $dst_ip, $hide_closed, "", $from, $top, $from_date, $to_date, $name, "", $directive_id, $tag, TRUE, $num_events, $num_events_op);
$tz = Util::get_timezone();
$colspan = Session::is_pro() && $mssp ? 11 : 10;
?>

<table class='t_agr table_list'>	
    <tr>
        <th></th>
        <th></th>
        <th><?php 
echo _("Alarm Name");
?>
</th>
        <th><?php 
echo _("Events");
?>
$geoloc = new Geolocation("/usr/share/geoip/GeoLiteCity.dat");
if ($timestamp != "") {
    $from_date = $timestamp != "" ? $timestamp . " 00:00:00" : null;
    $to_date = $timestamp != "" ? $timestamp : null;
}
$entities = array();
if (Session::is_pro()) {
    $_entities = Acl::get_entities($conn);
    foreach ($_entities[0] as $e_id => $e) {
        $entities[$e_id] = Util::utf8_encode2($e['name']);
    }
}
$entity_types = Session::get_entity_types($conn, TRUE);
$name = $name == _('Unknown Directive') ? '' : $name;
$criteria = array("sensor" => $sensor_query, "src_ip" => $src_ip, "dst_ip" => $dst_ip, "asset_group" => $asset_group, "hide_closed" => $hide_closed, "order" => "", "inf" => $inf, "sup" => $sup, "from_date" => $from_date, "to_date" => $to_date, "query" => $name, "group_id" => "", "directive_id" => $directive_id, "tag" => $tag, "num_events" => $num_events, "num_events_op" => $num_events_op);
list($list, $total) = Alarm_groups::get_alarms($conn, $criteria, TRUE);
$tz = Util::get_timezone();
$results = array();
foreach ($list as $s_alarm) {
    $res = array();
    $s_id = $s_alarm->get_plugin_id();
    $s_sid = $s_alarm->get_plugin_sid();
    $s_backlog_id = $s_alarm->get_backlog_id();
    $s_event_id = $s_alarm->get_event_id();
    $ctx = $s_alarm->get_ctx();
    $s_src_ip = $s_alarm->get_src_ip();
    $s_src_port = $s_alarm->get_src_port();
    $s_dst_port = $s_alarm->get_dst_port();
    $s_dst_ip = $s_alarm->get_dst_ip();
    $s_status = $s_alarm->get_status();
    $ctxs = $s_alarm->get_sensors();