= UC_ADMINISTRATOR) { $first = trim($_POST["first"]); $last = trim($_POST["last"]); $comment = trim($_POST["comment"]); if (!$first || !$last || !$comment) stderr("Error", "Missing form data."); $firstlong = ip2long($first); $lastlong = ip2long($last); if ($firstlong == -1 || $lastlong == -1) stderr("Error", "Bad IP address."); $comment = sqlesc($comment); $added = sqlesc(date("Y-m-d H:i:s")); sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, ".mysql_real_escape_string($CURUSER[id]).", $firstlong, $lastlong, $comment)") or sqlerr(__FILE__, __LINE__); header("Location: $_SERVER[REQUEST_URI]"); die; } //ob_start("ob_gzhandler"); $res = sql_query("SELECT * FROM bans ORDER BY added DESC") or sqlerr(); stdhead("Bans"); print("

Current Bans

\n"); if (mysql_num_rows($res) == 0) print("

Nothing found

\n"); else { print("\n"); print("". "\n"); while ($arr = mysql_fetch_assoc($res)) { print("\n"); } print("
AddedFirst IPLast IPByCommentRemove
".gettime($arr[added])."".long2ip($arr[first])."".long2ip($arr[last])."". get_username($arr['addedby']) . "$arr[comment]Remove
\n"); } if (get_user_class() >= UC_ADMINISTRATOR) { print("

Add ban

\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n
First IP
Last IP
Comment
\n"); } stdfoot(); ?>