Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/irp/icure/doctor/
Upload File :
Current File : /var/www/html/mmishra/irp/icure/doctor/tdregistrations.inc

<h3 align='left'>Registrations Since 2015-04-15</h3>
<center>
<table width='90%' border='1'>
<tr valign='top'>

<?php

$datetime = date('Y-m-d');

$heads = array('Registration For','Registration By','Patient Classification','Student Batchwise','Student Coursewise','Student Genderwise');

$sqls = array("select concat(dr_name,', ',specialization) as doctor,count(reg_no) as patients 
	from registrations as a, doctors as b 
	where a.dr_id=b.dr_id group by a.dr_id",
	"select concat(ph_name,', ',specialization) as staff,count(reg_no) as patients 
	from registrations as a, staffs as b 
	where a.login_id=b.ph_id group by a.login_id",
	"select pat_group as Category,count(reg_no) as patients 
	from registrations group by pat_group",
        "select year as batch,count(reg_no) as patients
        from students as a,registrations as b
        where a.roll_no=b.pat_id group by year",
	"select course_name,count(reg_no) as patients     
        from students as a,registrations as b
        where a.roll_no=b.pat_id group by course_name",
	"select gender,count(reg_no) as patients     
        from students as a,registrations as b
        where a.roll_no=b.pat_id group by gender");

$no = 0;
foreach ($sqls as $sql) {
        echo "<th width='50%'>".$heads[$no]."<br><br>";
        $no++;
	$tno = 0;

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

               	echo "<table border='0' width='90%' align='center'><tr><th>Sr</th>";
               	for ($i=0; $i < $colHeads; $i++) { // Header
                       	echo "<th>".ucwords(str_replace("_"," ",mysql_field_name($rs, $i)))."</th>";
               	}
               	echo "</tr>";
               	
		$j = 0;
               	while ($row = mysql_fetch_row($rs)) { //data
                       	$j++;
                       	if ($j % 2 == 0)
                               	echo "<tr bgcolor='lightpink'><td>$j</td><td>".implode($row,'</td><td>')."</td></tr>";
                       	else
                               	echo "<tr><td>$j</td><td>".implode($row,'</td><td>')."</td></tr>\n";
               		$tno = $tno + $row[1];
		}
               	echo "<tr><th colspan='2'>Total</th><th>$tno</th></tr></table><br>";
       	} else {
        	echo "---";      	
	}
	echo "</th>";
       	$k++;
       	if ($k % 2 == 0) echo "</tr><tr valign='top'>";
}

?>

</tr>
</table>
</center>