<?php
$this->load->view ( $left );
$this->load->view ( $header );
?>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>Item List</h2>
    </div>
    <div class="col-sm-8">
        <div class="title-action">
            <a href="<?php echo site_url("items/newitem");?>" class="btn btn-primary addNewUser">
                <i class="fa fa-plus-square-o"></i>
                <span class="m-l-xs">Add Item</span>
            </a>
        </div>
    </div>
</div>
<div class="wrapper wrapper-content">
    <div class="row text-center animated fadeInRightBig">
        <table class="table" id="myTable">
        	<thead>
        		<tr>
        			<th>Name</th>
        			<th>Description</th>
                    <th>Rate Sale</th>
                    <th>Rate Purchase</th>
                    <th>GST %</th>
        			<th>HSN</th>
					<th>Edit/Delete</th>					
        		</tr>
        	</thead>
            <tbody>
                <?php if (count($item_list) > 0) {
                    foreach ($item_list as $key_item => $value_item) {?>
                        <tr>
                           <td><?php echo !empty($value_item->item_name) ? $value_item->item_name : '';?></td>
                           <td><?php echo !empty($value_item->item_description) ? $value_item->item_description : '';?></td>
                           <td><?php echo !empty($value_item->rate_sale) ? $value_item->rate_sale  : '';?></td>
                           <td><?php echo !empty($value_item->rate_purchase ) ? $value_item->rate_purchase : '';?></td>
                           <td><?php echo !empty($value_item->gst_rate ) ? $value_item->gst_rate : '0';?></td>
                           <td><?php echo !empty($value_item->hsn_code ) ? $value_item->hsn_code : '';?></td>
                           <td><a href="<?php echo site_url('items/newitem/'.$value_item->item_id);?>"><button class="btn btn-info btn-xs"><i class="fa fa-edit"></i></button></a></td>
                        </tr>
                <?php }
                }?>
            </tbody>
        </table>
    </div>
</div>
<?php $this->load->view($footer); ?>
<script type="text/javascript">
	$(document).ready(function(){
        $('#myTable').DataTable();
	});
</script>