<?php 
// echo $this->db->last_query();
?>
					<!-- MODAL WINDOW -->
					<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
								<h4 class="modal-title" id="myModalLabel"><?=$this->lang->line('eap_grl_borrar_header')?></h4>
								</div>
								<div class="modal-body">
								<p class="debug-url"></p>
								<p><?=$this->lang->line('eap_grl_borrar_body')?></p>
								</div>
								<div class="modal-footer">
									<button type="button" class="btn btn-default" data-dismiss="modal"><?=$this->lang->line('eap_grl_cancelar')?></button>
									<a class="btn btn-danger btn-ok"><?=$this->lang->line('eap_grl_borrar')?></a>
								</div>
							</div>
						</div>
					</div>	                
					<!-- CONTENIDO -->                        
                    <div class="row">
                        <div class="col-lg-9">
                            <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/temas/nuevo/' title="<?=$this->lang->line('eap_temas_nuevo')?>" class="btn btn-info btn-circle"><i class="fa fa-plus"></i></a>
									</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_temas_nombre')?></th>
													<th><?=$this->lang->line('eap_temas_graficos_nombre')?></th>
                                                    <th><?=$this->lang->line('eap_grl_fecha_modificacion')?></th>
													<th><?=$this->lang->line('eap_grl_acciones')?></th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($temas as $tema) : ?>                                    
                                                <tr>
                                                    <td><?php echo $tema['nombre'] ?></td>
													<td><?php echo ($this->config->item('language_code') == 'PT') ? $tema['graficos_nombre_pt'] : $tema['graficos_nombre'] ?></td>
                                                    <td><?php echo $tema['fecha'] ?></td>
                                                    <td>
                                                    <a href='<?=$this->config->item('base_url')?>index.php/temas/ver/<?=$tema['id_temas']?>' title="<?=$this->lang->line('eap_temas_ver')?>" class="btn btn-info btn-circle"><i class="fa fa-file-o"></i></a>
                                                    <a href='<?=$this->config->item('base_url')?>index.php/temas/editar/<?=$tema['id_temas']?>/lista' title="<?=$this->lang->line('eap_temas_editar')?>" class="btn btn-info btn-circle"><i class="fa fa-edit"></i></a>&nbsp;
													<a  href="#" data-href='<?=$this->config->item('base_url')?>index.php/temas/borrar/<?=$tema['id_temas']?>/lista' title="<?=$this->lang->line('eap_temas_borrar')?>" data-toggle="modal" data-target="#confirm-delete" data-desc='<?=$this->lang->line('eap_temas_borrar')."=>".$tema['nombre']?>' class="btn btn-danger btn-circle"><i class="fa fa-trash-o"></i></a>&nbsp;														
                                                    </td>
                                                </tr>
                                            <? endforeach;?>
                                                </tbody>
                                        </table>
                                    </div>
                                    <!-- /.table-responsive -->
                                </div>
                                <!-- /.panel-body -->
                            </div>
                            <!-- /.panel -->
                        </div>
                        <!-- /.col-lg-9 -->
                    </div>
	                <!-- /.CONTENIDO -->   
<script>
	$('#confirm-delete').on('show.bs.modal', function(e) {
		$(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href'));
		
		$('.debug-url').html($(e.relatedTarget).data('desc'));
	});
</script>	
                        
