<TITLE>DI user administration</TITLE>

<! includeFile("../body"); >

<CENTER>
<FONT SIZE=5>Link administration:</FONT><BR>
(add member)<BR>

<P></P>

<TABLE WIDTH=400>
<TR><TD><CENTER>
Please, select link and then desired action button
</CENTER></TD></TR>
</TABLE>

<!
$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 links SET allowed='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 (msqlQuery($sock, "SELECT nmbr, name, url, description, uid, allowed FROM links  WHERE gid=$gid AND sgid=$sgid AND allowed='1' ORDER BY nmbr")<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("<FORM ACTION=\"links.msql\" METHOD=\"GET\">\n");
   echo("<INPUT NAME=\"selected\" TYPE=\"HIDDEN\" VALUE=0>\n");
   echo("<INPUT NAME=\"gid\" TYPE=\"HIDDEN\" VALUE=$gid>\n");
   echo("<INPUT NAME=\"sgid\" TYPE=\"HIDDEN\" VALUE=$sgid>\n");
   echo("<TABLE WIDTH=600>\n");
   $tbl=1;
   }

while(#$data>0) {
   echo("<TR><TD BGCOLOR=\"RED\"><CENTER><INPUT NAME=\"selected\" TYPE=\"checkbox\" VALUE=\"$data[0]\"></INPUT></CENTER></TD><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[1] - <A HREF=\"$data[2]\">$data[3] ($data[4])</A></TD></TR>\n");
   $data=msqlFetchRow($fd);
   }
msqlFreeResult($fd);

if ($tbl==1) {
   echo("<TR><TD COLSPAN=3><CENTER><INPUT TYPE=\"submit\" VALUE=\"DEL\"></TD></TR>\n");
   echo("</TABLE>\n");
   echo("</FORM>\n");
   }
else {
   $greska="Sorry, there are no new links!";
   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);   
   }

msqlFreeResult($fd);

>

</BODY>
</HTML>

