<?php
include("common/connect.php");
?>

<table cellpadding="0" cellspacing="0" width="900" border="1">

<tr><td width="46">S.No.</td><td width="142">Sid</td><td width="279">Student Name</td><td width="168">Program</td><td width="156">Amount</td><td width="95">Step</td></tr>
<?php
$List=mysql_query("SELECT * FROM  `reg2017` ORDER BY  `reg2017`.`id` ASC ");
while($List1=mysql_fetch_assoc($List))
{
	$GetStDe=mysql_query("SELECT * 
FROM  `step1_perosonal` 
WHERE  `sid` ='$List1[sid]'");
	$GetStDe1=mysql_fetch_assoc($GetStDe);
	
	$GetStep=mysql_query("SELECT * FROM  `student_registration` WHERE  `sid` ='$List1[sid]'");
	$GetStep1=mysql_fetch_assoc($GetStep);
	
?>
<tr><td><?php echo $List1['id']; ?></td><td><?php echo $List1['sid'];
if($List1['sid']!='0')
{
	$count[]=1;
}
 ?></td><td><?php echo $GetStDe1['firstname'].' '.$GetStDe1['middlename'].' '.$GetStDe1['lastname']; ?></td><td><?php  
$Prog=mysql_query("SELECT * FROM  `sgvu_courses` WHERE  `course_id` ='$GetStDe1[program]'");
$Prog1=mysql_fetch_assoc($Prog);
echo $Prog1['coursename'];
?></td><td><?php echo $List1['amt']; ?></td><td><?php
if($GetStep1['step']=='1')
{
echo '';	
}

if($GetStep1['step']=='1')
{
echo 'Personal Desk';	
}

if($GetStep1['step']=='2')
{
echo 'Academic Detail Desk';	
}

if($GetStep1['step']=='3')
{
echo 'Document Desk';	
}

if($GetStep1['step']=='4')
{
echo 'Payment desk';	
}

if($GetStep1['step']=='5')
{
echo 'DD Desk';	
}

if($GetStep1['step']=='6')
{
echo 'Scruitnizer Desk';	
}

if($GetStep1['step']=='7')
{
echo 'Senior Desk';	
}

if($GetStep1['step']=='8')
{
echo 'Finance Desk';	
}
if($GetStep1['step']>='9')
{
echo 'Admission Done';	
}

?></td></tr>
<?php
}
?>


</table>
<br /><br />

Total Identified : <?php echo array_sum($count); ?>