<?php 

		include("connection/conn.php");
	
		if($_SESSION['centeruser']==''){

			header("location:index.php");

			exit();

		}

		$adjacents = 3;
		 $select_1="select * from tbl_registration_details";
		
		$query_1=mysqli_query($link,$select_1);
		$total_pages=mysqli_num_rows($query_1);
		$path="center_code=$center_code";
		$targetpage="manage-registration.php"; 	   

		$limit=20; 								

		$page=$_GET['page'];

		if($page){
		$start=($page - 1) * $limit; 
		}		
		else{
			$start=0;		
		}

	 $sql="select * from tbl_registration_details";
		$result=mysqli_query($link,$sql);

		$count=mysqli_num_rows($result);

		if($page==0) 
	
		$page=1;					              

		$prev=$page-1;							

		$next=$page+1;							

		$lastpage=ceil($total_pages/$limit);		

		$lpm1=$lastpage-1;		

	// Export Data In CSV Format	

	

?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Manage Registration</title>
		<link href="css/bootstrap.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
		<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
	</head>
	
	<body>
		<div id="wrapper">
			<?php
				include("top-header.php");
				include("right-sec.php");
			?>
			<div id="page-wrapper" >
				<div id="page-inner">
					<div class="row">
						<div class="col-md-12">
							<h3 class="page-header">
								  Manage Registration<small></small>
							</h3>
							<div class="table-sec">
								<div class="srch_box">
									<h4 class="mb-1 p-0">Search</h4>
									<form action="">
										<div class="row">
										
											<div class="col-md-2 col-xs-2">	
												<div class="form-group form-select">
													<label>Student Name <span>*</span></label>
													<input class="form-control" type="text" alt="" name="name">
												</div>		
											</div>
											<div class="col-md-2 col-xs-2">		
												<div class="form-group form-select">
													<label>Course<span>*</span></label>
												<input class="form-control" type="text" alt="" name="name">
												</div>		
											</div>									
																				
											<div class="col-md-2 col-xs-2">	
												<button class="h-3 primary-btn text-uppercase">Search</button>
											</div>
										</div>
									</form>
								</div>
								<div class="mt-2 pop_btn">
									<div class="row"> 
									
										<div class="col-md-6 col-xs-6">
											<div class="flt_sec"> 
												
											</div>
										</div>
									</div>
								</div>
								<table>
									<tr class="tbl_head"> 
										<th>S.No.</th>
										<th>Name</th>
										<th>Father Name</th>
										<th>Mobile No.</th>
										<th>E-Mail Id</th>
										<th width="150">Course</th>
									    <th>City</th>
										<th class="wdh">Status</th>
									</tr>
									 <?php

              $i=1;

              while($find=mysqli_fetch_array($result)){

                $color = (($i%2) == 0)?"#e7f3ff":"#FFFFFF";

		   /* $select_res_course="select * from tbl_university_program_google where program_id='".$find['course']."'";
            $rsSearchCourse=mysqli_query($link,$select_res_course);
            $fetchCourse=mysqli_fetch_array($rsSearchCourse);
            
            $select_res_coursecat="select * from tbl_university_course_google where course_id='".$find['course_cat']."'";
            $rsSearchCoursecat=mysqli_query($link,$select_res_coursecat);
            $fetchCoursecat=mysqli_fetch_array($rsSearchCoursecat);*/
           

        ?>
									<tr>
										<td><?php echo $i?></td>
										<td><?php echo ucwords($find['name']);?></td>
										<td><?php echo ucfirst($find['father_name']);?></td>
										<td><?php echo ucfirst($find['mobileno']); ?></td>
										<td><?php echo ucfirst($find['email']); ?></td>
										<td><?php echo $find['course'];?></td>
									<td><?php echo $find['city'];?></td>
										<td width="150"><?php 
                                			if($find['status']==1)
                                			{
                                				$status_image='<img src="on.jpg" title="Make Inactive" alt="Make Inactive"  border="0">';
                                			}
                                			else
                                			{
                                	$status_image='<img src="off.jpg" title="Make Active" alt="Make Active" border="0">';
                                
                                			}
                                			
                                			?><?php echo $status_image?>
                                			<a href="update-registration.php?id=<?php echo $find['id'];?>">Update</a>&nbsp;&nbsp;&nbsp;
                                		
                                			</td>
										    
									</tr>
									<?php $i++; } ?>
								</table>
							</div>
						</div>
					</div> 
				</div>
			</div>
			<?php
				include("footer-sec.php");
			?>
		</div>
		
		
		<!-- jQuery Js -->
		<script src="js/jquery-1.10.2.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/jquery.metisMenu.js"></script>
		<script src="js/custom-scripts.js"></script>
	</body>
</html>
