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


 $m->where("student_id", $_GET['student_id']);
$discount=$m->get("eduportal_student_fee_structure");

//getting branch details 

$branch=getBranch($m);

$month_id=$_GET['month_id'];

$sql = " select std.*, fee.* from  edu_student_details as std, eduportal_monthly_challan as fee where std.student_id=fee.student_id AND std.status='0' AND fee.month_id='$month_id' AND std.branch_id=".$_SESSION['branch']." AND fee.student_id=".$_REQUEST['student_id'];


if ($_REQUEST['session']!=NULL) {
    $sql .= " AND fee.session_id =" . $_REQUEST['session']. " ";
}

if ($_REQUEST['class_id']!=NULL) {
    $sql .= " AND fee.class_id =" . $_REQUEST['class_id']. " ";
}


//echo $sql1;

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


// now getting the other fee parameters of student against selected month



$fee_fine;

if(date("Y-m-d")>$WorkAssignListings[0]['challan_duedate']){
$fee_fine=$branch[0]['late_fee_fine'];
 }
 else {
$fee_fine=0;
 }



$total_fee=intVal($WorkAssignListings[0]['tutionfee'])+intVal($WorkAssignListings[0]['transportfee'])+intVal($WorkAssignListings[0]['balance'])+intVal($WorkAssignListings[0]['misc_fee']);


// print_r($challan); 

  $m->where("class_id", $discount[0]['class_id']);
  $class_fee = $m->get("eduportal_class_fee_details");
  $class_standerd_fee=$class_fee[0]['tution_fee'];

?>
 <!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 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:28%; height:auto;float:left;padding-right:2%;margin-left:2%;margin-top:2%;}
     
tr th {background-color:gray; text-align:center;font-size:14px;border:1px solid black;}
tr td {border-bottom:1px solid black;border-left:1px solid black;padding:1%;}

@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>
<?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: 2px solid black;border-right-style:dotted;';}?>">
   
   <div style="width:100%; text-align:center; height:auto;font-size:12px;">
            <?php echo $array1[$i]; ?>

   </div>
 

      <div style="">
        
        <div style="width:25%;float: left;">
            <img src="<?php echo DOMAIN.AgentDirectory;?>img/aliedbank.jpg" style="height:100px;width:80px;" />    
        </div>
        <div style="width:75%;font-size:35px;float: right;margin-top: 35px;text-align:center;">Allied Bank</div>
        <div style="text-align: center;">MITHI BARANCH - 0090</div>
        <div style="text-align: center;margin-top: 11px;text-align: center;
    margin-top: 11px;font-size: 13px;width: 100%;background-color: #193c76;color:white;padding: 2%;">

        AL-MEHRAN PUBLIC HIGH SCHOOL MITHI

        <br>

        A/C No. 0010048198690022

      </div>

       <br>
            

          </div>

      
   
      <div style="width: 40%; height: 22px; border: 1px solid black; text-align: center; font-weight: bold;" >Issue Date</div>
      <div style="width: 40%; height: 22px; border: 1px solid black; text-align: center;"><?php echo date("d-M-Y");?></div>
      <div style="width: 40%; height: 22px; border: 1px solid black; float: right;margin-top: -44px;text-align: center; font-weight: bold;" >Due Date</div>
      <div style="width: 40%; height: 22px; border: 1px solid black; float: right;margin-top: -21px;text-align: center;"><?php echo date("d-M-Y",strtotime($WorkAssignListings[0]['challan_duedate']));?></div>



