<html>
    <head>
        <title><?php echo $b_header['title']; ?></h3></title>
          <style>
            @media print
            {
                * {-webkit-print-color-adjust:exact;}
                  //.super_container {page-break-before: always; padding-top:10px; margin-bottom:150px !important;}
                //.page_break {page-break-after: always;}
                @page {margin:0in 0.10in 0in 0in; }
                .super_container
{
page-break-after: always;
// margin-bottom:200px;
 margin-top:0.25in;
position:relative;
width:100%;
height:710px;
}
.no-print
    {
        display: none !important;
    }
            }
body {margin: 0.25in 0.25in 0.63in 0.25in; box-sizing:border-box;width:90%; 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-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:100%;
            height:710px;
            }
            .wrapper{
                //width:calc(100% - 20px);
                //height:710px;
                //margin:10px;
              
                outline-offset: 5px;
                box-sizing: border-box;
                padding:5px;
                
                
            }
           
            .super_wrapper
            {
                position:absolute;
                top:0;
                left:0;
                width:100%;
                height:710px;
                z-index:120;
                margin:0;
                padding:0;
            }
            .watermark
            {
                height:200px;
                width:300px;
                /*align:center;*/
                margin:40px;
                margin-left:200px;
                padding-top:200px;
                padding-left:100px;
                opacity:0.1;
                background:url("<?php echo base_url().$b_header['logo1']; ?>");
                background-size:100% 100%;
            }
            .watermark_wrapper
            {
                height:500px;
                width:100%;
                margin-top:150px;
                display:inline-flex;
                display:-webkit-inline-flex;
             }
            .wrapper.left2{
                width: calc(100%);
                margin-right: 20px;
                margin-left: 20px;
            }
            
            h1,h2,h3{
                color:#5A7BC1;
                font-family:calibri;
                text-align:center;
            }
            //h3{font-weight: 700;}
              .boxed{color:#000000;width:80%;margin:0 auto;}
            .header{
                width:100%;
                //height:110px;
                border-bottom:4px solid #5A7BC1;
                padding-bottom:10px;          
                }
            .body{
                padding:10px;
            }
            .row{
                width:100%;
                margin: 10px auto;  
            }
            .text-center{text-align:center;}
            .bold{font-weight:bold;}
            .b-u-l{
                border-bottom: 1px solid #000;
                height:inherit;
            }
            .x-small{
                font-size: 10px;
            }
            .x-x-small{
                font-size: 7px;
            }
            .page_break{
                width: 100%;
                height: 100vh;
                padding: 10px 0px;
                box-sizing: border-box;
            }
            .tbl1
            {
                border-collapse:collapse;
                border: 2px solid #000;
                text-align:center;
                width:100%;
                min-height:20px;
                border-bottom: 1px solid;
            }
            .tbl2{
                border-top: 1px solid;
            }
            th{
                border: 1px solid #000;
                background-color:#ccccb3; 
                color: #fff;
                padding: 7px;
                padding-top:.5em;
                font-size: 18px;
                padding-bottom:.5em;
            }
            td{
                border: 1px solid #000;
                padding: 7px !important;
            }
            .normal{
                font-weight: normal !important;
            }
            .text-right{
                text-align: right !important;
            }
            .bold{
                font-size: 18px;
                font-weight: bold;
            }
        </style>
    </head>
    <body class="clear">
<?php 
date_default_timezone_set("Asia/Karachi");
// var_dump("<pre>",$values);die();
?>
 

 <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['logo1']; ?>" style="width:50px;height:50px;">
                    </div>
                    <div style="">
                        <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><h4>Contact# <?php echo $b_header['phone_no']; ?></h4></center>
                        <center><h4>Email: <?php echo $b_header['email']; ?></h4></center>
                        <center><h3 class="boxed" style="margin-top:10px !important;font-size:23px;"><?php echo "Petty Cash" ?></h3></center>
                    </div>
                </div>
            </div>
                   <br>
              
            <div class="body">
            
           <div class="wd-100 left" style="line-height:3em;">
 
            
            <table id="myDataTable" style="width:95%;border: 2px solid #000;"  class="tbl1">
                      <thead>
                        <tr>
                         
                          <th >Head</th>
                          
                          <th>Program</th>
                          <th >Project</th>
                          <th >Amount</th>
                        </tr> 
                      </thead>


                      <tbody class="center">
                        <?php
                         $total=0;
                         $i=0; 
                    $pros=$this->db->select('*')
                                ->from('project')
                                ->where('is_delete',0)
                                ->get()->result_array();
                   
                          foreach ($recipt as $key => $v) {
                            if($v['head']!=7){
                               if(!empty($pros))
                               {
                                   foreach($pros as $key=>$pro)
                                   {
                                        $sum_amt=$this->db->select('sum(amount) as amt')
                                              ->from('transction')
                                              ->where('type',"petty cash")
                                              ->where('head',$v['head'])
                                              ->where('is_checked',1)
                                              ->where('sht_no',$sht)
                                              ->where('project',$pro['id'])
                                             ->where('branch',$branch['id'])
                                             ->get()->row_array()['amt'];
                                        if(!empty($sum_amt)) 
                                        { ?>
                                             <tr>
                         
                          <td style= "text-align: left;"><?php echo $v['head_name'];?></td>
                          <td style= "text-align: left;"><?php echo $v['program_name'];?></td>
                          <td style= "text-align: left;"><?php echo $pro['p_name'];?></td>
                          <td style= "text-align: right;">
                           <?php echo number_format($sum_amt); 
                           $total+=$sum_amt;?></td>
                           
                        </tr>
                             <?php           
                                            
                                        }
                                   }
                               }
                        } } 
                      ?>
                       
                          <tr><td colspan="3"  style= "text-align: left;">Total</td><td style= "text-align: right;"><?php echo number_format($total); ?></td></tr>
                      </tbody>
                    
                    </table>
            
            
            
            
            
            
            
<br/>
            <div class="wd-100 left" style="line-height:3em;">
                <div class="wd-100 clear">
                     <div class="wd-50 left">
                        <div class="wd-50 left"><h3></h3></div>
                        <div class="wd-50 left"><h4></h4></div>
                    </div>
                <div class="wd-100 left">
                        <div class="wd-50 right"><h3>Signature :________________________</h3></div>
                        <div class="wd-50 left"><h4></h4></div>
                </div>      
                </div>
            
                
            </div>
<a href="<?php echo base_url(); ?>account/gotonext_type/<?php echo 6;?>" class="no-print"  ><button type="button" style="width:12%">close</button></a>

                </div><!--Class Body end-->
                

                
            </div>
            
                
                
             
                
            </div>
        </div>
        
           
    </div>
</div>
</div>

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

    </script>
</html>
