<?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> Book Depreciation  </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>	
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>depreciationexpenses/" class="col-md pull-right">Depreciation Expense</a>	
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <a href="<?php  echo base_url(); ?>accummdeprec/" class="col-md pull-right">Depreciation</a>	
								 <b style="padding-left:5px;padding-right:5px;"class="pull-right"> | </b>
								 <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">
            <?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                ?>  
                <div class="col-md-4">
                    <!-- Horizontal Form -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title"><?php echo $title;?></h3>
                        </div><!-- /.box-header -->
			  <form id="form1" action="<?php echo site_url('book_depreciation/calculate/' . $id); ?>"  id="employeeform" name="employeeform" method="post" accept-charset="utf-8">
                       			
                            <div class="box-body">
                                <?php if ($this->session->flashdata('msg')) { ?>
                                    <?php echo $this->session->flashdata('msg') ?>
                                <?php } ?>
                                <?php
                                if (isset($error_message)) {
                                    echo "<div class='alert alert-danger'>" . $error_message . "</div>";
                                }    
                                ?>
                                <?php echo $this->customlib->getCSRF(); ?>                                				
								<input id="id" name="id" placeholder="" type="hidden" class="form-control"  value="<?php echo $id; ?>" />								
								<div class="form-group">
                                    <label for="colour">Start Date</label><small class="req"> *</small>
                                    <input autofocus="" id="startdate" name="startdate" placeholder="" type="date" class="form-control"  value="<?php echo set_value('startdate'); ?>" />
                                    <span class="text-danger"><?php echo form_error('startdate'); ?></span>
                                </div>											
								<div class="form-group">
                                    <label for="colour">Residual/Scrap Value</label><small class="req"> *</small>
                                    <input autofocus="" id="residual_vale" name="residual_vale" placeholder="" type="text" class="form-control"  value="<?php echo set_value('residual_vale'); ?>" />
                                    <span class="text-danger"><?php echo form_error('residual_vale'); ?></span>
                                </div>	
								<div class="form-group">
                                    <label for="dpmethod">Depreciation method</label><small class="req"> *</small>
										<select id="dpmethod" name="dpmethod" placeholder="" type="text" class="form-control" >
											<option value="select"><?php echo $this->lang->line('select') ?></option>
											<?php 
												foreach ($dpmethods->result() as $grup) {
												?>
								                  	<option value="<?php echo $grup->depreciation_basis; ?>" >  <?php echo $grup->depreciation_basis; ?></option>
											<?php }
											?>
										</select>
                                    <span class="text-danger"><?php echo form_error('dpmethod'); ?></span>
                                </div>								
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-info pull-right">Calculate</button>
                            </div>
                        </form>
                    </div>
                </div><!--/.col (right) -->
                <!-- left column -->
            <?php } ?>
            <div class="col-md-<?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                echo "8";
            } 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>Book Depreciation Details</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php  
										 foreach ($book_depreciation->result() as $row)  
										 {   
                                        ?>
                                        <tr>
                                            <td class="mailbox-name">Purchase Value</td> <td class="mailbox-name pull-left"><?php echo $row->purchasevalue;?></td>
                                        </tr>                                          
										<tr>
                                            <td class="mailbox-name">Start Date</td> <td class="mailbox-name pull-left"><?php echo $row->startdate;?></td>
                                        </tr>                                          
										<tr>
                                            <td class="mailbox-name">Total</td>  <td class="mailbox-name pull-left"><?php echo $row->total;?></td>
                                        </tr>                                         
										<tr>
                                            <td class="mailbox-name">Prior Years</td> <td class="mailbox-name pull-left"><?php echo $row->prioryears;?></td>
                                        </tr>                                         
										<tr>
                                            <td class="mailbox-name">Current Year</td>   <td class="mailbox-name pull-left"><?php echo $row->currentyear;?></td>
                                        </tr>                                          
										<tr>
                                            <td class="mailbox-name">Current Period</td> <td class="mailbox-name pull-left"><?php echo $row->currentperiod;?></td>
                                        </tr> 										
										<tr>
                                            <td class="mailbox-name">Initial Allowance</td> <td class="mailbox-name pull-left"><?php echo $row->initial_allowance;?></td>
                                        </tr>   										
										<tr>
                                            <td class="mailbox-name">Residual/Scrap Value</td><td class="mailbox-name pull-left"><?php echo $row->residual_vale;?></td>
                                        </tr>           										
										<tr>
                                            <td class="mailbox-name">Impairements</td> <td class="mailbox-name pull-left"><?php echo $row->impairements;?></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 -->

