<?php include "header_with_out_nav.php"; 

$btnSave=$_GET['btnSave'];

$college_id=$_GET['college_id'];

$course_name=$_GET['course_name'];

$subject=$_GET['subject'];

$college_type=$_GET['college_type'];

$Course_Details=$_GET['Course_Details'];



if($login_type=='admin'){

?>

<style>

body{

text-transform:uppercase;

font-size:12px;

}

</style>

<?php if($btnSave==""){ ?>

<form name="form1" action="phone_no_report.php" method="get"  class="form-horizontal" role="form">

	  <table cellpadding=2 cellspacing=0 border=1 bordercolor=#FFFFCC bgcolor="#FFFFFF" align=center class="table table-bordered table-striped">

				

		<tr>

		  <td colspan="2" bgcolor="#990000" class=color3 style="color:#FFFFFF">Print Data</td>

		  </tr>

		<tr>

          <td class=color3>Select College</td>

		  <td class=color2><?php

							

$queryy = "SELECT * FROM college_name where code='$code'";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

?>

              <select name="college_id" id="college_id" required onchange='this.form.submit()'>

                <option value="">Select</option>

                <?php

while ( $a_roww = mysql_fetch_row( $resulty ) )

 {?>

                <option

                 <?php 

				 $cn_id=$a_roww[2];

				 if($cn_id==$college_id){

				  ?>selected<?php } ?>

                  

                   value="<?php echo $a_roww[2];?>" >( <?php echo $a_roww[2];?> ) <?php echo $a_roww[1];?></option>

                <?php } ?>

            </select></td>

		  </tr>

		<tr>

          <td width="116" class=color3>College Type</td>

		  <td width="190" class=color2><select name="college_type" required="required" onchange='this.form.submit()'>

             <?php
$query = "SELECT * FROM ctype where session='$session' and code='$code' ORDER BY id";
$numresults=mysql_query($query);
 $numrows=mysql_num_rows($numresults);
$result = mysql_query($query) or die("Couldn't execute query");
while ( $a_row = mysql_fetch_row( $result ) )

 {?>
          <option value="<?php echo $rty=$a_row[1]; ?>" <?php 
				 if($college_type==$rty){
				  ?>selected<?php } ?>><?php echo $a_row[2]; ?></option>
<?php } ?>

            </select>          </td>

		  </tr>

		

		<tr>

          <td class=color3> Course Name</td>

		  <td class=color2>

          <select name="course_name"  required onchange='this.form.submit()' class="chosen-select form-control">

                                            

                                            <?php $queryy = "SELECT * FROM course_name where college_id='$college_id' && ctype='$college_type' and session='$session' and code='$code'  Order by id";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

 ?>

	<option value="">Select</option>

	 <?php

while ( $a_roww = mysql_fetch_row( $resulty ) )

 {?>

                  <option 

                 <?php 

				 $Course_id=$a_roww[0];

				 if($Course_id==$course_name){

				  ?>selected<?php } ?> 

                  value="<?php echo $a_roww[0];?>" ><?php echo $a_roww[1];?></option>

                  <?php } ?>

</select>         </td>

		  </tr>

          <tr>

		  <td class=color3>Select Year</td>

		  <td class=color2><select name="Course_Details" title="Select  Year/Semester" class="chosen-select form-control" required>

	

     <?php $queryy = "SELECT * FROM seme_year where course_name='$course_name' and session='$session' and code='$code' Order by id";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

 ?>

	<option value="">Select</option>

	 <?php

while ( $a_roww = mysql_fetch_row( $resulty ) )

 {?>

                  <option

                 <?php 

				 $Course_Detailss=$a_roww[1];

				 if($Course_Detailss==$Course_Details){

				  ?>selected<?php } ?>

                  

                   value="<?php echo $a_roww[1];?>" ><?php echo $a_roww[1];?></option>

                  <?php } ?>

    

    

</select></td>

	    </tr>

        <tr>

          <td class=color3></td>

          <td class=color2>&nbsp;</td>

        </tr>

        <tr> 

			<td class=color3></td>

			<td class=color2><input type="submit" name="btnSave" value="Get  List"  class="btn btn-info" ></td>

		</tr>

	</table>

</form>

<?php }else { ?>

<br/>

<center><a href="phone_no_report.php" style="font-size:16px; text-align:center; background-color:#FF0000; color:#FFFFFF; padding:5px;">BACK TO SEARCH</a></center><br/>



<table width="100%" border="1" cellspacing="0" cellpadding="2">

  <tr>

    <td><strong>S.NO</strong></td>

    <td><strong>COLLEGE CODE</strong></td>

    <td><strong>COURSE NAME</strong></td>

    <td><strong>ROLL NO</strong></td>

    <td><strong>FORM NO</strong></td>

    <td><strong>STUDENT NAME</strong></td>

    <td><strong>FATHER NAME</strong></td>

    <td><strong>STUDENT TYPE</strong></td>

    <td><strong>GENDER</strong></td>

    <td><strong>CASTE</strong></td>

    <td><strong>SUBJECT NAME</strong></td>

    <td><strong>AADHAR NO</strong></td>

    <td><strong>aDDRESS</strong></td>

    <td><strong>eMAIL</strong></td>

    <td><strong>mOBILE</strong></td>

  </tr>

    <?php

    

	 

$query = "SELECT * FROM class2 WHERE college='$college_id' and  `CourseType`='$college_type' and `session`=$session and `code`=$code and `Course`='$course_name' and `Course_Details`='$Course_Details' and college_roll!='' order by id";

$numresults=mysql_query($query);

 $numrows=mysql_num_rows($numresults);

$result = mysql_query($query) or die("Couldn't execute query");





?>

<?php 

$counter = 1;?>

 <?php

while ( $a_row = mysql_fetch_array( $result ) )

 {?>

  <tr>

    <td><?php echo $counter; ?></td>

    <td><?php echo $a_row['college']; ?></td>

    <td><?php 

	$idd=$a_row['Course'];

											$queryy = "SELECT * FROM course_name where id='$idd' and session='$session' and code='$code'";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

$a_roww = mysql_fetch_row( $resulty );

echo $a_roww[1];

 ?>	</td>

    <td><?php echo $a_row['college_roll']; ?></td>

    <td><?php echo $a_row['fno']; ?></td>

    <td><?php echo $a_row['StudentName']; ?></td>

    <td><?php echo $a_row['FatherName']; ?></td>

    <td><?php echo $a_row['Student_Type']; ?></td>

    <td><?php echo $a_row['Gender']; ?></td>

    <td><?php echo $a_row['Category']; ?></td>

    <td><?php echo $a_row['class_app']; ?></td>

    <td><?php echo $a_row['acard']; ?></td>

    <td>

	<?php echo $a_row['txtHouseNo'].'/'.$a_row['txtStreet'].'/'.$a_row['txtPostOffice'].'/'.$a_row['txtState'].'/'.$a_row['txtDistrict0'].'/'.$a_row['txtPinCode']; ?></td>

    <td><?php echo $a_row['txtEmailID']; ?></td>

    <td><?php echo $a_row['MobileNO']; ?></td>

  </tr>

  <?php $counter++; } ?><?php } ?>

</table>

<?php }

include "footer.php"; ?>