<?php
$dt=$_GET['dt'];
$sm=$_GET['sem'];
$course=$convert->decode($dt);
$sem=$convert->decode($sm);
$page=$_GET['page'];
?>
		<!-- Specific Page Vendor CSS -->
		<link rel="stylesheet" href="assets/vendor/select2/select2.css" />
		<link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />


<section role="main" class="content-body">
					<header class="page-header">
						<h2>View Program Report <?php echo $course; ?></h2>
					
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="index.html">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span></span></li>
								<li><span>Advanced</span></li>
							</ol>
					
							<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
						</div>
					</header>

					<!-- start: page -->
						<section class="panel">
							<header class="panel-heading">
								<div class="panel-actions">
									<a href="#" class="fa fa-caret-down"></a>
									<a href="#" class="fa fa-times"></a>
								</div>
						
								<h2 class="panel-title">View Semester Fees MIS</h2>
							</header>
							<div class="panel-body">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('#select_all').on('click',function(){
        if(this.checked){
            $('.checkbox').each(function(){
                this.checked = true;
            });
        }else{
             $('.checkbox').each(function(){
                this.checked = false;
            });
        }
    });
    
    $('.checkbox').on('click',function(){
        if($('.checkbox:checked').length == $('.checkbox').length){
            $('#select_all').prop('checked',true);
        }else{
            $('#select_all').prop('checked',false);
        }
    });
});
</script>
<form action="program-report.php" method="post" target="_blank"	>
<input type="hidden" name="course" value="<?php echo $dt; ?>" />						
<input type="hidden"  name="sem" value="<?php echo $sm; ?>" />
								<table cellpadding="0" cellspacing="0" width="100%" class="table table-bordered table-striped mb-none"id="tab1">
								<tr><td width="2%" height="20"><b>
								  <input type="checkbox" name="checkAll" id="select_all"/></td>
								<td width="3%" height="20"><b>S.No.</b></td>
								<td width="8%"><b>SID</b></td>
								<td width="54%"><b>Student Name</b></td>
								<td width="33%"><b>Fees</b></td>
								</tr>
								<?php
								echo "SELECT * FROM `finance_student_list` WHERE `course` = '$course' AND `sem` = '$sem' ORDER BY `student_name` ASC";
								$GetList=mysql_query("SELECT * FROM `finance_student_list` WHERE `course` = '$course' AND `sem` = '$sem' ORDER BY `student_name` ASC");
								while($GetList1=mysql_fetch_assoc($GetList))
								{
								 $s =$_REQUEST['v'];

						$u = $s+0;
								?>
								<tr>
								<td><input type="checkbox" name="book[]" class="checkbox" value="<?php echo $GetList1['id']; ?>"></td>
								<td><?php echo $_REQUEST['v'] = $u+1;  ?>.</td><td><?php echo $GetList1['sid']; ?></td><td><?php echo $GetList1['student_name']; ?></td><td>
								<?php
								$GetStId=mysql_query("SELECT * FROM `sgvu_finance_payment_varify` WHERE `sid` = '$GetList1[sid]'");
								$GetStId1=mysql_fetch_assoc($GetStId);
								if($GetStId1['payment_mode'] =='1')
								{
								$GetPay=mysql_query("SELECT * FROM `sgvu_fin_bank_mis` WHERE `trans_no` = $GetStId1[trans_id]");
								$GetPay1=mysql_fetch_assoc($GetPay);
								echo $tot[]=$GetPay1['total'];
								echo ' (Offline)';
								
								}
								if($GetStId1['payment_mode'] =='2')
								{
								
								$GetOnlinePay=mysql_query("SELECT * FROM `sgvu_payu-mis` WHERE `transaction_id` = '$GetStId1[trans_id]'");
								$GetOnlinePay1=mysql_fetch_assoc($GetOnlinePay);
								echo $tot1[]=$GetOnlinePay1['amount'];
								echo ' (Online)';
								
								}
								?>
								
								</td></tr>
								<?php
								}
								?><tr><td width="2%" height="20"></td>
								<td width="3%"></td>
								<td width="8%"></td>
								<td width="54%" align="right"><b>Grand Total</b></td>
								<td width="33%"><b><?php
								echo $gran_tot=array_sum($tot)+array_sum($tot1);

								?></b></td>
								</tr>
								</table>
								<div align="center">								<button type="submit" class="btn btn-primary"><i class="fa fa-print"></i> Print</button>
								
								
								</div>
							</div>
						</section>
						
						
						
						
					<!-- end: page -->
				
				</section>
		<!-- Vendor -->
		<script src="assets/vendor/jquery/jquery.js"></script>
		<script src="assets/vendor/bootstrap/js/bootstrap.js"></script>
			<script src="assets/vendor/magnific-popup/magnific-popup.js"></script>
	
		<!-- Specific Page Vendor -->
		<script src="assets/vendor/select2/select2.js"></script>
		<script src="assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
		<script src="assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
		<script src="assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
		<script src="assets/vendor/pnotify/pnotify.custom.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="assets/javascripts/theme.js"></script>
		
		<!-- Theme Custom -->
		
		<!-- Theme Initialization Files -->
		<script src="assets/javascripts/theme.init.js"></script>


		<!-- Examples -->
		<script src="assets/javascripts/tables/examples.datatables.default.js"></script>
		<script src="assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
		<script src="assets/javascripts/tables/examples.datatables.tabletools.js"></script>
		<script src="assets/javascripts/ui-elements/examples.modals.js"></script>
				