$max = intval(GET('limit'));
$max = $max ? $max : 50;
ossim_valid($type, 'alarm|event', 'illegal:' . _("Type"));
ossim_valid($search, OSS_NULLABLE, OSS_NOECHARS, OSS_ALPHA, OSS_SCORE, OSS_PUNC, 'illegal:' . _("Search"));
if (ossim_error()) {
    die;
}
$db = new ossim_db(TRUE);
//Remote DataBases
if ($type == 'event' && is_array($_SESSION['server']) && $_SESSION['server'][0] != '') {
    $conn = $db->custom_connect($_SESSION["server"][0], $_SESSION["server"][2], $_SESSION["server"][3]);
} else {
    $conn = $db->connect();
}
if ($type == 'event') {
    $unique_pulses = Siem::get_unique_pulses($conn);
} else {
    if ($type == 'alarm') {
        $unique_pulses = Alarm::get_unique_pulses($conn);
    } else {
        $unique_pulses = array();
    }
}
$pulses = array();
if (count($unique_pulses) > 0) {
    try {
        $otx = new Otx();
        list($total, $p_list) = $otx->get_pulse_list(array('page' => 0, 'page_rows' => -1));
        foreach ($p_list as $p) {
            $p_id = Util::uuid_format_nc($p['id']);
            $p_name = trim($p['name']);