<? session_start(); ?>
<style>
body,td{font-family:'arial narrow';letter-spacing:1;}
th{background-color:c1d799}
.mnu{margin-left:5}
</style>

<script>
function subform()
{
 document.getElementById("f1").submit();
}
</script>

<body bgcolor=fcfff1>
<font color=green><h3>List of Users</h3>
<form id='f1' action='active.php' method='post'>
<table border=1 width=100%>
<tr><td align=right> <input type=submit value='Activate' name='act' onClick=subform()>
<input type=submit value='De-activate' name='inact' onClick=subform() >
</td></tr>
</table>

<table border=0  cellspacing=2 cellpadding=5>
<?
include("../opendb.php");
$re1=mysqli_query($db,"select distinct branch from bruser order by branch");
while($br_row=mysqli_fetch_row($re1))
{
 print "<tr><td colspan=5><b>".strtoupper($br_row[0])."</td></tr>";
 print "\n<tr bgcolor='c1d799'><td></td><td>User name </td><td>Level</td><td>Designation </td> <td>Phone </td><td>Password </td><td>Type</td></tr>";
 $re2=mysqli_query($db,"select * from bruser where branch='$br_row[0]'");
 while($user_row=mysqli_fetch_row($re2))
 {
   print "\n<tr bgcolor='c1d7bf' onMouseOver=bgColor='Pink'; onMouseOut=bgColor='c1d7bf';>";
   print "<td><input type=checkbox name=chk[] value='$user_row[0]'></td>";
   print "<td>$user_row[1]</td><td>$user_row[2]</td><td>$user_row[3]</td>";
   print "<td>$user_row[5]</td><td>$user_row[61]</td><td>$user_row[8]</td></tr>";
 }
}
?>
</table>
</form>