<br>
<div style="width: 30%; float: left;font-weight:bold;">Name: </div>
<div style="width: 70%; float: right;"><?php echo $WorkAssignListings[0]['first_name'];?> </div>
<br><br>
<div style="width: 35%; float: left;font-weight:bold;">Father Name: </div>
<div style="width: 65%; float: right;"><?php echo $WorkAssignListings[0]['last_name'];?> </div>
<br>
<div style="width: 25%; float: left;font-weight:bold;">Class: </div>
<div style="width: 25%; float: left;"><?php echo getClassName($m,$WorkAssignListings[0]['class_id']);?> (<?php echo  getSectionName($m,$WorkAssignListings[0]['section_id']);?>) </div>
<div style="width: 25%; float: left;font-weight:bold;">Month: </div>
<div style="width: 25%; float: left;"><?php echo getMonthName($m,$WorkAssignListings[0]['month_id']);?> </div>

<div><u>Discription</u></div>
<div style="width: 50%;float: left;background-color: lightgray;font-weight:bold;">Particulars</div>
<div style="width: 50%;float: right;background-color: lightgray;text-align: right;font-weight:bold;">Amount</div>
<br><br>
<div style="text-align: right;">Charges to be currently Paid</div>



 <table width="100%" style="font-size:11px;margin-top:2%;" cellspacing="0">  
   
    <?php 
      $m->where("feetype_id", 1);
      $adm_fee = $m->get("eduportal_fee_types");
          
        $admfees=getFeeOfOtherParameter($WorkAssignListings[0]['student_id'],$WorkAssignListings[0]['challan_id'],$adm_fee[0]['feetype_id'],$m);
        
   ?>

      <tr>  
         <td width="70%" style="border-top: 1px solid black;"> Admission Fee   </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;border-top: 1px solid black;">  <?php 
             echo $admfees;  ?> </td>
      </tr>
      
      
         
      <tr>  
         <td width="70%"> Monthly Fee   </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;">  <?php echo $WorkAssignListings[0]['tutionfee'];?>  </td>
      </tr>

      <?php 
      $m->where("feetype_id", 2);
      $papr_fee = $m->get("eduportal_fee_types");
      
     
        $paprfees=getFeeOfOtherParameter($WorkAssignListings[0]['student_id'],$WorkAssignListings[0]['challan_id'],$papr_fee[0]['feetype_id'],$m);
        
   ?>
     
      <tr>  
         <td width="70%"> Examination Fee   </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;">  <?php 
             echo $paprfees;  ?>  </td>
      </tr>
  
    <?php 
      $m->where("feetype_id", 5);
      $othr_fee = $m->get("eduportal_fee_types");
      
     
        $othrfees=getFeeOfOtherParameter($WorkAssignListings[0]['student_id'],$WorkAssignListings[0]['challan_id'],$othr_fee[0]['feetype_id'],$m);
        
   ?>

      <tr>  
         <td width="70%"> Any Other Fee   </td>

         <td width="30%" style="text-align:center;border-right:1px solid gray;">  <?php 
             echo $othrfees;  ?>  </td>
      </tr>
 
   </table>

   <div style="text-align: right;">Former unpaid Charges & Dues</div>
   
      <table width="100%" style="font-size:11px;margin-top:2%;" cellspacing="0">  
   

      <tr>  
         <td width="70%" style="border-top: 1px solid black;"> Total Amount <br>Payable with in due date  </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;border-top: 1px solid black;">  <?php echo $WorkAssignListings[0]['tutionfee']+$admfees+$paprfees+$othrfees;?> </td>
      </tr>
      
         
      <tr>  
         <td width="70%"> Late Payment Surcharges   </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;">  <?php  echo $fee_fine;?>  </td>
      </tr>
     
      <tr>  
         <td width="70%"> Total Amount <br> Payable after due date  </td>
         <td width="30%" style="text-align:center;border-right:1px solid gray;">  <?php echo $WorkAssignListings[0]['tutionfee']+$admfees+$paprfees+$othrfees+$actual_fine;?>  </td>
      </tr>
  
    <tr>  
      <td width="100%" colspan="2" style="text-align:center;border:none;"> <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>

   <br>
   <div style="width: 45%; float: left;">Admin Officer</div>
   
   <div style="width: 55%; float: right;">Bank Authorize Officer</div>

</div>


</div>


<?php } ?>

</body>
</html>
