
<style>


    .table thead tr >th{

        background-color:#4c0870;

        color:#fff;
    }
    .table thead tr th[class*='sorting_'] {
        color: #fff;
    }
    .bg-master-lighter {
        border:none;
        background-color:#fff;
        border-top:1px solid #ddd; 

    }


</style>
<script>
    // to remove many digits after the period
    $(function () {
        $(".ValSpan").each(function () {
            $(this).html(AddCommas(parseFloat($.trim($(this).text())).toFixed(3))).animate({opacity: 1})
        })
    })
</script>

<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title">Items Aging Report</div>

            <div class="clearfix"></div>
        </div>
        <div class="panel-body">
            <table class="table table-bordered table-hover demo-table-search" id="itemsagingreport">
                <thead>
                    <tr>
                        <th style="display:none"></th>

                        <th class="v-align-middle text-center " style="width:5%">ID</th>
                        <th class="v-align-middle text-center " style="width:8%" >Code </th>
                        <th class="v-align-middle text-center " > Name </th>
                        <th class="v-align-middle text-center " ><30 </th>
                        <th class="v-align-middle text-center " ><60 </th>
                        <th class="v-align-middle text-center " ><90 </th>     
                        <th class="v-align-middle text-center " ><120 </th>
                        <th class="v-align-middle text-center " >more </th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    for ($x = 0; $x < count($result) - 1; $x++) {
                        $CurItem = $result[$x];
                        ?>
                        <tr>
                            <td style="display:none"></td>

                            <td class='v-align-left text-left bold'><?php echo $CurItem["Product_ID"]; ?></td>
                            <td class='v-align-left text-left bold'><?php echo $CurItem["Product_Code"]; ?></td>
                            <td class='v-align-left text-left bold'><?php echo $CurItem["Product_Name"]; ?></td>
                            <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $CurItem["M1"]; ?></td>
                            <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $CurItem["M2"]; ?></td>
                            <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $CurItem["M3"]; ?> </td>
                            <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $CurItem["M4"]; ?></td>
                            <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $CurItem["More"]; ?></td>
                        </tr>
<?php }
?>
                    <tr>
                        <td style="display:none"></td>
                        <td></td>
                        <td></td>
                        <td class='v-align-middle text-center bold'>Total</td>
                        <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?> </span> <?php echo $result['Totals']['M1_Total']; ?></td>
                        <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?></span>  <?php echo $result['Totals']['M2_Total']; ?></td>
                        <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?></span> <?php echo $result['Totals']['M3_Total']; ?></td>
                        <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?></span>  <?php echo $result['Totals']['M4_Total']; ?></td>
                        <td class='v-align-middle text-center'><span class="DefaultCurrency"><?php echo $defCurrencySymbol; ?></span>  <?php echo $result['Totals']['More_Total']; ?></td>
                    </tr>
                </tbody>

            </table>
        </div>
    </div>
</div>
<nav class="navbar navbar-default bg-master-lighter sm-padding-10" role="navigation">
    <div class="container-fluid">
        <div class="collapse navbar-collapse" id="sub-nav">
            <div class="row"> 
                <div class="col-sm-4 ">
                    <ul class="nav navbar-nav navbar-center">
                        <li><a href="#" data-toggle="tooltip" data-placement="bottom" title="Print" class="PrintThisTableButton" data-date="<?php echo $today ?>" data-table="#itemsagingreport" data-title="Aging Reports"><i class="fa fa-print"></i></a></li>
                        <li><a href="#" data-toggle="tooltip" data-placement="bottom" title="Download"><i class="fa fa-download"></i></a></li>
                    </ul>
                </div>
                <div class="col-sm-4 pull-right">
                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="#" class="p-r-10" data-download-pdf="#itemsagingreport" data-title="Aging Report"><img width="25" height="25" alt="" class="icon-pdf" data-src-retina="<?php echo SITE_LINK; ?>img/invoice/pdf2x.png" data-src="<?php echo SITE_LINK; ?>img/invoice/pdf2x.png" src="<?php echo SITE_LINK; ?>img/invoice/pdf2x.png"></a>
                        </li>
                        <li>
                            <a href="#" class="p-r-10"><img width="25" height="25" alt="" class="icon-image" data-src-retina="<?php echo SITE_LINK; ?>img/invoice/image2x.png" data-src="<?php echo SITE_LINK; ?>img/invoice/image2x.png" src="<?php echo SITE_LINK; ?>img/invoice/image2x.png"></a>
                        </li>
                        <li>
                            <a href="#" class="p-r-10"><img width="25" height="25" alt="" class="icon-doc" data-src-retina="<?php echo SITE_LINK; ?>img/invoice/doc2x.png" data-src="<?php echo SITE_LINK; ?>img/invoice/doc2x.png" src="<?php echo SITE_LINK; ?>img/invoice/doc2x.png"></a>
                        </li>
                        <li><a href="#" class="p-r-10" onclick="$.Pages.setFullScreen(document.querySelector('html'));return false"><i class="fa fa-expand"></i></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>



