<?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");



?>



<!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 Triple Voucheres</title>

<!-- Favicons-->

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



<script type="text/javascript">

  window.print();

</script>

<style>

  

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

tr th {background-color:lightgray;text-align:center;font-size:14px;border:1px solid gray;height: 21px;}

tr td {border-bottom:1px solid black;border-left:1px solid black;padding:1%;height: 21px;}



  

@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;

  }

}





   body {

    width: 100%;

    height: 100%;

    margin: 0;

    padding: 0;

    background-color: #FAFAFA;

    font-weight:bold;

    font-size:15px;

    /*font: 12pt "Tahoma";*/

}

* {

    box-sizing: border-box;

    -moz-box-sizing: border-box;

}

.page {

    width: 355mm;

    min-height:215mm;        

    padding-left:5mm;

    padding-top:5mm;

    padding-bottom:35mm;

    margin: 10mm auto;

    border: 1px #D3D3D3 solid;

    border-radius: 5px;

    background: white;

    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);

}

.subpage {

    width: 355mm;

    height:215mm;

    

}



@page {

    size: legal landscape;

    margin: 0;

}

@media print {

    html, body {

        width:355mm;

        height:215mm;        

    }

    .page {

        margin: 0;

        border: initial;

        border-radius: initial;

        width: initial;

        min-height: initial;

        box-shadow: initial;

        background: initial;

        page-break-after: blue;

    }

}





  </style>

<style>@page { size: legal landscape }</style>

</head>

<body>







<?php 

$WorkAssignValue=$WorkAssignListings;

$valueStart=$_REQUEST['valueStart'];

$valueEnd=$_REQUEST['valueEnd'];



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



 





?>





  <div class="book">

    <div class="page">

        <div class="subpage">









<div style="float:left;">





<?php

$array1=array("Bank Copy"," Institute Copy","Student Copy");



 for($i=0; $i<3;$i++){ ?>



 <!-- Vouchere Fist -->

<div class="section" style="<?php if($i==2){echo 'border-right:none;';}?>">

   

   <div style="width:100%; text-align:center; height:auto;font-size:12px;color:black;">

            <?php echo $array1[$i]; ?>



   </div>



   <div style="">

        

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

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

        </div>

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



      </div>

      <br><br>

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

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



<hr>



<?php  



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

  $accounts=$m->get("edu_branch_bank_details");

  if(count($accounts)>0){



  if($accounts[0]['bank_accountitle']!=NULL){

?>



   <div style="width:100%; font-size:12px;text-align:left; height:16px; float:left;">



        <b> Acc Title: <?php  echo $accounts[0]['bank_accountitle'];?></b> 

   </div>



   <div style="width:100%; font-size:12px;text-align:left; height:16px; float:left;">



         <b>Bank: (<?php  echo $accounts[0]['bank_branch'];?>) 

          <?php  echo $accounts[0]['bank_accountno'];?> </b>

   </div>



<hr>



<?php 

}

?>

   

<?php 

}

?>











   <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['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;">  Issue 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="30%" 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;background-color: lightgray;"> Due Date   </td>        

      </tr>



         

       <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 



$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);



$counter=69/count($studentDatas);





    $other_fee;



     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'];



      ?>



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

   



       <tr>

         <th style="border-right: 1px solid gray;" > <?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;background-color: lightgray;">  <?php echo date("d-M-Y",strtotime($studentFeeData[0]['challan_duedate']));?>   </td>        

      </tr>



          

       <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 ($studentFeeData[0]['disc_amount']/$studentFeeData[0]['tutionfee']*100)."% (".$studentFeeData[0]['disc_amount'].")";?></td>

         

      </tr>

   <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;



     ?>

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

  



   </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>



   <?php  $GrandTotal="";

          $other_fee=""; ?>











   <br>



   <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;">  (Signature & Stamp) <br><br>

            

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



          </td>

         

         </tr>

   </table>





  </div>









    <?php } ?>



    </div>









        </div>    

    </div>      

   </div>



<br><br>





<?php  $other_fee="";

}

 ?>



</body>

</html>