<?php require('config.php3'); require('SRC/macros.php3'); 
list ($home,$url,$users,$assign,$msg,$host,$sql,$MYCookie,$applet,$os)=courseAll();

					# Current number of accounts
$db = pg_Connect($host, "", "", "", $sql);
$cmd = "SELECT last_value FROM user_nbr_sequence;";
if(!($result=pg_exec($db,$cmd))){echo "Show: error 1<br>";exit();}
$nbrusers = (pg_result($result, 0, last_value)-1000);

?>
<!-- Produced by $Id: users.php3,v 1.12 2001/12/10 07:50:07 andrej Exp $ -->
<?php
myheader('Registered users','..',0);
echo "There are currently $nbrusers users who opened an account; ";
?>
below, we list those who kindly accepted that we publish their name.
<table cellspacing=0>
<tr bgcolor=#bcbcbc>
  <th nowrap align=left>School</th>
  <th nowrap align=left>Department</th>
  <th nowrap align=left>Name</th>
</tr>

<?php
					# List of users
$cmd="SELECT user_nbr,user_name,user_school,user_dept,user_url,user_publish ".
     "FROM users ORDER BY lower(user_school) DESC,lower(user_name)";
if(!($users=pg_exec($db,$cmd))){echo "Show: error 2<br>";exit();}
$nusers=pg_numrows($users);
for ($i=0; $i<$nusers; $i++){
  $u=pg_fetch_object($users, $i);
  if ($u->user_publish=='t') {
    echo "<tr bgcolor=#dcdcdc>".
         "<td align=left>".substr($u->user_school,0,40)."&nbsp;</td>".
         "<td align=left>".substr($u->user_dept,0,35)."&nbsp;</td>";
    if (strlen($u->user_url)>12) {
      echo "<td align=left><a href=$u->user_url>$u->user_name</a>&nbsp;</td></tr>";
    } else {
      echo "<td align=left>$u->user_name&nbsp;</td></tr>";
    }
  }
}
echo "</tr></table><br>";
pg_Close($db);
thisFooter();
?>
