
<style type="text/css">
    .table thead tr >th{
        background-color:#4c0870;
        width:16% !important;
        color:#fff;
    }
    .table thead tr th[class*='sorting_'] {
        color: #fff;
    }

</style>
<div class="panel ">
    <div class="panel-heading">
        <div class=" panel-title" ><?php print CommonLanguage::getMessage('fixed_assets_register'); ?></div>
        <div class="input-datarange input-group col-md-5 pull-right" style="width: 348px;">

            <input id="DateFrom"type="text" class="form-control input-sm" name="start" data-date-format="yyyy-mm-dd" value="<?php echo($today); ?>"  aria-required="true" aria-invalid="false">
            <span class="input-group-addon bg-complete"><i class="fa fa-calendar"></i></span>
            <input id="DateTo"type="text" class="form-control input-sm" name="end" data-date-format="yyyy-mm-dd" value="<?php echo($today); ?>"  aria-required="true" aria-invalid="false">

        </div>

    </div>
    <div class="panel-body">


        <div class="row">
            <div class="col-xs-4">


                <br/><span ><strong><?php print CommonLanguage::getMessage('item_nb'); ?>: </strong></span><span id="itemNb" data-id="<?php echo $list['Depreciation_Rate_ID']; ?>"> <?php echo $list['Depreciation_Rate_ID']; ?></span>
                <br/><span id = "Account_Code"><strong><?php print CommonLanguage::getMessage('account_code'); ?>:</strong> <?php echo $list['Account_Code']; ?></span>
                <br/><span id = "Desc"><strong><?php print CommonLanguage::getMessage('Description'); ?>: </strong><?php echo $list['Depreciation_Rate_Description']; ?></span>

            </div>
            <div class="col-xs-4">

                <br/><span id = "Supp_Name"><strong><?php print CommonLanguage::getMessage('vendor_name'); ?>: </strong><?php echo $list['Supplier_Name']; ?></span>
                <br/><span id="DatePur"><strong><?php print CommonLanguage::getMessage('Expense_Date'); ?>: </strong><?php echo $list['Expense_Date']; ?></span>

            </div>
            <div class="col-xs-4">
                <br/><span id="Cost"><strong> <?php print CommonLanguage::getMessage('Cost'); ?>: </strong><span class=""><?php echo $list['unit_price']; ?></span></span>
                <br/><span id = "Percent" ><strong> <?php print CommonLanguage::getMessage('dep_percent'); ?>:</strong> <span class=""><?php echo CommonFunctions::public_round_number($list['Depreciation_Rate_Percent']); ?> </span>%	</span>
                <br/><strong> <?php print CommonLanguage::getMessage('dep_uptodate'); ?>:</strong><span id = "DepUptoDate" class=""><?php echo $list['Currency_Symbol'] . ' ' . CommonFunctions::public_round_number($list['Total_Amount']); ?></span>
            </div>
        </div>
        <br/>
        <br/>
        <br/>
        <table class="table table-striped table-hover" id="tableWithSearch">
            <thead>
                <tr>
                    <th class="text-center" ><?php print CommonLanguage::getMessage('Date'); ?></th>
                    <th class="text-center" ><?php print CommonLanguage::getMessage('depreciation_amount'); ?></th>
                    <th class="text-center" ><?php print CommonLanguage::getMessage('Status'); ?></th>

                </tr>
            </thead>
            <tbody>

            </tbody>
        </table>

    </div>
</div>

<script>
    var title = <?php echo json_encode(CommonLanguage::getMessage('fixed_assets_register')); ?>,
            dep_id = <?php echo json_encode($Dep_ID); ?>;
    $(function () {
        ChangeTable();
        $("#DateFrom,#DateTo").datepicker({autoclose: true}).on("changeDate", function (e) {

            ChangeTable();
        })
    })
    function ChangeTable() {

        var Date = {
            DateFrom: $("#DateFrom").val(),
            DateTo: $("#DateTo").val(),
            DepID: dep_id
        }
        RebuildDataTable(title, [0, 1], 'ACCAjax/viewDepreciation', Date)

    }

</script>
