 <div class="container">
<?php 
$logged_in=$this->session->userdata('logged_in');
?>
   
  

<?php 
if($logged_in['su']=='1'){
	?>
  

<?php 
}
?>

<h3><?php echo $title;?></h3>
 
  <div class="row">
  <div class="col-lg-6">

    <form method="post" action="<?php echo site_url('result/calculation/');?>">
	<div class="input-group">
    <input type="text" class="form-control" name="search" placeholder="<?php echo $this->lang->line('search');?>...">
      <span class="input-group-btn">
        <button class="btn btn-default" type="submit"><?php echo $this->lang->line('search');?></button>
      </span>
	 
	  
    </div><!-- /input-group -->
	 </form>
  </div><!-- /.col-lg-6 -->

</div><!-- /.row -->




  <div class="row">
  
	<select id="test" name="form_select" onchange="showDiv(this)">
   <option value="1">Score Without Negative</option>
   <option value="0">With Negative</option>
  
  </select>
<div class="col-md-12">
<br> 
<div id="without_negative">
<a class="btn btn-success" href="<?php echo site_url(); ?>/export/createexcel"><i class="fa fa-file-excel-o"></i> Export</a>
<br><br>		
<table class="table table-bordered">
		<tr>
		<th>Registration No.</th>
		 <th><?php echo $this->lang->line('email');?></th>
		 <th><?php echo $this->lang->line('name');?></th>
		 <th><?php echo $this->lang->line('branch');?></th>
		 <th><?php echo $this->lang->line('aptitude');?></th>
		 <th><?php echo $this->lang->line('english');?></th>
		 <th><?php echo $this->lang->line('reasoning');?></th>
		 <th><?php echo $this->lang->line('technical');?></th>
		<!--<th><?php echo $this->lang->line('category_name');?> </th>
		 <th>Score</th>-->
		 

		<?php


		foreach($pass_student_list as $key => $val){
			//echo "<pre>";print_r($pass_student_list);die();
		?>
		<tr>
		 <td><?php echo $val['reg_no'];?></td>
		 <td><?php echo $val['email'];?></td>
		  <td><?php echo $val['name'];?></td>
		  <td><?php echo $val['branch'];?></td>
		  <td><?php echo $val['apti_score'];?></td>
		  <td><?php echo $val['english_score'];?></td>
		  <td><?php echo $val['reasoning_score'];?></td>
		  <td><?php echo $val['technical_score'];?></td>
		  <!--<td><?php echo $val['category_name'];?> <?php echo $val['last_name'];?></td>
		<td><?php echo $val[''];?> <?php echo $val['count'];?></td>-->
		</tr>
		<?php
		} ?>
		</tr>

		</table>
</div>
</div>
<div id="with_negative" style="display:none;">
<a class="btn btn-success" href="<?php echo site_url(); ?>/export/exportnegative"><i class="fa fa-file-excel-o"></i> Export</a>
<br><br>		
<table class="table table-bordered">
	<tr>
		<th>Registration No.</th>
		 <th><?php echo $this->lang->line('email');?></th>
		 <th><?php echo $this->lang->line('name');?></th>
		 <th><?php echo $this->lang->line('branch');?></th>
		 <th><?php echo $this->lang->line('aptitude');?></th>
		 <th><?php echo $this->lang->line('english');?></th>
		 <th><?php echo $this->lang->line('reasoning');?></th>
		 <th><?php echo $this->lang->line('technical');?></th>
		 <?php
         

		foreach($pass_student_list as $key => $val){
			foreach ($category_list as $key => $value1) {
					 if($value1['category_name']=="Aptitude"){
					 	$aptiscore=$val['apti_score']- ($val['apti_negative']*$value1['negative_mark']);
					 }
					 if($value1['category_name']=="Reasoning"){
					 	$reasoning_score=$val['reasoning_score']- ($val['reasoning_negative']*$value1['negative_mark']);
					 }
					 if($value1['category_name']=="Technical"){
					 	$technical_score=$val['technical_score']- ($val['technical_negative']*$value1['negative_mark']);
					 }
					  if($value1['category_name']=="English"){
					 	$english_score=$val['english_score']-($val['english_negative']*$value1['negative_mark']);
					 }
			   }
		  // echo"<pre>";print_r( $val);die();
		  
		?>
		<tr>
		<td><?php echo $val['reg_no'];?></td>
		 <td><?php echo $val['email'];?></td>
		  <td><?php echo $val['name'];?></td>
		  <td><?php echo $val['branch'];?></td>
		  <td><?php echo $aptiscore;?></td>
		  <td><?php echo $english_score;?></td>
		  <td><?php echo $reasoning_score;?></td>
		  <td><?php echo $technical_score;?></td>
		</tr>
		
		<?php
		} ?>
		</tr>

</table>
</div>
</div>

<?php
if(($limit-($this->config->item('number_of_rows')))>=0){ $back=$limit-($this->config->item('number_of_rows')); }else{ $back='0'; } ?>

<a href="<?php echo site_url('result/calculation/'.$back);?>"  class="btn btn-primary"><?php echo $this->lang->line('back');?></a>
&nbsp;&nbsp;
<?php
 $next=$limit+($this->config->item('number_of_rows'));  ?>

<a href="<?php echo site_url('result/calculation/'.$next);?>"  class="btn btn-primary"><?php echo $this->lang->line('next');?></a>


</div>


<script type="text/javascript">
function showDiv(select){
   if(select.value==1){
    document.getElementById('without_negative').style.display = "block";
    document.getElementById('with_negative').style.display = "none";
   } else{
    document.getElementById('without_negative').style.display = "none";
    document.getElementById('with_negative').style.display = "block";
   }
} 
</script>