
<?php $__env->startSection('content_header'); ?>
    <div class="content-section">
        <div class="content-wrapper w-container">
            <div class="masterbreadcrumb">
                <div class="container">
                    <div class="breadcrumb">
                        <a href="/">
                            <span class="breadcrumb__inner">
                                <span class="breadcrumb__title">Página inicial</span>
                            </span>
                        </a>
                        <a href="<?php echo e(route('site.diariooficial.index')); ?>" class="w--current">
                            <span class="breadcrumb__inner">
                                <span class="breadcrumb__title">Diário Oficial</span>
                            </span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="w-col w-col-12">
                <div class="post-content-text">
                    <h5>Último documento inserido</h5>
                    <div class="w-row">
                        <div class="w-col w-col-4">
                            <div class="inforquadro3">
                                <i class="fa-solid fa-list-check fa-2x"></i><br><small>Última publicação</small><br>
                                <span class="card-text text-center"><?php echo e($diariooficial->first()->nome ?? ''); ?></span>
                            </div>
                        </div>
                        <div class="w-col w-col-4">
                            <div class="inforquadro3">
                                <i class="fa-regular fa-calendar-days fa-2x"></i><br><small>Última data</small><br>
                                <span class="card-text text-center"><?php echo e($diariooficial->first()->data ?? ''); ?></span>
                            </div>
                        </div>
                        <div class="w-col w-col-4">
                            <div class="inforquadro3">
                                <i class="fa-regular fa-folder-open fa-2x"></i><br><small>Total de arquivos</small><br>
                                <span class="card-text text-center"><?php echo e($diariooficial->count() ?? ''); ?></span>
                            </div>
                        </div>
                    </div>

                    <div class="entry-content p-4">
                        <h1 class="entry-title">
                            Buscar documentos <?php if(request('categoria')): ?> - Categoria: <?php echo e($tipos->find(request('categoria'))->tipo_nome); ?> <?php endif; ?>
                        </h1>
                        <div class="dyn-list">
                            <form action="<?php echo e(route('site.diariooficial.buscar')); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <div class="w-row">
                                    <div class="w-col w-col-6">
                                        <label for="">Palavra chave</label>
                                        <input type="text" class="form-control" name="palavra_chave" placeholder="Palavra chave">
                                    </div>
                                    <div class="w-col w-col-4">
                                        <label for="">Nº da Edição</label>
                                        <input type="text" class="form-control" name="numero_edicao" placeholder="Nº da Edição">
                                    </div>
                                    <div class="w-col w-col-2">
                                        <label for="">Ano</label>
                                        <select class="form-control" name="ano">
                                            <option value="">Ano</option>
                                            <?php for($i = 2016; $i <= date('Y'); $i++): ?>
                                                <option value="<?php echo e($i); ?>"><?php echo e($i); ?></option>
                                            <?php endfor; ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="w-row">
                                    <div class="w-col w-col-6">
                                        <label for="">Período</label>
                                        <input type="date" class="form-control" name="inicio">
                                    </div>
                                    <div class="w-col w-col-6">
                                        <label for="">Até</label>
                                        <input type="date" class="form-control" name="fim">
                                    </div>
                                </div>
                                <div class="w-row">
                                    <div class="w-col w-col-6">
                                        <label for="">Categoria</label>
                                        <select class="form-control" name="categoria">
                                            <option value="">Categoria</option>
                                            <?php $__currentLoopData = $tipos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($tipo->id); ?>" <?php echo e(request('categoria') == $tipo->id ? 'selected' : ''); ?>>
                                                    <?php echo e($tipo->tipo_nome); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                    <div class="w-col w-col-6">
                                        <label for="">Órgão</label>
                                        <select class="form-control" name="orgao">
                                            <option value="">Órgão</option>
                                            <?php $__currentLoopData = $secretarias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $secretaria): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($secretaria->id); ?>"><?php echo e($secretaria->nome); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                                <br>
                                <button type="submit" class="btn btn-sm btn-primary inforquadro3">Buscar</button>
                            </form>
                        </div>
                    </div>

                    <h6>Resultado da busca</h6>
                    <div class="w-row">
                        <?php $__currentLoopData = $diariooficial; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $arquivo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="w-col w-col-6">
                                <div class="inforquadro3">
                                    <a href="<?php echo e(asset('assets/site/uploads/' . $entidade->id_tce . '/dom/diario/' . $arquivo->nome)); ?>" class="titulo_infor" target="_blank">
                                        <i class="fa-solid fa-list-check fa-2x"></i>
                                        <h6 style="color: #fff"><?php echo e($arquivo->titulo); ?></h6>
                                    </a>
                                    <br>
                                    <h6 style="color: #fff"><?php echo e(date('d/m/Y', strtotime($arquivo->publicacao))); ?></h6>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </div>

                    <nav class="basepagina" aria-label="Page navigation">
                        <ul class="pagination justify-content-center">
                            <?php if($diariooficial->onFirstPage()): ?>
                                <li class="page-item disabled">
                                    <span class="page-link">Anterior</span>
                                </li>
                            <?php else: ?>
                                <li class="page-item">
                                    <a class="page-link" href="<?php echo e($diariooficial->previousPageUrl()); ?>" aria-label="Previous">
                                        <span aria-hidden="true">&laquo; Anterior</span>
                                    </a>
                                </li>
                            <?php endif; ?>

                            <?php $__currentLoopData = $diariooficial->links()->elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if(is_string($element)): ?>
                                    <li class="page-item disabled"><span class="page-link"><?php echo e($element); ?></span>
                                    </li>
                                <?php endif; ?>

                                <?php if(is_array($element)): ?>
                                    <?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="page-item <?php echo e($page == $diariooficial->currentPage() ? 'active' : ''); ?>">
                                            <a class="page-link" href="<?php echo e($url); ?>"><?php echo e($page); ?></a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            <?php if($diariooficial->hasMorePages()): ?>
                                <li class="page-item">
                                    <a class="page-link" href="<?php echo e($diariooficial->nextPageUrl()); ?>" aria-label="Next">
                                        <span aria-hidden="true">Próximo &raquo;</span>
                                    </a>
                                </li>
                            <?php else: ?>
                                <li class="page-item disabled">
                                    <span class="page-link">Próximo</span>
                                </li>
                            <?php endif; ?>
                        </ul>
                    </nav>
                    <br>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('site.layouts.layout_1', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\portalmunicipal\resources\views/site/diariooficial/index.blade.php ENDPATH**/ ?>