<html>
    <head>
        <title><?php echo $b_header['title']; ?></title>
  
  <style type="text/css">
  @page  
{ 
    size: auto;   /* auto is the initial value */ 

    /* this affects the margin in the printer settings */ 
    margin: 0mm 0mm 25mm 0mm;  
} 


    BODY, TD
    {
      background-color: #ffffff;
      color: #000000;
      font-family: Arial;
      font-size: 6pt;
    }
    #legalcopy{
  margin-top: 5mm;
}

TH{font-size: 6pt;}
 .tbl1
            {
                border: 1px solid #000;
                text-align:center;
                
            }
         
  </style>
    </head>
    <body class="clear">
<?php 
date_default_timezone_set("Asia/Karachi");
$t1 = $total;
$t2 = $total;
$t3 = $total;
$branch=$this->user_model->getbranch();
// var_dump($branch);exit;
$branch_fine_type=$this->db->where('id',$branch)->get('branch')->row()->fine_type;
// echo $branch_fine_type;exit;
?>
 
                 <div class="wd-100 clear">
                    <div class=" text-left center ">
                        <img src="<?php echo base_url().$b_header['logo1']; ?>" style="width:50px;height:50px;">
                      
                    </div>
                  
                    <div id="ex1" >
                         <!--<center><h2>Shah Latif Model High School Daharki</h2></center>-->
                         <center><h2><?php echo $b_header['name']; ?></h2></center>
                          <!--<center><h4><?php echo $b_header['title']; ?></h4></center>-->
                           <center><h4><i><?php echo $b_header['tagline']; ?></i></h4></center>
                         
                        <center><h4>Phone No. <?php echo $b_header['phone_no']; ?></h4></center>
                       
                    </div>
                </div>
           <hr>
            <div class="body">
                           
               
                    <h3 style="text-align: left">Invoice # <span style="float:right;"><?php echo $invoice['id']; ?></span></h3>
                    <h3 style="text-align: left">GR.No:<span style="float:right;"><?php echo $student['grno']; ?></span> </h3>
                    <h3 style="text-align: left">Name:<span style="float:right;"><?php echo $student['student_name']; ?></span></h3> 
                    <h3 style="text-align: left">Parent's Name:<span style="float:right;"><?php echo $student['father_name']; ?></span></h3> 
                    <h3 style="text-align: left">Class:<span style="float:right;"><?php echo $student['class_name']." / ".$student['section_name']; ?></span></h3> 
                    <h3 style="text-align: left">Month<span style="float:right;"><?php echo date("F-Y",strtotime($invoice['date'])); ?></b></h3> 
                    <h3 style="text-align: left">Sumitted Date:<span style="float:right;"><?php echo date("d-m-Y",strtotime($invoice['submitted_at'])); ?></span></h3> 
                             
                           
                            
                        </div>
  
            
                <div class="row clear ">
                   
                    <table class="tbl1" width="510">
                    <tr class="tabletitle"><th><h2>HEAD</h2></th><th><h2>AMOUNT</h2></th></tr>
                    <tr><td class="legal"><h4>Tuition Fee</h4> </td><td class="legal"><h4><?php echo $invoice['fee_pack']; ?></h4></td></tr>
                    <!-- <tr>-->
                    <!--      <td class="legal"><h4>Arrears</h4></td>-->
                    <!--      <td class="legal"><b><?php echo $lastrem; ?></b></td>-->
                    <!--</tr>-->
                    <?php foreach($fee as $k=>$v){ ?>
                    <tr><td class="legal"><?php echo $v['name']; ?></td><td class="legal"><h4><?php echo $v['amount']; ?></h4></td></tr>
                    <?php } foreach($add_months as $k=>$v){ ?>
                    <tr><td class="legal"><h4><?php echo "Tuition fee for ".date('F Y',strtotime($v['month']));; ?></h4></td><td class="legal"><h4><?php echo $v['fee']; ?></h4></td></tr>
                    <?php } if(!empty($lastadv)){?>
                    <tr>
                          <td class="legal"><h4>Last Month Advance</h4></td>
                          <td class="legal"><h4><?php echo $lastadv; ?></h4></td><h4><?php $t1 = $t1 - $lastadv; ?></h4>
                    </tr>
                    <?php } if($invoice['is_admitted']==1){?>
                    <tr>
                          <td class="legal"><h4>Admission fee</h4></td>
                          <td class="legal"><h4><?php echo $invoice['admin_fee']; ?></h4></td><h4><?php $t1 = $t1 + $invoice['admin_fee']; ?></h4>
                    </tr>
                    <?php } if($invoice['status'] == 1){?>
                    <tr>
                          <td class="legal"><h4>Received</h4></td>
                          <td class="legal"><h4><?php echo $invoice['recieved']; ?></h4></td><h4><?php $t1 = $t1 - $invoice['recieved']; ?></h4>
                    </tr>
                    <tr>
                          <td class="legal"><h4>Discount (in Ksh)</h4></td>
                          <td class="legal"><h4><?php echo $invoice['discount']; ?></h4></td><h4><?php $t1 = $t1 - $invoice['discount']; ?></h4>
                    </tr>
                    <?php } if(!empty($lastrem)){?>
                   
                    <?php } ?>
                     <?php if($invoice['status']==1){ ?>
                        <tr><td class="legal"><h4>Total Remaining</h4></td><td class="legal"><h4><?php $t1 = $invoice['remaining'];echo $invoice['remaining']; ?></h4></td></tr>
                    <?php }else{?>
                        <tr><td class="legal"><h4>Total Remaining</h4></td><td class="legal"><h4><?php $t1 = ($t1 < 0)?0:$t1;echo $t1+$lastrem; ?></h4></td></tr>
                    <?php } ?>
                
                    </table>
                    
                </div>
					</div>
            
     

    </body>
    <script>
        window.print();
    </script>
</html>
