<?php
error_reporting(0);
mysql_connect('localhost','admission2014','admission2014sgvu');
mysql_select_db("sgvuadmission");
?>
<table cellpadding="0" cellspacing="0" width="1000" border="1">
<tr><td>S.No.</td><td>sid</td><td>Student Name</td><td>Enrollment</td>
  <td>Pics</td>
  </tr>
<?php
// echo "SELECT student_registration.sid, student_registration.sesion, step1_perosonal.program FROM step1_perosonal INNER JOIN student_registration ON student_registration.sid = step1_perosonal.sid WHERE step1_perosonal.program =11 AND student_registration.sesion =8"; 

$GetList=mysql_query("SELECT student_registration.sid, student_registration.sesion, student_registration.step, step1_perosonal.program FROM step1_perosonal INNER JOIN student_registration ON student_registration.sid = step1_perosonal.sid WHERE student_registration.sesion =7 AND student_registration.step>8");
while($GetList1=mysql_fetch_assoc($GetList))
{
	$s =$_REQUEST['v'];
	
	$GetEnroll=mysql_query("SELECT * FROM  `sgvu_enrollment` WHERE  `sid` ='$GetList1[sid]'");
//echo mysql_num_rows($GetEnroll);
$GetEnroll1=mysql_fetch_assoc($GetEnroll);
	

						$u = $s+0;
						
			$GetChkForm=mysql_query("SELECT * FROM  `only_sid` WHERE  `sid` ='$GetEnroll1[enrollment_no]'");
			$GetChkForm1=mysql_num_rows($GetChkForm);
			if($GetChkForm1 > 0)
			
			{
				
				$GetImage=mysql_query("SELECT * FROM  `step3_document` WHERE  `doc_type` =1 AND  `sid` ='$GetList1[sid]'");
				$GetImage1=mysql_fetch_assoc($GetImage);
						
						
	$GetPersonal=mysql_query("SELECT * FROM  `step1_perosonal` WHERE  `sid` =  '$GetList1[sid]'");
$GetPersonal1=mysql_fetch_assoc($GetPersonal);

//$GetChk=mysql_query("SELECT * FROM  `sgvu_stu_sem_allocate` WHERE  `sid` ='$GetList1[sid]'");
//$GetChk1=mysql_fetch_assoc($GetChk);
//if($GetChk1['sem'] =='1')
{

?>

<tr><td><?php echo $_REQUEST['v'] = $u+1; ?></td><td><?php 
echo $GetList1['sid'];

 ?></td>
 <td><?php echo $GetPersonal1['firstname']; ?> <?php echo $GetPersonal1['middlename']; ?> <?php echo $GetPersonal1['lastname']; ?></td>
 <td><?php 
//echo $GetList1['sid'];

echo $GetEnroll1['enrollment_no'];

 ?></td>
 
 
 <td>
 
 <a href="http://www.gyanvihar.org/new-admin/upload/<?php echo $GetImage1['image']; ?>"><?php echo $GetImage1['image']; ?></a></td></tr>
<?php
}
}
}
?>

</table>