<?
include "./auth.inc.php";
$csql="SELECT AccountID FROM SubAccounts WHERE Login='$login'";
$res=mysql_query($csql);
if ($res)
if ($row=mysql_fetch_row($res)){
print "UserName $login already in use, Sorry!";
exit;
}
if (!$CustomerID){
exit;
}
if (strlen($login)<4){
print "At least 4 characters in the Username";
exit;
}
if (strlen($password)<4){
print "At least 4 characters in the password, preferably 7";
exit;
}
if ($approved){
#complete hole in the system -
# we put expire date on seperate email, but not logins..
$isql="INSERT INTO SubAccounts(
CustomerID,Login,Password,AccountType,VISP, Active, LastModifyDate
)VALUES(
'$CustomerID','$login','$password','casual','$VISP','1',now()
)";
mysql_query($isql);
if (mysql_error()){
print mysql_error();
exit;
}
$message=urlencode("Account $login Added successfully");
header("Location: buytime.php?purchase=Additional+Dialup&cost=$cost&message=$message");
exit;
}
print "<FORM>";
print "<BR><B>$login</B> ok as a dialup username.<BR>";
print "<INPUT TYPE=HIDDEN VALUE=\"$login\" NAME=login>";
print "<INPUT TYPE=HIDDEN VALUE=\"$VISP\" NAME=VISP>";
print "<INPUT TYPE=HIDDEN VALUE=\"$password\" NAME=password>";
print "<INPUT TYPE=HIDDEN VALUE=\"1\" NAME=approved>";
print "<BR>Cost: $<INPUT TYPE=TEXT NAME=cost VALUE=\"40\"> .inc.php.php.php.php.php.phplude GST)";
print "<BR><BR><INPUT TYPE=SUBMIT VALUE=\"Add new SubAccount\">";
print "</FORM>";