<header class="page-header">
	<h2>Manage Students</h2> 
</header>
<div class="col-sm-12" >
	<div class="row">
		<div class="col-sm-12">
		<?php if($this->session->flashdata('message_name')){
			echo $this->session->flashdata('message_name'); }?>
			
		</div>
	</div>	
	<?php if($test->Upload==1){?>
	<div class="row">
		<div style="margin-bottom:20px;">
			<a href= "<?= ADMIN_URL .'students/uploads'?>" class="btn btn-info"><i style="padding:10px;" class="fa fa-upload"></i> Upload Student Records</a>
		
		</div>
	</div>
	<?php }?>
	<div class="row alert alert-success">
			<div class="col-sm-3"><b>Name: </b><?=$test->TestName;?></div>
			<div class="col-sm-3"><b>Location: </b><?=$test->Location;?></div>
			<div class="col-sm-3"><b>District Code: </b><?=$test->DistrictCode;?></div>
			<div class="col-sm-3"><b>Training Center Code: </b><?=$test->TrainingCenterCode;?></div>
			<div class="col-sm-3"><b>State: </b><?=$test->State;?></div>
		
		</div>

	<div class="row">
		<div class="panel panel-default">
			<div class="panel-heading">
				<b style="color:#cd2026;">Students List</b> 			  
			</div>		
			<div class="panel-body">	
				<table class="table table-bordered table-striped mb-none" id="datatable-default">
					<thead>							
						<tr>						 
							<th style="width:2%">S.No.</th>
							<th style="width:5%">Code</th>
							<th style="width:5%">Name</th>
							<th style="width:5%">Father/Mother Name</th>
							<th style="width:5%">EmailId</th>
							<th style="width:5%">Date of Birth</th>
							<th style="width:5%">Education</th>
							<!-- <th style="width:5%">Last Examination Marks</th>  <td>" .$row['LastExaminationMarks']."</td> <td>".$row['DistrictCode']."</td> -->
							<th style="width:5%">District Code</th>
							<th style="width:5%">Training Center Code</th>
							<th style="width:5%">State</th>							
							<th style="width:5%">Action</th>								
							
						</tr>
					</thead>
					
					<tbody>
						<?php $fresult=''; $i=1;
							if(count($students)>0){
								foreach($students as $row){
									if($row['TestStatus']==1){
										$btn='<a data-sid="'.$row['id'].'" data-testid="'.$row['ParticipateTestId'].'" class="btn btn-primary StudentReport">Report</a>';
									}else{
										$btn='';
									}
									
									$fresult.="<tr id='row_".$row['id']."'> <td>".$i."</td> <td>".$row['StudentCode']."</td> 
									<td>".$row['Name']."</td><td>".$row['ParentsName']."</td> <td>".$row['EmailId']."</td>
									<td>".$row['DoB']."</td> <td>".$row['Education']."</td> 
									
									<td>".$row['TrainingCenterCode']."</td><td>".$row['State']."</td><td>$btn</td></tr>";		
								$i++;
								}
							}else{							 
								$fresult='<tr><td colspan="12">No Record Found</td></tr>';
							}
							echo $fresult;
						  ?>									 
					</tbody>
				</table>     
				 
			</div>
		</div>
	</div>
</div>

<script>
	 
	$(document).ready(function() {		
		setTimeout(function(){
			$('#RsMesg').remove();
		},6000);
	 
	}); 
	$(document).on('click','.StudentReport',function(){
		var me = $(this);
		var SId=me.data('sid');
		var TId=me.data('testid');
		//alert(SId);
		window.location.href=HTTP_PATH +'students/report/'+TId+'/'+SId;
	});
	
	 
	 
</script>
 
 
 