<?php
session_start();
// ============
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============
$branchid = $_SESSION['LOGIN_BRANCH'];

?>
<div class="row-fluid">
        <table id="sample-table-2" class="table table-striped table-bordered table-hover">
		      
			  <thead>
			  <th>SL</th>
			  <!--<th>Department</th>-->
			  <!--<th>Subject</th>-->
			  <th>Class Test</th>
			  <th>Term Name</th>
			  <!--<th>Assign Mark</th>-->
			  <!--<th>Pass Mark</th>-->
			  <th>Status</th>
			  <th>Action</th>
			  </thead>
			  
			  
			  <tbody>
			        <?php
					$sl=1;
				
				    foreach($obj->View_all_data_row_column_By_Cond("_ct_class_test_add","_id,_ct_name,_exam_term,_status","1=1") as $value){
						$term_id = $value['_exam_term'];
						$term_info = $obj->Details_By_Cond("_int_exam_term","_id=$term_id");
				    	if($value['_status']=='1'){
				    		$status='Active';
				    	}
				      else if($value['_status']=='0'){
				    		$status='inactive';
				    	}
				    	else{
				    		$status='Deleted';
				    	}
				    	
			      
				    
					echo "<tr>";
					echo "<td>".$sl."</td>";$sl++;
					//echo "<td>".$value['_name']."</td>";
					//echo "<td>".$value['_subject_full_name']."</td>";
					echo "<td>".$value['_ct_name']."</td>";
					echo "<td>".$term_info['_term_name']."</td>";
					//echo "<td>".$value['_assign_mark']."</td>";
					//echo "<td>".$value['_pass_mark']."</td>";
					
					if($status=='Active'){
					echo "<td><span class='label label-success'>".$status."</span></td>";
				     }

				     else if($status=='inactive'){
				     	echo "<td><span class='label label-warning'>".$status."</span></td>";

				     }

					
					 echo '<td>';
							if($_SESSION['edit']=='Y'){
							echo '<i class="icon-edit bigger-170" style="hover:cursor;" href="#modal-table" data-toggle="modal" onclick="show_edit_view('.$value['_id'].')"></i></i>&nbsp;&nbsp;';	
							}
						
							if($_SESSION['delete']=='Y'){
							echo '<i class="icon-trash bigger-170" onclick="delete_data('.$value['_id'].')" ></i>';
							}
						echo '</td>';
					echo "</tr>";
					}
					?>
			  </tbody>
			  
		</table>
</div>
</br>
<script type="text/javascript">
	
				
		var oTable2 = $('#sample-table-2').dataTable( {
		"aoColumns": [
	      { "bSortable": true },
	      null, null,null, null,
		  { "bSortable": true }
		] } );
		
				
				
			
</script>