<aside class="right-side">
    <!-- Main content -->
    <?php $general_data = get_general_setting();?>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <!-- /.box -->
                
                <div class="box box-primary">
                    <div class="box-body table-responsive" style="clear:both;" id="print_data_container">
                        <div>
                        	<iframe name="report" id="report" src="#" style="display:none;"></iframe>
                            <table border="0" width="100%" style="border-collapse:collapse;">
                                <tr>
                                    <td colspan="5" align="center" style="font-size:16px; font-weight:bold; padding:20px 0px 8px 0px;">SREE RAMAR TEMPLE</td>
                                </tr>
                                <tr>
                                    <td colspan="5" align="center" width="49%" style="font-size:13px; font-weight:bold;">Date : <?php echo date('d-m-Y',strtotime($start_date));?> to <?php echo date('d-m-Y',strtotime($end_date));?></td>
                                </tr>
                            
                            </table>
                           
                            <table width="100%" border="1" cellpadding="3" cellspacing="0" style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; font-size:14px; width: 100%; border-collapse:collapse;" class="filterTable" id="filterTable">
                                <thead>
                                    <tr>
                                        <th style="padding:1%;">S.No</th>
                                        <th align="left" style="padding:1%;">Description</th>
                                        <th align="right" style="padding:1%;">Amount</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php 
									$total_amt 	= 0;
                                    $start_date = (!empty($start_date)) ? $start_date : date('d-m-Y');
                                    $add_days 	= 30;
                                    $d 			= date('d-m-Y',strtotime($start_date) + (24*3600*$add_days));
                                    $end_date 	= (!empty($end_date)) ? $end_date : date('d-m-Y');
                                    if(count($results) > 0) { 
									 	$i = 0;
                                        foreach( $results as $key => $row) :
                                            $total_amt += $row['amount'];
                                        ?>
                                            <tr>
                                                <td align="center" style="padding:1%;"><?php echo ++$i;?></td>
                                                <td style="padding:1%;"><?php echo $row['service_name']; ?></td>
                                                <td align="right" style="padding:0.8%;"><?php echo number_format($row['amount'],2,'.','');?></td>
                                            </tr>
                                        <?php endforeach; ?>                                        	
                                    <?php } else {?>
                                        <tr>
                                            <td colspan="3" style="color: #0B6CCB;"><center>No Records Found!</center></td>
                                        </tr>
                                    <?php } ?>
                                </tbody>
                                <?php if(count($results) > 0) { ?>
                                <tfoot>
                                	<tr>
                                        <td colspan="2" align="right">Total</td>
                                        <td align="right"><?php echo number_format($total_amt,2,'.','');?></td>
                                    </tr>
                                </tfoot>
                                <?php } ?>
                            </table>
                                                       
                           <!--<div style="width: 100%; float: right;">
                                <div style="float: left; clear: both; width:33.3%;">
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div><b style="font-size: 15px;">Verified By</b></div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>-----------------------------------------</div>
                               </div>
                               <div style="float: left; width:33.3%;">
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div><b style="font-size: 15px;">Approved  By</b></div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>-----------------------------------------</div>
                               </div>
                               <div style="float: left; width:33.3%;">
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div><b style="font-size: 15px;">Confirmed By</b></div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>&nbsp;</div>
                                    <div>-----------------------------------------</div>
                               </div>
                           </div>-->
                            
                           <div style="clear:both;"></div>
                        </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();?>monthly_report"
    } 

</script>
<?php endif; ?>