<?php $__env->startSection('content'); ?>
    <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk="
        crossorigin="anonymous"></script>
    <script type="text/javascript" src="<?php echo e(asset('js/acompanhamento.js')); ?>"></script>
    <script type="text/javascript">
    $(function(){
        $("#form").submit(function(f){
            verificaForm(f, $("#idSetor"));
        });
    });
    </script>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="h3">Solicitação n°<?php echo e($protocolo->id); ?></div>
                    <div class="card-body">

                        <a href="<?php echo e(Auth::user()->nivel == 1 ? url('cadastrador/solicitacoes') : route('funcionario.home')); ?>"
                            title="Back"><button class="btn btn-warning  btn-hero btn-sm"><i class="fa fa-arrow-left"
                                    aria-hidden="true"></i> Voltar</button></a>
                        <br />
                        <br />
                        <?php if($usuario->name): ?>
                            <div class="row">
                                <div class="col-12">
                                    <div class="mx-auto px-auto alert alert-warning">
                                        <strong>Atenção!</strong><br>
                                        <span>Esta manifestação foi aberta por um usuário(a) que não quis indentificar-se. Portanto, não é possível contatá-lo(a) para responder.</span>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>
                        <div class="table-responsive">
                            <table class="table">
                                <tbody>
                                    <tr>
                                        <th> Autor(a) </th>
                                        <td> <?php echo e($usuario->name); ?></td>
                                    </tr>
                                    <tr>
                                        <th> Telefone </th>
                                        <td> <?php echo e($usuario->telefone); ?></td>
                                    </tr>
                                    <tr>
                                        <th> Tipo </th>
                                        <td style="text-transform: capitalize;"> <?php echo e($protocolo->tipo); ?> </td>
                                    </tr>
                                    <tr>
                                        <th> Status </th>
                                        <td style="text-transform: capitalize;"> <?php echo e($protocolo->status); ?> </td>
                                    </tr>
                                    <tr>
                                        <th> Codigo </th>
                                        <td style="text-transform: capitalize;"> <?php echo e($protocolo->codigo); ?> </td>
                                    </tr>

                                    <tr>
                                        <th> Data de Criação </th>
                                        <td> <?php echo e(date_format(date_create($protocolo->created_at), 'd/m/Y')); ?> </td>
                                    </tr>
                                    <tr>
                                        <th> Setor Responsável </th>
                                        <td> <?php echo e($protocolo->idSetor); ?> </td>
                                    </tr>
                                    <tr>
                                        <th> Descrição </th>
                                        <td style="text-transform: capitalize;"> <?php echo e($protocolo->descricao); ?> </td>
                                    </tr>

                                    <tr>

                                        <td> </td>
                                    </tr>


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

                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <?php if(isset($acompanhamentos)): ?>
            <?php $__currentLoopData = $acompanhamentos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indice => $acompanhamento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-lg-1"></div>
                <div class="col-lg-10 alert <?php if($nivel[$indice] == 1 || $nivel[$indice] == 2): ?> <?php echo e('alert-primary'); ?> <?php else: ?> <?php echo e('alert-secondary'); ?> <?php endif; ?> mb-15">
                    <b>Por&nbsp;
                        <?php echo e($acompanhamento->idUsuario); ?>

                    </b>
                    em
                    <b>
                        <?php echo e(date_format(date_create($acompanhamento->created_at), 'd/m/Y H:i')); ?>

                    </b>
                    <br>
                    <p><?php echo e($acompanhamento->descricao); ?></p>
                </div>
                <div class="col-lg-1"></div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
    </div>
    <?php if(Auth::user()->nivel == 1 && ($protocolo->status == 'aberta' || $protocolo->status == 'atrasada')): ?>
        <div class="container mb-10">
            <div class="row">
                <form id="form" method="POST" action="<?php echo e(route('protocolo.updateSetor')); ?>">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="id" value="<?php echo e($protocolo->id); ?>">
                    <div class="form-group">
                        <label for="idSetor" class="form-label">Atribua esta manifestação a um setor</label>
                        <div id="alerta-setor" class="alert alert-warning" style="display: none;">
                            <p>Escolha ao menos um setor</p>
                        </div>
                        <select name="idSetor" id="idSetor" class="form-control">
                            <option >Escolha o Setor</option>
                            <?php $__currentLoopData = $setores; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indice => $setor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e(intval(trim($indice, "'"))); ?>"><?php echo e($setor); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <br>
                    <button class="btn btn-info ">Encaminhar ao Setor</button>
                </form>
            </div>
        </div>
    <?php elseif(Auth::user()->nivel == 2 && ($protocolo->status == 'encaminhada' || $protocolo->status == 'atrasada')): ?>
        <div class="row">
            <div class="col-lg-1"></div>
            <div class="col-lg-10" id="novoAcompanhamento">
            </div>
            <div class="col-lg-1"></div>
        </div>
        <div class="row" id="responder">
            <div class="col-lg-1"></div>
            <div class="col-lg-11">
                <a class="btn btn-info text-white"
                    onclick="mostraForm(<?php echo e(Auth::user()->id . ', \'' . url('acompanhamento/armazena') . '\', ' . $protocolo->id . ', \'' . csrf_token() . '\''); ?>)">Responder</a>
            </div>
        </div>
    <?php elseif($protocolo->status == 'fechada'): ?>
    <?php endif; ?>


<?php $__env->stopSection(); ?>

<?php echo $__env->make('modelo.modelo', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\ouvidoria\resources\views/protocolo/show.blade.php ENDPATH**/ ?>