<TITLE>ARYU discussion groups</TITLE>
<!

includeFile("../body"); 

$color1="NAVY";
$color2="BLUE";
$color3="#99CCCC";
$color4="RED";


echo("Please, select desired Group/subgroup:<BR><BR><BR>\n");

$err="";

   $sock=msqlConnect();
   if ($sock<0) {
      echo("<CENTER><TABLE WIDTH=500 BORDER=2 BGCOLOR=\"$color3\">\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=$color3>\n");
      echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
      exit(0);
      }

   if (msqlQuery($sock, "SELECT * FROM group ORDER BY gname")<0) {
      echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=$color3>\n");
      echo("<TR><TD>\n<BR><CENTER><B>WARNING:</B> $ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
      exit(0);
      }
$fd=msqlStoreResult();
$grupa=msqlFetchRow($fd);

if (#$grupa==0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=$color4>\n");
   echo("<TR><TD>\n<BR><CENTER><B>WARNING:</B> Database is empty<BR>no group definition</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

while(#$grupa>0) {
   echo("$grupa[1] - $grupa[2]<BR>\n");
   if (msqlQuery($sock, "SELECT * FROM subgroup WHERE gid=$grupa[0] ORDER BY sgname")<0) {
      echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=$color3>\n");
      echo("<TR><TD>\n<BR><CENTER><B>WARNING:</B> $ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
      exit(0);
      }
   $sd=msqlStoreResult();
   $sgrupa=msqlFetchRow($sd);
   while(#$sgrupa>0) {
   echo("&nbsp;&nbsp;&nbsp; <A HREF=\"messages.msql?group=$grupa[0]&sgroup=$sgrupa[1]\">$sgrupa[2]</A> - $sgrupa[3]<BR>\n");
   $sgrupa=msqlFetchRow($sd);
   } 
   msqlFreeResult($sd);

   echo("<BR>\n");
   $grupa=msqlFetchRow($fd);
   } 
msqlFreeResult($fd);
msqlClose($sock);

>

