<div class="row">
    <div class="col-lg-12">
        <ol class="breadcrumb">
            <?php      
            $currentAction = '';
            $agregarNuevo = '';
            if($action =='edit'){
                $customerAction = 'Editar Cliente ';
                $currentAction = "<li class='active'><i class='fa fa-pencil'></i> ".$_translator->_getTranslation('Editar')."</li>";
                $agregarNuevo = "<a href='Customer.php' class='btn btn-md btn-default'><i class='fa fa-plus'></i> ".$_translator->_getTranslation('Agregar cliente')."</a>";
                $agregarNuevo .= '<hr>';                
            }elseif($action =='' || $action =='insert'){
                $customerAction = 'Agregar Cliente ';
                $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('Home')?></a></li>
            <li class="active"><i class="fa fa-group"></i> <?php echo $_translator->_getTranslation('Clientes')?></li>
            <?php echo $currentAction?>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div id="flashmessenger"><?php $flashmessenger->showMessage();?></div>
        <div class="box">
            <div class="box-header"> 
                <h3><i class='fa-fw fa fa-group'></i><?php echo $_translator->_getTranslation($customerAction);?></h3>
                <div class='box-icon'><i class='icon fa fa-tasks'></i></div>
            </div>
            <div class='box-content'>
                <div class="row">
                    <div class="col-md-12 col-xs-12 text-right">
                        <?php echo $agregarNuevo;?>                        
                        <div class="clear"></div>
                    </div> 
                    <div class="col-lg-12">  
                        <?php 
                            echo $_form->openForm();
                            echo $_form->showActionController();
                            echo $_form->showId();
                            ?>
                       <div class="col-lg-6">
                            <div><?php echo $_form->showElement('nombre');?></div>
                            <div><?php echo $_form->showElement('calle');?></div>
                            <div><?php echo $_form->showElement('ciudad');?></div>
                            <div><?php echo $_form->showElement('estado');?></div>
                            <div><?php echo $_form->showElement('codigopostal');?></div>
                        </div>
                        <div class="col-lg-6">                            
                            <div><?php echo $_form->showElement('contacto');?></div>            
                            <div><?php echo $_form->showElement('telefono');?></div>
                            <div><?php echo $_form->showElement('fax');?></div>
                            <div><?php echo $_form->showElement('correo');?></div>
                            <div><?php echo $_form->showElement('metodoPago');?></div>
                            <div><?php echo $_form->showElement('diasCredito');?></div>            
                            <div><?php echo $_form->showElement('comentarios');?></div>
                            <div class="text-right">
                                <?php $element = $_form->getElement('send'); echo $_form->createOnlyElement($element);?>
                                <?php $element = $_form->getElement('cancelar'); echo $_form->createOnlyElement($element);?>                               
                            </div>
                        </div>        
                        <?php echo $_form->closeForm();?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <hr/>
                        <div class='table-responsive'>
                        <table id="tblClientes" class="table table-striped table-hover table-condensed">
                            <thead>
                            <th class="text-center col-md-1">Accion</th>
                            <th class="text-center"><?php echo $_translator->_getTranslation('No.');?></th>
                            <th class="text-center"><?php echo $_translator->_getTranslation('Nombre');?></th>
                            <th class="text-center"><?php echo $_translator->_getTranslation('Contacto');?></th>
                            <th class="text-center"><?php echo $_translator->_getTranslation('Telefono');?></th>
                            <th class="text-center"><?php echo $_translator->_getTranslation('Correo');?></th>
                            </thead>
                            <tbody>
                            <?php 
                                if($_listaClientes){
                                    foreach($_listaClientes as $cliente){?>
                                        <tr>
                                            <td class="text-center">
                                                <a href="Customer.php?action=edit&id=<?php echo $cliente['id']?>"><i class="fa fa-pencil btn btn-sm btn-default"></i></a>
                                                <a onclick="return deleteRegistry('Customer.php?action=delete&id=<?php echo $cliente['id']?>')" 
                                                   href="#"><i class="fa fa-trash btn btn-sm btn-danger"></i></a>
                                            </td>
                                            <td class="text-center"><?php echo $cliente['id']?></td>
                                            <td class="text-center"><?php echo $cliente['nombre']?></td>
                                            <td class="text-center"><?php echo $cliente['contacto']?></td>
                                            <td class="text-center"><?php echo $cliente['telefono']?></td>
                                            <td class="text-center"><?php echo $cliente['correo']?></td>
                                        </tr><?php
                                    }                   
                                }?>
                            </tbody>
                        </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" language="javascript">
	$('#tblClientes').DataTable({
            paginate:true,
            filter:true,
            pageLength: 100
        });
        $('#tblClientes')
		.removeClass( 'display' )
		.addClass('table table-striped table-bordered');
</script>