<?php
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
$branchid = $_SESSION['LOGIN_BRANCH'];
extract($_GET);
//"&f_month="+f_month+"&f_year="+f_year+"&to_month="+to_month+"&to_year="+to_year;
// echo $section_id.'<br/>';

// echo $f_month.'<br/>';
// echo $f_year.'<br/>';
// echo $to_month.'<br/>';
// echo $to_year.'<br/>';
if($f_month=='01'){$mo = 'January';}
if($f_month=='02'){$mo = 'February';}
if($f_month=='03'){$mo = 'March';}
if($f_month=='04'){$mo = 'April';}
if($f_month=='05'){$mo = 'May';}
if($f_month=='06'){$mo = 'June';}
if($f_month=='07'){$mo = 'July';}
if($f_month=='08'){$mo = 'August';}
if($f_month=='09'){$mo = 'September';}
if($f_month=='10'){$mo = 'October';}
if($f_month=='11'){$mo = 'November';}
if($f_month=='12'){$mo = 'December';}



if($to_month=='01'){$mo1 = 'January';}
if($to_month=='02'){$mo1 = 'February';}
if($to_month=='03'){$mo1 = 'March';}
if($to_month=='04'){$mo1 = 'April';}
if($to_month=='05'){$mo1 = 'May';}
if($to_month=='06'){$mo1 = 'June';}
if($to_month=='07'){$mo1 = 'July';}
if($to_month=='08'){$mo1 = 'August';}
if($to_month=='09'){$mo1 = 'September';}
if($to_month=='10'){$mo1 = 'October';}
if($to_month=='11'){$mo1 = 'November';}
if($to_month=='12'){$mo1 = 'December';}



				  
				   
?>

<style type="text/css">

th{

   font-size:13px;
   text-align: center;


}

i{
	cursor:pointer;
}

.select_list{
	width: 200px;
}

.input_sub{
	width: 185px;
}
.select_list1{
	width: 100px;
	float: left;
	margin-left: 3px;
	margin-right: 3px;
}


</style>

<script src="module/fees/js/student_fee_details.js" type="text/javascript"></script>

<div class="page-content" id="tab">
    <legend style="text-align:center;">
    Section Fee Collection Summery (<?php echo $mo.'/'.$f_year.' - '.$mo1.'/'.$to_year; ?>)
    </legend>


    
<div class="row-fluid"  style="margin-top: 15px;" >

        
			

	<table id="sample-table-121" class="table table-striped table-bordered table-hover"  >
		<thead style="">
			<th>Sl</th>
			<th>Student Id</th>
			<th>Name</th>
			<th>Section Roll</th>
			<th>Contact Number</th>
			
			<th >Total Amount (.TK)</th>
			<th>Paid Amount (.TK)</th>
			<th>Due Amount (.TK)</th>
			<th>Action </th>
			
			
			
		</thead>
		<tbody>
<?php
$i=0;
//$where = " _section_id='$section_id' AND _month='$month' AND _year='$year' AND pmi._status!='AD'";
foreach($obj->sec_fee_std_detail($section_id,$f_month,$to_month,$f_year,$to_year) as $value_head){
extract($value_head);
$i++;
$std_id= $value_head['_std_id'];

?>       
        <tr>
		    <td><?php echo  $i; ?></td>
		    <td><?php echo  $value_head['_uniq_id']; ?></td>
		    <td><?php echo  $value_head['_full_name']; ?></td>
		    <td><?php echo  $value_head['_section_roll']; ?></td>
		    <td><?php echo  $value_head['_contact_mobile']; ?></td>	
		    <td style="text-align:center;"><?php echo  $value_head['st_total']; ?></td>	    
		    <td style="text-align:center;"><?php echo  $value_head['p_total']; ?></td>
		    <td style="text-align:center;"><?php echo $value_head['up_total']; ?></td>
		    <td>
		    	<button type="button" class="btn btn-mini btn-warning no-border" onclick="student_fee_details('<?php echo $std_id; ?>','<?php echo $section_id; ?>','<?php echo $f_month; ?>','<?php echo $to_month; ?>','<?php echo $f_year; ?>','<?php echo $to_year; ?>')">
						<i class="icon-reply icon-only bigger-150"></i>
						Details
				</button>
		    </td>
		    


		</tr>

<?php } ?>
       </tbody>
       
       <tfoot>
<?php
$i=0;

foreach($obj->month_du_std_tdetail($section_id,$f_month,$to_month,$f_year,$to_year) as $value_){
extract($value_);
$i++;

?> 
		    <tr style="background-color: #e0e0d1;">
		      <td colspan="5" style="text-align:center; font-weight: bold;">Total</td>
		      
		      <td style="text-align:center;"><?php echo  $value_['_total']; ?></td>
		      <td style="text-align:center;"><?php echo  $value_['_paid']; ?></td>
		      <td style="text-align:center;"><?php echo  $value_['_unpaid']; ?></td>
		      <td style="text-align:center;"></td>
		      
		    </tr>
<?php } ?>
		</tfoot>
</table>

</div>
</div>
<div class="row-fluid" id="part2">
         
      
</div>



 
<script type="text/javascript">

// function student_fee_details($section_id,$f_month,$to_month,$f_year,$to_year){
// var std_id = '<?php echo $std_id; ?>';
// var section_id = '<?php echo $section_id; ?>';
// var f_month = '<?php echo $f_month; ?>';
// var to_month = '<?php echo $to_month; ?>';
// var f_year = '<?php echo $f_year; ?>';
// var to_year = '<?php echo $to_year; ?>';
// //$section_id,$f_month,$to_month,$f_year,$to_year
//  // alert(std_id);
//  // exit();

// var datas="std_id="+std_id+"&section_id="+section_id+"&f_month="+f_month+"&to_month="+to_month+"&f_year="+f_year+"&to_year="+to_year;
// alert(datas);
// // exit();
// // $('#tab').css('display','none');

// $.ajax({
// type:"post",
// url:"module/fees/student_fee_details_sum.php",
// data:datas,
// success:function(st){

// //alert(st);
// $('#tab11').remove();
// $("#tab").html(st);


// }

// }); 		
// }





</script>
