<?php init_head(); ?>
<div id="wrapper">
  <div class="breadcrumb">
  <a href="<?php echo admin_url(); ?>"><?= _l('breadcrumb_dashboard'); ?></a>&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<?php echo html_entity_decode($title); ?>
  </div>
    <div class="admin-title">
		<h1><?= $this->config->item('icons')['assets']; ?> 
		<?php echo html_entity_decode($title); ?></h1>
    </div>
   <div class="content">
      <div class="row">
         <div class="col-md-12">
            <div class="panel_s">
               <div class="panel-body">


                <?php
                        $table_data = [
                            _l('asset_code'),
                            _l('asset_name'),
                            _l('asset_group'),
                            _l('amounts'),
                            _l('unit_price'),
                            _l('original_price'),
                            _l('depreciation'),
                            _l('date_buy'),
                            _l('depreciation_value'),
                            _l('residual_value'),
                        ];
                        render_datatable($table_data, 'table_depreciation');
                        ?>
               </div>
            </div>
         </div>
      </div>
   </div>

   

</div>

</div>
<?php show_footer(); ?><?php init_tail(); ?>
</body>
</html>
<script>

  var deprServerParams = {
        "groups": "[name='asset_groups[]']",
        "assets": "[name='assetss[]']",
    };

    table_depr = $('.table-table_depreciation');


    _table_api = initDataTable(table_depr, admin_url + 'assets/table_depreciation', '', '', deprServerParams);


    $.each(deprServerParams, function(i, obj) {
        $('select' + obj).on('change', function() {

            table_depr.DataTable().ajax.reload()
                .columns.adjust()
                .responsive.recalc();
        });
    });


</script>
