<!-- Modal -->
<div id="modalAddStore"  class='modal fade' data-backdrop="static" data-keyboard="false" role="dialog" style=" overflow: hidden;background: transparent">
    <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
        <div class="modal-body"> 
            <div class="box box-primary">
            <div class="box-header with-border">
                <button type="button" class="close _closeModalStore"><i class="fa fa-window-close"></i></button>
                <h4><i class='fa-fw fa fa-map-marker'></i> <span id="title_modal_store"><?php echo $_translator->_getTranslation('Agregar sucursal');?></span></h4>
            </div>
                <?php 
                echo $form->openForm();
                echo $form->showActionController();
                echo $form->showId();?>
                <div class="box-body">
                    <div class='flashmessenger'><?php $flashmessenger->showMessage(true);?></div>
                    <div class="card">
                        <ul class="nav nav-tabs" role="tablist">
                                <li role="presentation" class="active"><a href="#general" aria-controls="home" role="tab" data-toggle="tab"><?php echo $_translator->_getTranslation('Informacion general') ?></a></li>                
                                <li role="presentation"><a href="#schedule" aria-controls="profile" role="tab" data-toggle="tab"><?php echo $_translator->_getTranslation('Horario') ?></a></li>                
                        </ul>
                        <br/>
                         <div class="tab-content">
                            <div role="tabpanel" class="tab-pane active" id="general">
                                <div class="col-md-6 col-xs-12">
                                    <?php
                                    $form->showElement('name');
                                    $form->showElement('address');
                                    $form->showElement('city');
                                    $form->showElement('state');
                                    $form->showElement('zipcode');
                                    ?>
                                </div>
                                <div class="col-md-6 col-xs-12">
                                    <?php
                                    $form->showElement('contact_name');
                                    $form->showElement('phone');
                                    $form->showElement('fax');
                                    $form->showElement('email');
                                    $form->showElement('default_location');
                                    /*$form->showElement('webpage');*/
                                    $form->showElement('status');
                                    ?>           
                                </div>     
                            </div>
                            <div role="tabpanel" class="tab-pane" id="schedule">
                                <table class='table table-condensed table-striped'>
                                    <thead>
                                        <tr>
                                            <th class='text-center'><?php echo $_translator->_getTranslation('Dia') ?></th>
                                            <th class='text-center'><?php echo $_translator->_getTranslation('Abre') ?></th>
                                            <th class='text-center'><?php echo $_translator->_getTranslation('Cierra') ?></th>
                                            <th class='text-center'><?php echo $_translator->_getTranslation('Abre') ?></th>
                                            <th class='text-center'><?php echo $_translator->_getTranslation('Cierra') ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Lunes') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_monday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_monday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_monday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_monday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Martes') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_tuesday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_tuesday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_tuesday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_tuesday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Miercoles') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_wednesday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_wednesday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_wednesday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_wednesday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Jueves') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_thursday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_thursday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_thursday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_thursday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Viernes') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_friday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_friday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_friday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_friday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Sabado') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_saturday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_saturday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_saturday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_saturday_2')) ?></td>
                                    </tr>
                                    <tr>
                                        <th class='text-center'><?php echo $_translator->_getTranslation('Domingo') ?></th>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_sunday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_sunday')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('start_schedule_sunday_2')) ?></td>
                                        <td class='text-center'><?php echo $form->createOnlyElement($form->getElement('end_schedule_sunday_2')) ?></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                         </div>
                    </div>                    
                </div>
                <div class="box-footer">
                    <div class="pull-right">
                        <input type="submit" value="<?php echo $_translator->_getTranslation('Terminar')?>" class='btn btn-primary'/>
                    </div>
                    <div class="pull-left">
                        <input type="button" value="<?php echo $_translator->_getTranslation('Cancelar')?>" class="btn btn-default _closeModalStore" />
                    </div>
                </div>
                <?php echo $form->closeForm();?>
            </div>
        </div>
    </div>           
    </div>
<style>
table td{
    position:relative;
}
</style>
<script>
    $('#modalAddStore').on('shown.bs.modal', function (e) {
        if($('#action').val() === 'insert'){$('#name').focus();}

        var input = null;
        $("form[name=store]").find('div').each(function() {
            if($(this).hasClass('has-error') === true){
                input = $(this).data('errorfor');
                return false;
            }
        });    

        if(input !== null){$('#'+input).focus();}

        $('._time').datetimepicker({format: 'HH:mm'})
    });
</script>
</div>