<?
/* (C) 2002 Peter Salanki */
include("natashalib.inc.php");

dbconnect(); // Connect to the database

if($_POST[go] == 1) {
  request($_POST[chan], $_POST[nick], $_POST[bot]);
} else {
?>
<center><h1>Request a bot</h1></center><p>

<b>Requirements:</b><br>
You need to be Q AUTH'd.<br>
Your nick can't contain the character: \<br>
The channel must not be +i +k or have full limit.<br>
You must not already have a bot in the channel.<br>
The bot must be given +ao in L/Q.<br>
Bots not shown in the list below are either down, full or not borrowable.
<p>
<b>Observe: You need to <BIG>/msg Request-dev ACCEPT</BIG> BEFORE requesting .</b>
<p>
  <form method="POST">
   <label>Channel Name: <input name="chan" value="#channel"></label><br>
   <label>Current IRC Nick: <input name="nick" value=""></label><br>
   Bot: <SELECT NAME="bot">
<?php
  $strQuery = "SELECT `nick` FROM `arms` WHERE `type` = 30 AND `status` = 1 AND `channels` < $max_channels";
  $qri = mysql_query($strQuery, $db);
  echo mysql_error();
  while($qr = mysql_fetch_array($qri)) {
    echo "<OPTION>$qr[0]";
  }
?>
   </select>
   <input type="hidden" name="go" value="1">
   <p>
   <input type="submit" value="Request">
  </form>
<?php
       }
mysql_close($db);
?>