<aside class="right-side">

    <!-- Main content -->

    <section class="content">

        <div class="row">

            <div class="col-xs-12">

                <!-- /.box -->

                

                <div class="box box-primary">

                    <?php 

						$general 	= get_general_setting();                       

                        $basic 		= get_basic_setting();

                        $design 	= get_design_setting();

                    ?>

                    <div class="box-body table-responsive" style="clear:both;" id="print_data_container">

                        <div>

                            <table border="0" width="1000" style="border-collapse:collapse;">

                                <tr>

                                    <td width="20%" style="border-right:1px solid #FFF;">

                                        <?php  if ((!empty($design->logo)) && (file_exists(FCPATH . DIR_COMPANY_LOGO . $design->logo))) {

                                            $image_url = DIR_COMPANY_LOGO . $design->logo;

                                            $alt = $basic->temple_name;

                                        }

                                        else {

                                            $image_url = 'assets/images/logo.png';

                                            $alt = 'Logo not found!';

                                        } ?>

                                        <div style="font-size: 14px;">

                                            <div><span style="float:left;width:155px;height:75px; margin:2px;"><img src="<?php echo $image_url;?>" alt="<?php echo $alt;?>" width="155" height="75" /></span></div>

                                        </div>

                                    </td>

                                    <td width="15%">&nbsp;</td>

                                    <td width="40%" align="center">

                                        <span style="float:left;font-family:Arial, Helvetica, sans-serif;font-weight:bold; margin-bottom: 20px;">

                                            <span style="font-size:18px;"><?php echo $basic->temple_name;?></span>

                                        </span>

                                    </td>

                                    <td width="15%">&nbsp;</td>

                                    <td width="10%">&nbsp;</td>

                                </tr>

                              	<tr><td colspan="5" style="border-top:1px solid #666;">&nbsp;</td></tr>

                                <tr>

                                    <td colspan="2" align="left"><strong>Start Date : <?php echo $filter['start_date']; ?></strong></td>

                                    <td align="center"><strong>Temple Expenses Report</strong></td>

                                    <td colspan="2" align="right"><strong>End Date : <?php echo $filter['start_date']; ?></strong></td>

                                </tr>

                           

                            </table>

                            <br/>

                                

                            <table width="1000" border="1" cellpadding="3" cellspacing="0" style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; font-size:14px; width: 1000px; border-collapse:collapse;" class="filterTable" id="filterTable">

                                <thead>

                                    <tr>

                                        <th style="padding:1%;" width="6%">S.No</th>

                                        <th style="padding:1%;">Expenses Type</th>

                                        <th style="padding:1%;">Subject Name</th>

                                        <th style="padding:1%;">Name</th>

                                        <th style="padding:1%;">Date</th>

                                        <th style="padding:1%;">Amount</th>

                                        <th style="padding:1%;">Description</th>

                                        <th style="padding:1%;">Expenses For</th>

                                    </tr>

                                </thead>

                                

                                <?php if( !empty( $results ) ) : ?>

                                    <tbody>

                                        <?php 

                                            $total_amt = 0;    

                                            foreach($results as $k => $r ) :

                                               // $total_amt += $r['exp_amount'];

                                            ?>

                                                <tr>

                                                    <td align="center" style="padding:1%;"><?php echo $k+1; ?></td>

                                                    <td style="padding:1%;"><?php echo $r['exp_type_name']; ?></td>

                                                    <td style="padding:1%;"><?php echo $r['exp_subject']; ?></td>

                                                    <td style="padding:1%;"><?php echo $r['exp_name']; ?></td>

                                                    <td style="padding:1%;"><?php echo date("d-m-Y", strtotime($r['exp_date'])); ?></td>

                                                    <td style="padding:1%;" align="right"><?php echo number_format($r['exp_amount'], 2, '.', ''); ?></td>

                                                    <td style="padding:1%;"><?php echo text($r['exp_desc']); ?></td>

                                                    <td style="padding:1%;"><?php echo $r['expenses_for']; ?></td>                                                    

                                                </tr>

                                            <?php 

                                            endforeach;

                                        ?>

                                    </tbody>

                                    <!--<tfoot>

                                        <tr>

                                            <td style="padding:1%;" colspan="7" align="right"><b>Total Amount</b></td>

                                            <td style="padding:1%;" align="right"><b><?php echo number_format($total_amt,2,'.','');?></b></td>

                                        </tr>

                                    </tfoot>-->

                                <?php else : ?>

                                    <tbody>

                                        <tr>

                                            <td colspan="8" style="color: #0B6CCB;"><center>No Records Found!</center></td>

                                        </tr>

                                    </tbody>

                                <?php endif; ?>

                            </table>

                        </div>

                    </div>

                

                    

                </div><!-- /.box -->

            </div>

        </div>

    </section><!-- /.content -->

</aside><!-- /.right-side -->

<!-- ./wrapper -->

<?php if( !IS_KSK ) : ?>

<script type="text/javascript">

    window.onload = function() {

        print_layout();

    } 

    

    $(document).ready(function(){

        $('.print').click(function(){

            print_layout();

        });

    });

    

    function print_layout() {

        var body = $('#print_data_container').html();

        var newWin = document.getElementById('report').contentWindow;

        newWin.document.write(body);

        newWin.document.close(); //important!

        newWin.focus(); //IE fix

        newWin.print();

        window.location.href = '<?php echo base_url();?>expenses_report';

    }



</script>

<?php endif;