if ($id) {
        $f->find_values($id);
    }
}
switch ($cmd) {
    case "View":
    case "Delete":
        $f->freeze();
    case "Add":
    case "Edit":
        echo "<font class=bigTextBold>{$cmd} triplet</font>\n";
        $f->display();
        break;
    default:
        $cmd = "Query";
        $t = new tripletTable();
        $t->heading = 'on';
        $t->add_extra = 'on';
        $db = new DB_policyd();
        echo "&nbsp<a href=\"" . $sess->self_url() . $sess->add_query(array("cmd" => "Add")) . "\">Add triplet</a>&nbsp\n";
        echo "&nbsp<a href=\"" . $sess->url("/index.php") . "\">Home</a>&nbsp\n";
        echo "<font class=bigTextBold>{$cmd} triplet</font>\n";
        // These fields will be searchable and displayed in results.
        // Format is "RealFieldName"=>"Field Name Formatted For Display",
        $t->fields = array("_from", "_rcpt", "_host", "_datenew", "_datelast", "_count");
        $t->map_cols = array("_from" => "from", "_rcpt" => "rcpt", "_host" => "host", "_datenew" => "datenew", "_datelast" => "datelast", "_count" => "count");
        // When we hit this page the first time,
        // there is no .
        if (!isset($q_triplet)) {
            $q_triplet = new triplet_Sql_Query();
            // We make one
    }
} else {
    if ($id) {
        $f->find_values($id);
    }
}
switch ($cmd) {
    case "View":
    case "Delete":
        $f->freeze();
    case "Add":
    case "Edit":
        echo "<font class=bigTextBold>{$cmd} throttle</font>\n";
        $f->display();
        if ($cmd == 'Back') {
            $t = new tripletTable();
            $t->heading = 'on';
            $t->fields = array("_from", "_rcpt", "_host", "_datenew", "_datelast", "_count");
            $t->map_cols = array("_from" => "from", "_rcpt" => "rcpt", "_host" => "host", "_datenew" => "datenew", "_datelast" => "datelast", "_count" => "count");
            $tr_host = substr($_from, 0, strrpos($_from, "."));
            $sql = "select * from triplet where _host like '{$tr_host}%' order by _count desc limit 0,20";
            $db->query($sql);
            echo "<br><big><i><b>{$sql}</b></i></big>\n";
            $t->show_result($db);
            echo "<pre>";
            echo "\n<hr>\n";
            system("host {$_from}");
            echo "\n<hr>\n";
            system("whois {$_from}");
            echo "\n<hr>\n";
            system("traceroute {$_from}");