if (!$query) { $query = "id!='0' order by id"; } $db->query("SELECT COUNT(*) as total from triplet where " . $query); $db->next_record(); if ($db->f("total") < $q_triplet->start_row - $q_triplet->row_count) { $q_triplet->start_row = $db->f("total") - $q_triplet->row_count; } if ($q_triplet->start_row < 0) { $q_triplet->start_row = 0; } $query .= " LIMIT " . $q_triplet->start_row . "," . $q_triplet->row_count; // In any case we must display that form now. Note that the // "x" here and in the call to $q->where must match. // Tag everything as a CSS "query" class. // printf($q_triplet->form("x", $t->map_cols, "query")); printf("<hr>"); // if (!$query) { $query="id!='0'"; } // Do we have a valid query string? if ($query) { // Show that condition printf("Query Condition = %s<br>\n", $query); // Do that query $db->query("select * from triplet where " . $query); // Dump the results (tagged as CSS class default) printf("Query Results = %s<br>\n", $db->num_rows()); $t->show_result($db, "default"); } } // switch $cmd page_close();
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}"); echo "\n<hr>\n"; echo "</pre>"; } break; default: $cmd = "Query"; $t = new throttleTable(); $t->heading = 'on';