<?php
error_reporting(0);
mysql_connect('localhost','admission2014','admission2014sgvu');
mysql_select_db("sgvuadmission");
?>


<table cellpadding="0" cellspacing="0" width="100%" border="1">
<tr><td>S.No.</td><td>Course Name</td><td>SID Generated</td><td>Admitted SID</td><td>Conversion Ration</td></tr>
<?php
$GetList=mysql_query("SELECT * FROM  `sgvu_courses` ORDER BY  `sgvu_courses`.`course_id` ASC ");
while($GetList1=mysql_fetch_assoc($GetList))
{
?>
<tr><td>S.No.</td>
<td><?php echo $GetList1['coursename'];?></td><td><?php 
$GetGenerateCount=mysql_query("SELECT * FROM  `student_registration` WHERE  `branch` ='$GetList1[course_id]'");
echo $total_sid=mysql_num_rows($GetGenerateCount);
?></td>
<td><?php 
$GetConvertCount=mysql_query("SELECT step1_perosonal.program, student_registration.step FROM step1_perosonal INNER JOIN student_registration ON step1_perosonal.sid=student_registration.sid WHERE student_registration.step='11' AND step1_perosonal.program='$GetList1[course_id]' ");
echo $total_convert=mysql_num_rows($GetConvertCount);
?></td>
<td><?php  $coversion=$total_convert*100/$total_sid; 
echo round($coversion);
?> %</td>
</tr>
<?php } ?>
</table>