<?php
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============
/*$table_name="_int_institute_setup";
$column="_id,_name,_status,_remarks";
$where_cond=" _type='ST' AND _status!='D'";*/

//View_all_data_row_column_By_Cond
$branch_id=$_SESSION['LOGIN_BRANCH'];
$table=" _fee_late_fine lf
       LEFT JOIN _int_institute_setup_vw ins
          ON (lf._dept_id = ins.department_id)";
$column="_id,
       lf._branch_id,
       ins.branch,
       ins.shift_id,
       ins.shift,
       ins.medium_id,
       ins.medium,
       ins.class_id,
       ins.class,
       ins.department_id,
       ins.department,
       lf._branch_id,
       lf._late_fine_amount,
       lf._late_fine_date,
       lf._status,
       lf._entry_by,
       lf._entry_date,
       lf._update_by,
       lf._last_update";

/* $branch_id=$_SESSION['LOGIN_BRANCH'];
$table_name="_fee_late_fine"; */
$where_cond="_branch_id='$branch_id' AND  _Status!='D' GROUP BY ins.department_id ";



//$student_late_fine=$obj->Details_By_Cond($table_name,$where_cond);
?>
<div class="row-fluid">
								
								
	<table id="sample-table-22" class="table table-striped table-bordered table-hover">
		<thead>
			<th>Sl</th>
			<!--<th>Institute</th>
			<th>Branch</th>-->
			<th>Branch</th>
			<th>Shift</th>
			<th>Medium</th>
			<th>Class</th>
			<th>Department</th>
			<th>Late Fine</th>
			<th>Late Date</th>
			
			<th>Status</th>
			<th>Action</th>
		</thead>
		<tbody>
			<?php
				$sl=1;
				foreach($obj->View_all_data_row_column_By_Cond($table,$column,$where_cond)as $student_late_fine){
					extract($student_late_fine);
					
					if(!empty($student_late_fine['_late_fine_date']))
					{ if($student_late_fine['_late_fine_date']=='0000-00-00')
					{$f_date = '';}
					 else { $f_date = date('d/m/Y',strtotime($student_late_fine['_late_fine_date'])); 
					 }}	
					
					
					
					echo "<tr>";
					echo "<td>".$sl."</td>"; $sl++;
					echo "<td>".$student_late_fine['branch']."</td>";
					echo "<td>".$student_late_fine['shift']."</td>";
					echo "<td>".$student_late_fine['medium']."</td>";
					echo "<td>".$student_late_fine['class']."</td>";
					echo "<td>".$student_late_fine['department']."</td>";
					echo "<td>".$student_late_fine['_late_fine_amount']."</td>";
					echo "<td>".$f_date."</td>";
					
					if($student_late_fine['_status']=='A'){
						echo '<td>Active</td>';	
					}
					else{
						echo "<td>Inactive</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('.$student_late_fine['_id'].')"></i>&nbsp;&nbsp;';
							}
							if($_SESSION['delete']=='Y'){										
							echo '<i class="icon-trash bigger-170" onclick="delete_data('.$student_late_fine['_id'].')" ></i>';
							}
						echo '</td>';
					echo "</tr>";
					
				}
			?>
		</tbody>	

	</table>
</div>
<script type="text/javascript">
	
				
				var oTable2 = $('#sample-table-22').dataTable( {
				"aoColumns": [
			      { "bSortable": true },
			      null, null,null, null,null,null,null,
				  { "bSortable": true }
				] } );
				
				
				
			
</script>
<script type="text/javascript">
	$('.date-picker').datepicker().next().on(ace.click_event, function(){
     $(this).prev().focus();
    });
</script>