

<html>
    <head>
        <title><?php echo $b_header['title']; ?></title>
        <style>
            @media print
            {
                * {-webkit-print-color-adjust:exact;}
                @page {margin:0in 0.10in 0in 0in; }
                .super_container
                {
                    page-break-after: always;
                    margin-top:0.25in;
                    position:relative;
                    width:100vw;
                    height:710px;
                }
            }
            body {margin: 0.25in 0.25in 0.63in 0.25in; box-sizing:border-box;width:100vw; height:100vh;padding-bottom:0.63in;}
            *{margin:0;padding:0;font-family:calibri;}
            .clear:after{content:"";clear:both;display:block;}
            .left{float:left;}
            .right{float:right;}
            .wd-5{width:5%;}
            .wd-10{width:10%;}
            .wd-20{width:20%;}
            .wd-30{width:30%;}
            .wd-40{width:40%;}
            .wd-50{width:50%;}
            .wd-60{width:60%;}
            .wd-70{width:70%;}
            .wd-80{width:80%;}
            .wd-90{width:90%;}
            .wd-100{width:100%;}
            .wd-15{width:15%;}
            .wd-25{width:25%;}
            .wd-35{width:35%;}
            .wd-45{width:45%;}
            .wd-55{width:55%;}
            .wd-65{width:65%;}
            .wd-75{width:75%;}
            .wd-85{width:85%;}
            .wd-95{width:95%;}
            .wd-100{width:100%;}
            .title{font-size:35px;}
            .super_container
            {
                margin-bottom:200px;
                position:relative;
                width:100vw;
                height:710px;
            }
            .wrapper{
                border:4px transparent #18a05e;
                
                outline-offset: 5px;
                box-sizing: border-box;
                padding:5px;
            }
            .super_wrapper
            {
                position:absolute;
                top:0;
                left:0;
                width:100%;
                z-index:120;
                margin:0;
                padding:0;
            }
           
            .wrapper.left2{
                width: calc(90vw);
                margin-right: 20px;
                margin-left: 20px;
            }
            h1,h2,h3,h4,p{
                color:#191970;
                font-family:calibri;
                text-align:center;
            }
            .boxed{color:#000000;width:80%;margin:0 auto;}
            .header{
                width:100%;
                border-bottom:4px solid #191970;            
            }
            .body{
                padding:10px;
            }
            .row{
                width:100%;
                margin: 0px auto;  
            }
            .text-center{text-align:center;}
            .bold{font-weight:bold;}
            .b-u-l{
                border-bottom: 1px solid #000;
                height:inherit;
            }
            .x-small{
                font-size: 12px;
            }
            .x-x-small{
                font-size: 9px;
            }
            .page_break{
                width: 100vw;
                height: 100vh;
                padding: 10px 0px;
                box-sizing: border-box;
            }
            .tbl1
            {
                border: 1px solid #000;
                text-align:center;
                width:100%;
                min-height:20px;
            }
            th{
                font-size: 12px;
                border: 1px solid #000;
                  border-right: 0px;
                border-bottom: 0px; 
                background-color:#ccccb3; 
                padding: 3px !important;
            }
            td{
                font-size:12px;
                border: 1px solid #000;
                text-align: left;
                  border-right: 0px;
                border-bottom: 0px; 
                padding: 2px !important;
            }
            .normal{
                font-weight: normal !important;
            }
            .text-right{
                text-align: right !important;
            }
            .text-left{
                text-align: left !important;
            }
            .margin-a{margin: 30px auto 0px auto;}
        </style>
    </head>
    <body class="clear">
        <?php date_default_timezone_set("Asia/Karachi"); ?>
        <div class="super_container">
            <div class="page_break clear">
                <div class="watermark_wrapper">
                    <div class="watermark"></div>
                </div>
                <div class="super_wrapper">
                    <div class="wrapper left2 left">
                        <div class="header">
                            <div class="wd-100 clear">
                                <div class=" text-left left ">
                                    <img src="<?php echo base_url().$b_header['logo1']; ?>" style="width:50px;height:50px;">
                                </div>
                                <div class=" text-left right ">
                                    <img src="<?php echo base_url().$b_header['logo2']; ?>" style="width:50px;height:50px;">
                                </div>
                                <div>
                                    <center><h1><?php echo $b_header['title']; ?></h1></center>
                                    <center><h3 style="color:#000 !important;"><i><?php echo $b_header['tagline']; ?></i></h3></center>
                                  
      <center><h3 class="boxed" style="margin-top:0px !important;font-size:23px;">Fee Summary for <?php  echo date('M-Y',strtotime($month));?></h3></center>
                                </div>
                            </div>
                            <div class="wd-100 clear">
                                                                     
                            </div>
                        </div>
                        <div class="body">
                            <table class="tbl1">
                                <thead>
                        <tr>
                          <th rowspan="2">#</th>
                          <th rowspan="2" >Class</th>
                          <th rowspan="2" >Total Students</th>
                          <th rowspan="2" >Active Students</th>
                          <th rowspan="2" >Total Fee</th>
                           <th rowspan="2" >Fee Pack</th>
                          
                          <th colspan="2">Due</th>
                          <th colspan="6">Partial Received</th>
                          <th colspan="4">Received</th>
                         <th rowspan="2" >No of Students Voucher Not Created </th>
                          
                          
                        </tr>
                       <tr>
                          
                          <th>Student</th>
                          <th>Amount</th>
                          <th>Student</th>
                          <th>Amount</th>
                          <th>Received</th>
                          <th>Remaining</th>
                          <th>Fine</th>
                          <th>Discount</th>
                          <th>Student</th>
                          <th>Amount</th>
                          <th>Fine</th>
                          <th>Discount</th>
                        </tr>



                      </thead>
                        
                         
                      
                <?php 
                date_default_timezone_set("Asia/Karachi");
                //$month=date("Y-m");
               // $month="2018-11";
               $t_student = 0;$ta_student=0;$t_expected=0;
               $t_default = 0;$t_default_fee = 0;
               $t_partial = 0;$t_partial_fee = 0;$t_received_fee = 0;$t_remaining_fee = 0;$t_fine_fee = 0;$t_discount_fee = 0;
               $t_paid = 0;$t_paid_fee = 0;$t_received_fee = 0;$t_paid_fine_fee = 0;$t_paid_discount_fee = 0;
               $t_advance = 0;$t_feepack = 0; 
               $no_voucher=0;$t_no_voucher = 0; $to=0;
                $re=0;
                $price = array();
                    
                    // echo "<pre>";print_r($price);die;
                $i=1;  $def=0; $res=0; foreach ($class as $value) {
                ?>
                <tr>
                <td> <?php echo $i++  ?></td>
                <td> <?php echo  $value['class_name'];   ?> </td>
                <td style="text-align: right"><?php echo  $value['std'];$t_student += $value['std']; ?> </td> 
                <td style="background-color:#;text-align: right" > <?php $ta_student += $this->voucher_model->countactivestudent($value['id'],$branchId); echo number_format($this->voucher_model->countactivestudent($value['id'],$branchId));  $no_voucher = number_format($this->voucher_model->countactivestudent($value['id'],$branchId));?> </td>
                <td style="background-color:#;text-align: right" > <?php $t_expected += ($this->voucher_model->countexpected($value['id'],$month,$branchId));
                    echo number_format(($this->voucher_model->countexpected($value['id'],$month,$branchId)));  ?> </td>
                    <td style="background-color:#;text-align: right" > <?php $t_feepack += ($this->voucher_model->countfee_pack($value['id'],$month,$branchId));
                    echo number_format(($this->voucher_model->countfee_pack($value['id'],$month,$branchId)));  ?> </td>
               
                <td style="background-color:#;text-align: right" > <?php $t_default += $this->voucher_model->countdefult($value['id'],$month,$branchId); echo  $this->voucher_model->countdefult($value['id'],$month,$branchId);$no_voucher -=  $this->voucher_model->countdefult($value['id'],$month,$branchId);  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_default_fee=$t_default_fee+$this->voucher_model->count_amount_defult($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_amount_defult($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right" > <?php $t_partial += $this->voucher_model->countpartial($value['id'],$month,$branchId); echo  $this->voucher_model->countpartial($value['id'],$month,$branchId);$no_voucher -=  $this->voucher_model->countpartial($value['id'],$month,$branchId);  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_partial_fee+=$this->voucher_model->count_amount_partial($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_amount_partial($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_received_fee+=$this->voucher_model->count_received_partial($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_received_partial($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_remaining_fee+=$this->voucher_model->count_remaining_partial($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_remaining_partial($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_fine_fee+=$this->voucher_model->count_fine_partial($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_fine_partial($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_discount_fee+=$this->voucher_model->count_discount_partial($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_discount_partial($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php $t_paid+= $this->voucher_model->re_countdefult($value['id'],$month,$branchId);echo  $this->voucher_model->re_countdefult($value['id'],$month,$branchId);$no_voucher -=  $this->voucher_model->re_countdefult($value['id'],$month,$branchId);  ?> </td>
                <td style="background-color:#;text-align: right"> <?php
                
                  $t_paid_fee+=$this->voucher_model->re_count_amount_defult($value['id'],$month,$branchId);
                echo number_format( $this->voucher_model->re_count_amount_defult($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_paid_fine_fee+=$this->voucher_model->count_fine_paid($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_fine_paid($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php    
                       $t_paid_discount_fee+=$this->voucher_model->count_discount_paid($value['id'],$month,$branchId);
                echo  number_format($this->voucher_model->count_discount_paid($value['id'],$month,$branchId));  ?> </td>
                <td style="background-color:#;text-align: right"> <?php echo $no_voucher;$t_no_voucher+=$no_voucher;$no_voucher = 0;  ?> </td>
                <?php $t_advance+=$this->voucher_model->count_advance($value['id'],$month,$branchId); ?>
                </tr>
                <?php }
                
                ?>
                <tr>
                    <td colspan="2"><h4>Grand Total: </h4></td>
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_student);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($ta_student);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_expected);   ?> </td> 
                     <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_feepack);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_default);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_default_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_partial);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_partial_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_received_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_remaining_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_fine_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_discount_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_paid);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_paid_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_paid_fine_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_paid_discount_fee);   ?> </td> 
                    <td style="text-align: right;font-weight:bold;"><?php echo  number_format($t_no_voucher);   ?> </td> 
                        
                </tr>
                <!--<tr>-->
                <!--    <td colspan="2"><h4>Total Fee: </h4></td>-->
                <!--    <td colspan="2"><h4><?= $t_expected; ?></h4></td>-->
                <!--    <td colspan="2"><h4>Total Received: </h4></td>-->
                <!--    <td colspan="2"><h4><?= ($t_received_fee + $t_paid_fee); ?></h4></td>-->
                <!--    <td colspan="2"><h4>Total Remaining: </h4></td>-->
                <!--    <td colspan="2"><h4><?= ($t_default_fee + $t_remaining_fee); ?></h4></td>-->
                <!--    <td colspan="2"><h4>Total Fine: </h4></td>-->
                <!--    <td><h4><?= ($t_fine_fee + $t_paid_fine_fee); ?></h4></td>-->
                <!--    <td colspan="2"><h4>Total Discount: </h4></td>-->
                <!--    <td><h4><?= ($t_discount_fee + $t_paid_discount_fee); ?></h4></td>-->
                        
                <!--</tr>-->

                      <tbody>
                  
                      </tbody>
                    </table>

