<?php echo $__env->make('admin.header', [
   'elementActive' => 'layout'
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="content-wrapper">

    <section class="content-header">
      <h1>
      Imagens	      <small></small>
      </h1> 
    </section>

    <!-- Main content -->
    <section class="content">
    <div class="row">
        
        <div class="col-xs-12">    		
          <form method="post" id="form_apagar" name="form_apagar">

            <!-- box -->
            <div class="box">
                <div class="box-body">

                                            
                    <div id="tabela1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                        <div class="row">
                            <div class="col-sm-12"><table id="tabela1" class="table table-bordered table-striped dataTable no-footer" role="grid" aria-describedby="tabela1_info">

                        <thead>
                            <tr role="row">
                                <th>Titulo</th>
                                <th>Imagem</th>
                                <th>Descrição</th>
                                <th>Opt.</th>
                            </tr>
                        </thead>
                        
                        <tbody>
                            <?php $__currentLoopData = $layouts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $layout): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr role="row" class="odd">
                                <td><?php echo e($layout->name); ?></td>
                                <td><img src="<?php echo e(asset($layout->image)); ?>" width="80px"/></td>
                                <td><?php echo e($layout->description); ?></td>
                                <td>
                                    <input type="button" class="btn btn-primary" value="Editar" onclick="openModalEdit(<?php echo e($layout->id); ?>, '<?php echo e($layout->description); ?>', '<?php echo e(asset($layout->image)); ?>')"/>            
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            
                            
                        </tbody>

                    </table></div></div>
                    </div>

                    <div class="col-12">
                        <div class="col-12 text-right">
                           <?php echo $layouts->links("pagination::bootstrap-4"); ?>

   
                        </div>
                    </div>

                </div>

            </div>
            <!-- /.box -->

        </form>
        </div>

    </div>
    <!-- /.row -->
</section>
<!-- /.content -->

</div>
<?php echo $__env->make('admin.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<script>
function openModalEdit(id, description, image){
        $('#id_layout').val(id);
        $('#name').val(name);
        $('#description').html(description);
        $("#image").attr("src",image);

        $("#update").modal();
    }
</script>

<div id="update" class="modal fade" role="dialog">
    <div class="modal-dialog modal-md">
       <!-- Modal content-->
       <div class="modal-content" id="conteudo_modal">
          <div class="modal-header">
             <button type="button" class="close" data-dismiss="modal">×</button>
             <h5 class="modal-title modal_titulo">Editar anúncio</h5>
          </div>
          <div class="modal-body" id="modal_conteudo_m">
             <style type="text/css">
                .bootstrap-timepicker-widget table{
                background-color: #fff !important;
                }
             </style>
             <form action="<?php echo e(route('admin.layout.update')); ?>" class="form-horizontal" method="post" enctype="multipart/form-data">
                 <?php echo csrf_field(); ?>
                 <?php echo method_field('PUT'); ?>
                 <input type="text" name="id_layout" id="id_layout" hidden />
                <fieldset>
 
                   <div class="form-group">
                      <label class="col-md-12">Imagem</label>
                      <div class="col-md-12">
                         <center><img id="image" src="" width="300px"/></center>
    
                         <fieldset> 
                            <label>Imagem</label> 
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <div class="input-append">
                                  <div class="uneditable-input">
                                    <i class="fa fa-file fileupload-exists"></i>
                                    <span class="fileupload-preview"></span>
                                  </div>
                                  <span class="btn btn-default btn-file">
                                  <span class="fileupload-exists">Alterar</span>
                                  <span class="fileupload-new">Procurar arquivo</span>
                                    <input type="file" name="file">
                                  </span>
                                  <a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remover</a>
                                </div>
                            </div>
                          </fieldset>
                          <br>
                          <span style="color: #ff0000;" id="description"></span>
    
    
                      </div>
                   </div>
                   <div style="text-align: left; width: 100%;">
                      <button type="submit" class="btn btn-primary">Salvar</button>
                   </div>
                </fieldset>
             </form>
             <script type="text/javascript">
                $(document).ready(function() {
                
                  $('.timepicker').timepicker({
                    showInputs: false,
                    showMeridian: false
                  });
                
                });
             </script>
          </div>
          <div class="modal-footer">
             <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
          </div>
       </div>
    </div>
    </div><?php /**PATH C:\GIT\sitemoderno\Modules/Layout\Resources/views/admin/index.blade.php ENDPATH**/ ?>