<?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 Types</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">
            <?php
            if ($this->rbac->hasPrivilege('class', 'can_add')) {
                ?>  
                <div class="col-md-12">
                    <!-- Horizontal Form -->
                    <div class="box box-primary">
                    <div style="padding:10px;">
						<a href="<?php echo base_url(); ?>asset/viewasset" class="btn btn-primary btn-sm pull-right"><i class="fa fa-eye"></i> View Assets</a>
                    </div>
                        <div class="box-header with-border">
                            <h3 class="box-title"><?php echo $title; ?></h3>
                        </div><!-- /.box-header -->
                        <form id="form1" action="<?php echo base_url() ?>asset/"  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(); ?>     
						
                            <div class="tshadow mb25 bozero">    
                                <h4 class="pagetitleh2"> Add Asset </h4>
                                <div class="around10">
									<div class="row">
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Asset Code</label> <small class="req"> *</small> 
                                                <input autofocus="" id="asset_code" name="asset_code" placeholder="" type="text" class="form-control"  value="<?php echo set_value('asset_code'); ?>" />
                                                <span class="text-danger"><?php echo form_error('asset_code'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Descripiton</label> <small class="req"> *</small> 
                                                <input id="description" name="description" placeholder="" type="text" class="form-control"  value="<?php echo set_value('description'); ?>" />
                                                <span class="text-danger"><?php echo form_error('description'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Asset Type</label><small class="req"> *</small> 
                                                <select  id="asset_type" name="asset_type" class="form-control"  >
                                                    <option value=""><?php echo $this->lang->line('select'); ?></option>
                                                    <?php
                                                    foreach ($asset_type->result() as $asset) {
                                                        ?>
                                                        <option> <?php echo $asset->asset_code; ?></option>
                                                        <?php
                                                    }
                                                    ?>
                                                </select>
                                                <span class="text-danger"><?php echo form_error('asset_type'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Master Asset</label><small class="req"> </small> 
                                                <input id="master_asset" name="master_asset" placeholder="" type="text" class="form-control"  value="<?php echo set_value('master_asset'); ?>" />
                                                <span class="text-danger"><?php echo form_error('master_asset'); ?></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Number of Units</label><small class="req"> </small> 
                                                <input id="units_num" name="units_num" placeholder="" type="text" class="form-control"  value="<?php echo set_value('units_num'); ?>" />
                                                <span class="text-danger"><?php echo form_error('units_num'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Serial Number</label>
                                                <input id="serial_num" name="serial_num" placeholder="" type="text" class="form-control"  value="<?php echo set_value('serial_num'); ?>" />
                                                <span class="text-danger"><?php echo form_error('serial_num'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputFile"> Department</label><small class="req"> </small> 
                                                <select class="form-control" name="department">
                                                    <option value=""><?php echo $this->lang->line('select'); ?></option>
                                                    <?php
                                                    foreach ($department->result() as $value) {
                                                        ?>
                                                        <option><?php echo $value->department; ?></option>
                                                        <?php
                                                    }
                                                    ?>
                                                </select>
                                                <span class="text-danger"><?php echo form_error('department'); ?></span>
                                            </div>
                                        </div>                                       
										<div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputFile"> Employee</label><small class="req"> </small> 
                                                <select class="form-control" name="employee">
                                                    <option value=""><?php echo $this->lang->line('select'); ?></option>
                                                    <?php
                                                    foreach ($employee->result() as $value) {
                                                        ?>
                                                        <option><?php echo $value->location; ?></option>
                                                        <?php
                                                    }
                                                    ?>
                                                </select>
                                                <span class="text-danger"><?php echo form_error('employee'); ?></span>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="row">
                                        <div class="col-md-2">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Supplier</label>
                                                <input id="supplier" name="supplier" placeholder="" type="text" class="form-control"  value="<?php echo set_value('supplier'); ?>" />
                                                <span class="text-danger"><?php echo form_error('supplier'); ?></span>
                                            </div>
                                        </div>                                       
										<div class="col-md-2">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Capex Order</label>
                                                <input id="capex_order" name="capex_order" placeholder="" type="text" class="form-control"  value="<?php echo set_value('capex_order'); ?>" />
                                                <span class="text-danger"><?php echo form_error('capex_order'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1">Purchase Price</label>
                                                <input id="purchase_price" name="purchase_price" placeholder="" type="text" class="form-control"  value="<?php echo set_value('purchase_price'); ?>" />
                                                <span class="text-danger"><?php echo form_error('purchase_price'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Insured Value</label>
                                                <input id="insured_value" name="insured_value" placeholder="" type="text" class="form-control"  value="<?php echo set_value('insured_value'); ?>" />
                                                <span class="text-danger"><?php echo form_error('insured_value'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Scrap Value</label>
                                                <input id="scrap_value" name="scrap_value" placeholder="" type="text" class="form-control"  value="<?php echo set_value('scrap_value'); ?>" />
                                                <span class="text-danger"><?php echo form_error('scrap_value'); ?></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                         <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Revaluation</label>
                                                <input id="revaluation" name="revaluation" placeholder="" type="text" class="form-control"  value="<?php echo set_value('revaluation'); ?>" />
                                                <span class="text-danger"><?php echo form_error('revaluation'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Purchase Date</label>
                                                <input id="purchase_date" name="purchase_date" placeholder="" type="date" class="form-control"  value="<?php echo set_value('purchase_date'); ?>"/>
                                                <span class="text-danger"><?php echo form_error('purchase_date'); ?></span>
                                            </div>
                                        </div>                                         
										<div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Replacement Date</label>
                                                <input id="replacement_date" name="replacement_date" placeholder="" type="date" class="form-control"  value="<?php echo set_value('purchase_date'); ?>"/>
                                                <span class="text-danger"><?php echo form_error('replacement_date'); ?></span>
                                            </div>
                                        </div> 										
										<div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Replacement Cost</label>
                                                <input id="replacement_cost" name="replacement_cost" placeholder="" type="text" class="form-control"  value="<?php echo set_value('replacement_cost'); ?>" />
                                                <span class="text-danger"><?php echo form_error('replacement_cost'); ?></span>
                                            </div>
                                        </div>   
                                    </div>                                  
									<div class="row">
                                         <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Base Cost</label>
                                                <input id="base_cost" name="base_cost" placeholder="" type="text" class="form-control"  value="<?php echo set_value('base_cost'); ?>" />
                                                <span class="text-danger"><?php echo form_error('base_cost'); ?></span>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="exampleInputEmail1"> Roll Over Relief</label>
                                                <input id="roll_over_relief" name="roll_over_relief" placeholder="" type="date" class="form-control"  value="<?php echo set_value('roll_over_relief'); ?>"/>
                                                <span class="text-danger"><?php echo form_error('roll_over_relief'); ?></span>
                                            </div>
                                        </div>                                         										  
                                    </div>

                                </div>
                            </div>																									
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-info pull-right"><?php echo $this->lang->line('save'); ?></button>
                            </div>
                        </form>
                    </div>
                </div><!--/.col (right) -->
                <!-- left column -->
            <?php } ?>
            <!-- 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 -->

