Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/indem/sip/
Upload File :
Current File : /var/www/html/mmishra/indem/sip/index.php

<?php
require("init.inc.php");

echo $header;

?>
<br>
<center>
<?php
if (!$user) {
	echo "<table border='9'><tr><td>
	UID <input type='text' name='txtID' value='' size='15'>
	PWD <input type='password' name='txtPWD' value='' size='15'>
	<input type='submit' name='login' value='LOGIN'>
	</td></tr></table>";
} else 
	echo $user;
?>
[ <a href='/guest/'>Guest access</a> ]
</center>

<h3>Meta Data - Student Distribution</h3>
<center>
<?php

$tbl = 'students';

$sqls = array("select course_name course, count(r_number) no from $tbl group by course_name",
"select year batch, count(r_number) no from $tbl group by year",
"select communication_address_state state, count(r_number) no from $tbl group by communication_address_state",
"select category, count(r_number) no from $tbl group by category",
"select gender, count(r_number) no from $tbl group by gender",
"select area, count(r_number) no from $tbl group by area",
"select bg blood, count(r_number) no from $tbl group by bg",
"select insurance, count(r_number) no from $tbl group by insurance",
"select religion, count(r_number) no from $tbl group by religion"
);

echo "<table width='80%' border='1'><tr valign='top'>";

foreach ($sqls as $sql) {
	$rs = mysql_query($sql);
	if (mysql_num_rows($rs)) {
        	$colHeads = mysql_num_fields($rs);

        	echo "<th width='33%'>
		<table border='0' width='90%'>\n<tr>";

        	for ($i=0; $i < $colHeads; $i++) { // Header
                	$fld = ucwords(str_replace("_"," ",mysql_field_name($rs, $i)));
                	echo "<th>$fld</th>";
        	}

        	echo "</tr>\n";

        	while ($row = mysql_fetch_row($rs)) { //data
                	$j++;
			if ($j % 2 == 0) 
				echo "<tr bgcolor='lightskyblue'><td>".implode($row,'</td><td>')."</td></tr>\n";
                	else 
				echo "<tr><td>".implode($row,'</td><td>')."</td></tr>\n";
        	}

        	echo "</table></th>";
	} else {
        	echo "<td>Sorry! record could not be found.</td>";
	}
	$k++;
	if ($k % 3 == 0) echo "</tr><tr valign='top'>";
}
echo "</tr></table>
</center>";

echo $footer;
?>