<?php $currency_symbol = $this->customlib->getSchoolCurrencyFormat(); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            <i class="fa fa-mortar-board"></i> Asset List
         <?php if ($this->rbac->hasPrivilege('staff', 'can_add')) { ?>
                <small class="pull-right">
                    <a href="<?php echo base_url(); ?>asset/" class="btn btn-primary btn-sm"   >
                        <i class="fa fa-plus"></i> Add Asset
                    </a>
                </small>
            <?php } ?>
        </h1>
								<a href="<?php  echo base_url(); ?>book_depreciation/" class="col-md pull-right">Book Depreciation</a>
								<b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								<a href="<?php  echo base_url(); ?>asset/" class="col-md pull-right">Add Asset</a>
								<b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>												 
								 <a href="<?php  echo base_url(); ?>assettypes/" class="col-md pull-right">Asset Types</a> 
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>depreciationmethods/" class="col-md pull-right">Depreciation Methods</a>	
								 <a href="<?php  echo base_url(); ?>location/" class="col-md pull-right">Employee</a>	
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>department/" class="col-md pull-right">Department</a>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-<?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                echo "12";
            } else {
                echo "12";
            }
            ?>">
                <!-- general form elements -->
                <div class="box box-primary">
                    <div class="box-header ptbnull">
                        <h3 class="box-title titlefix"><?php echo $title_list; ?></h3>
                        <div class="box-tools pull-right">
                        </div><!-- /.box-tools -->
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <div class="table-responsive mailbox-messages">
                            <div class="download_label"><?php echo $title_list; ?></div>
                            <table class="table table-striped table-bordered table-hover example">
                                <thead>
                                    <tr>
                                        <th>Date Captured</th>
                                        <th>Asset Code</th>
                                        <th>Description</th>
                                        <th>Asset Type</th>
                                        <th>Asset Master</th>
                                        <th>Number of Units.</th>
                                        <th>Serial Number</th>
                                        <th>Department</th>
                                        <th>Employee</th>
                                        <th>Supplier</th>
                                        <th>Capex Order</th>
                                        <th>Purchase Price</th>
                                        <th>Insured Value</th>
                                        <th>Scarp Value</th>
                                        <th>Revaluation</th>
                                        <th>Purchase Date</th>
                                        <th>Replacement Date</th>
                                        <th>Replacement Cost</th>
                                        <th>Base Cost</th>
                                        <th>Roll Over Relief</th>
                                        <th class="text-right"><?php echo $this->lang->line('action'); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php  
										 foreach ($asset->result() as $row)  
										 {   
                                        ?>
                                        <tr>
                                            <td class="mailbox-name"><?php echo $row->date_captured;?></td>
                                            <td class="mailbox-name"><?php echo $row->asset_code;?></td>
                                            <td class="mailbox-name"><?php echo $row->description;?></td>
                                            <td class="mailbox-name"><?php echo $row->asset_type;?></td>
                                            <td class="mailbox-name"><?php echo $row->master_asset;?></td>
                                            <td class="mailbox-name"><?php echo $row->units_num;?></td>
                                            <td class="mailbox-name"><?php echo $row->serial_num;?></td>
                                            <td class="mailbox-name"><?php echo $row->department;?></td>
                                            <td class="mailbox-name"><?php echo $row->employee;?></td>
                                            <td class="mailbox-name"><?php echo $row->supplier;?></td>
                                            <td class="mailbox-name"><?php echo $row->capex_order;?></td>
                                            <td class="mailbox-name"><?php echo $row->purchase_price;?></td>
                                            <td class="mailbox-name"><?php echo $row->insured_value;?></td>
                                            <td class="mailbox-name"><?php echo $row->scrap_value;?></td>
                                            <td class="mailbox-name"><?php echo $row->revaluation;?></td>
                                            <td class="mailbox-name"><?php echo $row->purchase_date;?></td>
                                            <td class="mailbox-name"><?php echo $row->replacement_date;?></td>
                                            <td class="mailbox-name"><?php echo $row->replacement_cost;?></td>
                                            <td class="mailbox-name"><?php echo $row->base_cost;?></td>
                                            <td class="mailbox-name"><?php echo $row->roll_over_relief;?></td>
                                            <td class="mailbox-date pull-right">
                                                <?php
                                                if ($this->rbac->hasPrivilege('types', 'can_edit')) {
                                                    ?>  
                                                    <a href="<?php echo base_url(); ?>asset/edit/<?php echo $row->id; ?>" class="btn btn-default btn-xs"  data-toggle="tooltip" title="<?php echo $this->lang->line('edit'); ?>">
                                                        <i class="fa fa-pencil"></i>
                                                    </a>                                                   
													<a href="<?php echo base_url(); ?>book_depreciation/calculate/<?php echo $row->id; ?>" class="btn btn-default btn-xs"  data-toggle="tooltip" title="Calculate Depreciation">
                                                        <i class="fa fa-pencil">Dp.</i>
                                                    </a>
                                                    <?php
                                                }
                                                if ($this->rbac->hasPrivilege('types', 'can_delete')) {
                                                    ?>  
                                                    <a href="<?php echo base_url(); ?>asset/delete/<?php echo $row->id; ?>"class="btn btn-default btn-xs"  data-toggle="tooltip" title="<?php echo $this->lang->line('delete'); ?>" onclick="return confirm('<?php echo $this->lang->line('delete_confirm') ?>');">
                                                        <i class="fa fa-remove"></i>
                                                    </a>
                                                <?php } ?>
                                            </td>
                                        </tr>
									<?php } ?>
                                </tbody>
                            </table><!-- /.table -->



                        </div><!-- /.mail-box-messages -->
                    </div><!-- /.box-body -->
                </div>
            </div><!--/.col (left) -->
            <!-- right column -->

        </div>
        <div class="row">
            <!-- left column -->

            <!-- right column -->
            <div class="col-md-12">

            </div><!--/.col (right) -->
        </div>   <!-- /.row -->
    </section><!-- /.content -->
</div><!-- /.content-wrapper -->

