<TITLE>AR user administration</TITLE>
<! includeFile("../body"); >

<CENTER>
<FONT SIZE=5>Member administration:</FONT><BR>
(delete member)<BR>
<P></P>

<TABLE WIDTH=400>
<TR><TD><CENTER>
Please, select users and then press DEL button
</CENTER></TD></TR>
</TABLE>


<!
$slova="ABCDEFGHIJKLMNOPQRSTUVWXYZ*";

echo("<CENTER><TABLE><TR>");
$i=0;
while ($i < #$slova) {
   echo("<TD BGcolor=#31639c WIDTH=17><CENTER><FONT FACE=\"Arial, Helvetica\" SIZE=3>");
   printf("<A HREF=\"ed_member.msql?slovo=%s\">%s</A>", $slova[$i], $slova[$i]);
   echo("</FONT></CENTER></TD>\n");
   $i=$i + 1;
   }

echo("</TR></TABLE></CENTER>\n<BR>");

$sock=msqlConnect();
if ($sock<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

if (msqlSelectDB($sock, "AR")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

$i=0;
while ($i<#$selected) {
   $ui=(int)$selected[$i];
   $i = $i + 1;

if ($ui>0) {
   $what="UPDATE ar_users SET clan='0' WHERE nmbr=$ui";

   if (msqlQuery($sock, $what)<0) {
      echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
      echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
      exit(0);
      }
   }
}

if ($slovo=="*") {
   $slovo="";
}

if (msqlQuery($sock, "SELECT nmbr, user, title, name, surname FROM ar_users WHERE clan='1' AND surname CLIKE '$slovo%' ORDER BY user")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

$fd=msqlStoreResult();
$data=msqlFetchRow($fd);

$tbl=0;
if (#$data>0) {
   echo("<TABLE WIDTH=400>\n");
   $tbl=1;
   }

while(#$data>0) {
   echo("<TR><TD BGCOLOR=\"NAVY\"><CENTER><FONT COLOR=\"WHITE\"><A HREF=\"userinfo.msql?nmbr=$data[0]\">$data[1]</A></CENTER></TD><TD BGCOLOR=\"Blue\"><FONT COLOR=\"WHITE\">$data[4], $data[3]</TD></TR>\n");

   $data=msqlFetchRow($fd);
   }
msqlFreeResult($fd);

if ($tbl==1) {
   echo("</TABLE>\n");
   echo("</FORM>\n");
   }
else {
   $greska="Sorry, no members found!";
   echo("<P><CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$greska</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);   
   }

>
