Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/icure/staff/
Upload File :
Current File : /var/www/html/mmishra/icure/staff/daily_registrations.inc

<h3 align='left'>Dated Registrations</h3>
<center>
<table width='90%' border='1'>
<tr valign='top'>

<?php
$dated = $_REQUEST["dated"];

if (!$dated) $dated = date("Y-m-d");

$dated1 = date('Y-m-d', strtotime($dated .' -1 day'));
$dated2 = date('Y-m-d', strtotime($dated .' +1 day'));

echo "<a href='?pg=$pg&dated=$dated1'>&lt;&lt;</a> 
<font size='+1' color='red'>[ $dated ]</font>";

if ($dated != date("Y-m-d")) echo " <a href='?pg=$pg&dated=$dated2'>&gt;&gt;</a>";


$heads = array('Registration For','Registration By','Pathology Tests By','Patients','Batch','Course','Gender','Hostel','BG');

$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 and reg_date like '$dated%' 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 and reg_date like '$dated%' group by a.login_id",
        "select concat(ph_name,', ',specialization) as staff,count(distinct reg_no) as patients 
        from phresults as a, staffs as b    
        where a.login_id=b.ph_id and test_date like '$dated%' group by a.login_id",
	"select pat_group as Category,count(reg_no) as patients 
	from registrations 
	where reg_date like '$dated%' 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 and reg_date like '$dated%' 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 and reg_date like '$dated%' 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 and reg_date like '$dated%' group by gender",
	"select hostel_no,count(reg_no) as patients     
        from students as a,registrations as b
        where a.roll_no=b.pat_id and reg_date like '$dated%' group by hostel_no",
	"select bg as blood_group,count(reg_no) as patients     
        from students as a,registrations as b
        where a.roll_no=b.pat_id and reg_date like '$dated%' group by bg");

$cols = 3;
$colw = 100/$cols;
$no = 0;
foreach ($sqls as $sql) {
        echo "<td width='$colw%' align='center'><h3>".$heads[$no]."</h3>";
        $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>";
               	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++;
                        echo "<tr><td>".implode($row,'</td><td>')."</td></tr>\n";
               		$tno = $tno + $row[1];
               	}
               	echo "<tr><th>Total</th><th>$tno</th></tr></table><br>";
       	} else {
        	echo "---";      	
	}
	echo "</td>";
       	$k++;
       	if ($k % $cols == 0) echo "</tr><tr valign='top'>";
}

?>

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