<?php
// echo $this->db->last_query();
?>

	                <!-- CONTENIDO -->
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
									<i class="fa fa-list"></i>
									<?=$this->lang->line('eap_pag_'.$this->uri->segment(1).'_'.$this->uri->segment(2));?>
									<div class="pull-right">
									<a href='<?=$this->config->item('base_url')?>index.php/grupos/nuevo/' title="<?=$this->lang->line('eap_grupos_nuevo')?>" class="btn btn-info btn-circle"><i class="fa fa-plus"></i></a>
                  <div class="btn-group">
                    <button type="button" class="btn btn-success btn-circle dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-file-excel-o"></i>
                    </button>
                    <ul class="dropdown-menu pull-right" role="menu">
                      <li><a href="<?=$this->config->item('base_url')?>index.php/grupos/exportar_excel/0/-1/1">Full</a>
                      </li>
                      <li><a href="<?=$this->config->item('base_url')?>index.php/grupos/exportar_excel/0/1/0">Solo Empresas</a>
                      </li>
                    </ul>
                  </div>
									</div>
									<div class="clearfix"></div>
                                </div>
                                <!-- /.panel-heading -->
                                <div class="panel-body">
                                    <div class="table-responsive">
                                        <table class="table table-striped table-hover">
                                            <thead>
                                                <tr>
                                                    <th><?=$this->lang->line('eap_grupos_nombre')?></th>
                                                    <th><?=$this->lang->line('eap_grl_estado')?></th>
                                                    <th><?=$this->lang->line('eap_grl_fecha_modificacion')?></th>
													<th><?=$this->lang->line('eap_grl_acciones')?></th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($grupos as $grupo) : ?>
                                                <tr>
                                                    <td class="col-sm-6"><?php echo $grupo['nombre'] ?></td>
                                                    <td class="col-sm-1<?php if ($grupo['activo']==0) { echo " text-danger";} ?>"><?php echo ($grupo['activo'])?$this->lang->line('eap_grl_estado_activo'):$this->lang->line('eap_grl_estado_inactivo'); ?></td>
                                                    <td class="col-sm-1"><?php echo $grupo['fecha_modificacion'] ?></td>
													<td class="col-sm-2">
                                                    <a href='<?=$this->config->item('base_url')?>index.php/grupos/ver/<?=$grupo['id_grupos']?>' title="<?=$this->lang->line('eap_grupos_ver')?>" class="btn btn-info btn-circle"><i class="fa fa-file-o"></i></a>
                                                    <a href='<?=$this->config->item('base_url')?>index.php/grupos/editar/<?=$grupo['id_grupos']?>/lista' title="<?=$this->lang->line('eap_grupos_editar')?>" class="btn btn-info btn-circle"><i class="fa fa-edit"></i></a>&nbsp;
                                                    <?php if (!$grupo['activo']) { ?>
                                                    <a href='<?=$this->config->item('base_url')?>index.php/grupos/cambiar_estado/<?=$grupo['id_grupos']?>/activar' title="<?=$this->lang->line('eap_grupos_activar')?>" class="btn btn-info btn-circle"><i class="fa fa-check"></i></a>&nbsp;
                                                    <?php } else {?>
                                                        <a href='<?=$this->config->item('base_url')?>index.php/grupos/cambiar_estado/<?=$grupo['id_grupos']?>/desactivar' title="<?=$this->lang->line('eap_grupos_desactivar')?>" class="btn btn-danger btn-circle"><i class="fa fa-times"></i></a>&nbsp;
                                                    <?php }?>
                                                    <div class="btn-group">
                                                      <button type="button" class="btn btn-success btn-circle dropdown-toggle" data-toggle="dropdown">
                                                        <i class="fa fa-file-excel-o"></i>
                                                      </button>
                                                      <ul class="dropdown-menu pull-right" role="menu">
                                                        <li><a href="<?=$this->config->item('base_url')?>index.php/grupos/exportar_excel/<?=$grupo['id_grupos']?>/-1/1">Full</a>
                                                        </li>
                                                        <li><a href="<?=$this->config->item('base_url')?>index.php/grupos/exportar_excel/<?=$grupo['id_grupos']?>/-1/0">Solo Empresas</a>
                                                        </li>
                                                      </ul>
                                                    </div>

													</td>
                                                </tr>
                                            <? endforeach;?>
                                                </tbody>
                                        </table>
                                    </div>
                                    <!-- /.table-responsive -->
                                </div>
                                <!-- /.panel-body -->
                            </div>
                            <!-- /.panel -->
                        </div>
                        <!-- /.col-lg-9 -->
                    </div>
	                <!-- /.CONTENIDO -->
