<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

<div class="box">
    <div class="box-header">
        <div class="box-header">
        <h2 class="blue"><i class="fa-fw fa fa-plus"></i><?= lang('list_Account') ?></h2>
    </div>
        
    </div>
    <div class="box-content">
        <div class="row">
            <div class="col-lg-12">
                <!--<p class="introtext"><?= lang('list_results'); ?></p>-->

                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped" id="table_export">
                        <thead>
                        <tr class="primary">
                            <!--<th style="min-width:30px; width: 30px; text-align: center;">
                                <input class="checkbox checkth" type="checkbox" name="check"/>
                            </th>-->
                            <th><?= lang("id") ?></th>
                            <th><?= lang("Account Category") ?></th>
                            <th><?= lang("Type") ?></th>
                            <th><?= lang("Name") ?></th>
                           
							<th><?= lang("actions") ?></th>
                            
                           
                        </tr>
                        </thead>
                        <tbody>
						<?php $count = 1;
						if($account != '' ){?>
						<?php foreach($account as $row):?>
                        <tr>
							<!--<th style="min-width:30px; width: 30px; text-align: center;">
                                <input class="checkbox checkft" type="checkbox" name="check"/>
                            </th>-->
							<td><?php echo $count++;?></td>
							<?php $cate = $this->db->get_where('account_category' , array('id' => $row->account_category))->row()->name;?>
							<td><?php echo $cate; ?></td>
							<?php $cates = $this->db->get_where('type' , array('id' => $row->type))->row()->name;?>
							<td><?php echo $cates; ?></td> 
							<td><?=$row->Name; ?></td> 
							<td>
							 <div class="btn-group">
                                <button type="button" class="btn btn-default btn-xs btn-primary dropdown-toggle" data-toggle="dropdown">
                                    Action <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu dropdown-default pull-right" role="menu">
                                      
                                    <!-- EDITING LINK -->
                                    <li><?php $id = $row->id;?>
                                        <a href="<?= admin_url('transaction/edit_account/'.$id); ?>">
                                            <i class=" fa fa-pencil"></i>
                                                <?= lang("Edit") ?>
                                            </a>
                                                    </li>
                                    <li class="divider"></li>
									
									 <!-- VIEW LINK 
                                    <li>
                                        <a href="<?= admin_url('transaction/view_account/'.$id); ?>">
                                            <i class="fa fa-eye"></i>
                                                <?= lang("View") ?>
                                            </a>
                                                    </li>-->
                                    <li class="divider"></li>
                                    
                                    
                                    <!-- DELETION LINK -->
                                    <li>
                                        <a href="<?= admin_url('transaction/delete/'.$id); ?>">
                                            <i class="fa fa-trash-o "></i>
                                              <?= lang("Delete") ?>
                                            </a>
                                                    </li>
                                </ul>
                            </div>
							</td>
							 
						   
						   
                        </tr>
						<?php endforeach;
						}
						?>
                        </tbody>

                         <!--<tfoot class="dtFilter">
                        <tr class="active">
                           <th style="min-width:30px; width: 30px; text-align: center;">
                                <input class="checkbox checkft" type="checkbox" name="check"/>
                            </th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            
                        </tr>
                        </tfoot>-->
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

	jQuery(document).ready(function($)
	{
		

		var datatable = $("#table_export").dataTable();
		
		$(".dataTables_wrapper select").select2({
			minimumResultsForSearch: -1
		});
	});
		
</script>