<div class="container-title"></div>
<div class="row">
    <div class="col-lg-12"><ol class="breadcrumb">
            <?php      
            $currentAction = '';
            $agregarNuevo = '';
            if($action =='edit'){
                $currentAction = "<li class='active'><i class='fa fa-pencil'></i> ".$_translator->_getTranslation('Editar')."</li>";
                $agregarNuevo = "<a href='Store.php' class='btn btn-primary'><i class='fa fa-plus'></i> ".$_translator->_getTranslation('Agregar sucursal')."</a>";
            }elseif($action =='' || $action =='insert'){
                $currentAction = "<li class='active'><i class='fa fa-plus'></i> ".$_translator->_getTranslation('Agregar')."</li>";
            } ?>
            <li><i class="fa fa-dashboard"></i>  <a href="<?php echo ROOT_HOST?>/Controller/Home.php"><?php echo $_translator->_getTranslation('Inicio')?></a></li>
            <li class="active"><i class="fa fa-map-marker"></i> <?php echo $_translator->_getTranslation('Lista de sucursales')?></li>
            <?php echo $currentAction?>
        </ol>
    </div>
</div>
<div id="flashmessenger"><?php $flashmessenger->showMessage();?></div>
<div class="box">
    <div class="box-header">       
        <h3><i class='fa-fw fa fa-map-marker'></i><?php echo $_translator->_getTranslation('Lista de sucursales');?></h3>
        <div class='box-icon'><i class='icon fa fa-tasks'></i></div>
    </div>
    <div class='box-content'>
        <div class='row'>
            <div class="col-lg-12">
                <hr/>
                <div class='table-responsive'>
                <table id="tblStores" class="table table-striped table-hover table-condensed">
                            <thead>
                            <th class="col-md-1 col-xs-1 text-center">Accion</th>
                            <th class="col-md-3 col-xs-3"><?php echo $_translator->_getTranslation('Nombre');?></th>
                            <th class="col-md-2 col-xs-2 text-center"><?php echo $_translator->_getTranslation('Telefono');?></th>
                            <th class="col-md-2 col-xs-2 text-center"><?php echo $_translator->_getTranslation('Contacto');?></th>
                            <th class="col-md-1 col-xs-1 text-center"><?php echo $_translator->_getTranslation('Status');?></th>
                            </thead>
                            <tbody>
                            <?php 
                                if($_listSucursals){
                                    foreach($_listSucursals as $sucursal){?>
                                        <tr>
                                            <td>
                                                <a href="Store.php?action=edit&id=<?php echo $sucursal['id']?>"><i class="fa fa-pencil btn btn-sm btn-default"></i></a>
                                                <?php   if($sucursal['id'] != '1'){?>
                                                            <a onclick="return deleteRegistry('Store.php?action=delete&id=<?php echo $sucursal['id']?>')" href="#"><i class="fa fa-trash btn btn-sm btn-danger"></i></a>
                                                <?php   }?>                                                
                                            </td>
                                            <td><?php echo $sucursal['nombre']?></td>
                                            <td class="text-center"><?php echo $sucursal['telefono']?></td>
                                            <td class="text-center"><?php echo $sucursal['nombre_contacto']?></td>
                                            <td class="text-center"><?php echo $sucursal['status']?></td>
                                        </tr><?php
                                    }                   
                                }?>
                            </tbody>
                        </table>
                </div>
            </div>                
        </div>
    </div>
</div>
<script type="text/javascript" language="javascript">
	$('#tblStores').DataTable( {paginate:true,filter:true});
        $('#tblStores')
		.removeClass( 'display' )
		.addClass('table table-striped table-bordered');
</script>