<br>
            <div class="wd-100 clear">
                <div class="wd-25 left ">
                    <h3 style="text-align: left">Summary:</h3>
                       
                </div>
            </div>
                           
                         <br>
                                        <div class="wd-100 clear">
                                            
                                            <div class="wd-30 right ">
                                              <h5 style="text-align: left"> Total Remaining: <?= ($t_default_fee + $t_remaining_fee) ?></h5>
                                            </div>
                                            <div class="wd-30 right ">
                                                <h5 style="text-align: left"> Total Received: <?= ($t_received_fee + $t_paid_fee) ?></h5>
                                            </div>
                                            <div class="wd-30 right">
                                                <h5 style="text-align: left"> Total Expected: <?= $t_expected ?></h5>
                                            </div>
                                            
                                        </div>
                                        <div class="wd-100 clear">
                                            <div class="wd-30 right">
                                                             <h5 style="text-align: left"> Total Late Fine: <?= ($t_fine_fee + $t_paid_fine_fee) ?></h5>
                                            </div>
                                            <div class="wd-30 right">
                                                             <h5 style="text-align: left"> Total Discount: <?= ($t_discount_fee + $t_paid_discount_fee) ?></h5>
                                            </div>
                                            <div class="wd-30 right">
                                                             <h5 style="text-align: left"> Total Advance: <?= $t_advance ?></h5>
                                            </div>
                                         </div>
                                         <br><br>
                                         <br>
                                        <div class="wd-100 clear">
                                            <div class="wd-40 right ">
                                                             <h4>Signature Authority:_______________________</h4>
                                            </div>
                                         </div>
            
                     <script>
        window.print();
    </script>
    </body>
</html>