<?php include('parent/callMe.php');?>

<?php include('Sessioncheck.php');?>

<?php

$branch=$_SESSION['branch'];


$year=date("Y");









       

$sql = " select std.family_code,std.student_id,std.last_name,std.first_name,std.class_id,std.section_id,std.ref_no,std.candidate_roll_no, fee.* from  edu_student_details as std, eduportal_student_fee_structure as fee where std.student_id=fee.student_id AND std.status='0' AND std.branch_id='$branch'group by std.family_code order by CAST(std.family_code as unsigned)  asc";

//print_r($sql);

$WorkAssignListings = $m->query($sql);











 ?>



<!DOCTYPE HTML>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Print Family Report</title>

<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />

<script type="text/javascript">

// window.print();

</script>

<style type="text/css">



tr th {padding:1%;border-bottom:1px solid gray;border-top:1px solid gray;border-left:1px solid gray;text-align:center;background-color:lightgray;font-size:14px;}

tr td {border-bottom:1px solid gray;border-left:1px solid gray;font-size:16px;}

  

.border{border:1px solid black;}

.center{text-align:center;}

.alignment{padding-left:1%;text-align:left;}







@media print {

    #Header, #Footer { display: none !important; }

}

@media screen

   {

      p.bodyText {font-family:verdana, arial, sans-serif;}

   }



   @media print

   {

      p.bodyText {font-family:georgia, times, serif;}

   }

   @media screen, print

   {

      p.bodyText {font-size:10pt}

   }

   @media print {

  a[href]:after {

    content: none !important;

  }

}

</style>

</head>

<body style="font-size:12px;">







<div style="text-align:center;font-size:24px;font-weight:bold;margin:0 auto;"><?php echo $brid[0]['Branch_Name'];?> 



</div>



<br>





    

    <div style="text-align:center;font-size:18px;font-weight:bold;"> Family Annual Fee Report

    </div>







 



<hr style="width:100%;" />



<div style="width:50%;text-align:center;float:left;font-size:16px;"> <b> Year:</b> <?php echo date("Y");?> </div>



<br>

   

    <table id="listofstudents" class="table table-bordered"  style="width:100%;border-collapse: collapse;">

 

        <thead>

            <tr>

              

                <th width="1%">S.No</th>

                <th width="10%">Family Name / Code</th>

                <th width="8%">Students Name</th>                                

                <th width="8%">Total</th>

                <?php

                for ($mm=1; $mm<=12; $mm++) { 



                $monthss = date('F', mktime(0,0,0,$mm, 1, date('Y')));

                ?>



               <th style="background: white;font-size:10px;" width="3%" class=" center"><?php echo substr($monthss, 0, 3);?></th>



                <?php } ?>

           

              

                                

            </tr>

        </thead>

        <tbody>





   

     

     <?php 

$count=1;

      foreach($WorkAssignListings as $WorkAssignListVal)

      { 

  

  $m->where("Month_Id", $_REQUEST['month']);

  $months=$m->get("eduportal_month_config");



  $cell=$WorkAssignListVal['family_code'];

  $StudId=$WorkAssignListVal['student_id'];



  $sqll = " select std.family_code,std.student_id,std.last_name,std.first_name,std.class_id,std.section_id,std.ref_no,std.candidate_roll_no from  edu_student_details as std where std.status='0' AND std.branch_id='$branch' And std.family_code='$cell'";

  //print_r($sqll);

  $studentDatas = $m->query($sqll);


  $year=date("Y");

   ?>



        



          <?php 



              $stdID=$studentData['student_id'];



            /* $qr22="SELECT * FROM eduportal_monthly_challan WHERE branch_id='$branch' and month_id='$month' and year='$year' and student_id='$stdID'";

            //print_r($qr);

              $Challandetails = $m->query($qr22);*/





/*$adm=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],1,$m);

$papr=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],2,$m);

$misc=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],3,$m);

$stati=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],4,$m);

$oth=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],5,$m);

$reg=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],6,$m);

$sec=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],7,$m);

$anual=getFeeOfOtherParameter($studentData['student_id'],$Challandetails[0]['challan_id'],8,$m);



$other_totals=$adm+$papr+$misc+$stati+$oth+$reg+$sec+$anual;*/







/*

              $payableAmount=$Challandetails[0]['tutionfee']+$Challandetails[0]['transportfee']+$Challandetails[0]['collected_fine']+$Challandetails[0]['balance']+$Challandetails[0]['misc_fee']+$other_totals-$Challandetails[0]['disc_amount'];



              $totalReceived=$Challandetails[0]['collected_amount']+$Challandetails[0]['paid_again_amount'];



              $remaningAmount=$payableAmount-$totalReceived;



                

              /*if ($remaningAmount>0) {

                continue;

              }*/



          /*    $totalPayAbleAmount+=$payableAmount;

              $totalReceivedAmount+=$totalReceived;

              $totalRemaningAmount+=$remaningAmount;*/



           ?>

          <tr>

          <td><?php echo $count++;?></td>

          <td><b><?php echo $WorkAssignListVal['last_name']." (".$WorkAssignListVal['family_code'].")";?></b></td>

          <td>

          <?php  foreach ($studentDatas as $studentData) { 

           echo $studentData['first_name']."/".getClassName($m,$studentData['class_id'])."/".getSectionName($m,$studentData['section_id']).", ";

          } ?>

          </td>

               

         

       

          <td><?php echo $payableAmount;?></td>



          <?php

                for ($mm=1; $mm<=12; $mm++) { 



                $monthss = date('F', mktime(0,0,0,$mm, 1, date('Y')));

                ?>

             

               <td  style="background: white;font-size:10px;" width="3%" class=" center"><?php //echo substr($monthss, 0, 3);?></td>

             



                <?php } ?>

     

         

          </tr>



   <?php $totalPayAbleAmount="";$totalReceivedAmount="";$totalRemaningAmount="";

      }  ?>

        

        </tbody>

        

    </table>



</body>

</html>

