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

includeFile("../body"); 

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


$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 icons")<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();
$icon=msqlFetchRow($fd);
while (#$icon>0) {
   $tt=(int)$icon[0];
   $icn[$tt]=$icon[1];  
   $icon=msqlFetchRow($fd);   
   }
msqlFreeResult($fd);

   if (msqlQuery($sock, "SELECT * FROM message WHERE gid=$group AND sgid=$sgroup ORDER BY article")<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();
$ms=msqlNumRows($fd);
$message=msqlFetchRow($fd);
if ($ms==0) {
   echo("<CENTER><TABLE WIDTH=500 BORDER=2 BGCOLOR=\"$color3\">\n");
   echo("<TR><TD>\n<BR><CENTER>Sorry, there are no messages in this subgroup.</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   }
else {
   echo("Please, select desired message:<BR><BR>\n<TABLE>\n");

   while(#$message>0) {
      $rr=(int)$message[7];
      echo("<TR><TD WIDTH=40><CENTER><IMG SRC=\"icons/$icn[$rr]\"></TD><TD><A HREF=\"message.msql?gid=$group&sgid=$sgroup&article=$message[2]\">$message[5]</A></TD><TD>($message[4])</TD></TR>\n");
      $message=msqlFetchRow($fd);
      } 

   }
msqlFreeResult($fd);
msqlClose($sock);

echo("</TABLE>\n");

echo("<BR><BR><A HREF=\"new_message.msql?group=$group&sgroup=$sgroup&reply=0\">New message</A>\n");


>

