

<?php $__env->startSection('title', 'Dashboard'); ?>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        #contenedor-vista {
            /* display: grid; */
            display: flex;
            grid-template-columns: auto repeat(var(--columnas), 5fr);
            width: fit-content;
            margin: auto;
        }

        .tabla-hexagonos {
            display: grid;
            grid-template-columns: repeat(var(--columnas), 1fr);
            grid-template-rows: repeat(var(--filas), 1fr);
            grid-gap: 2px;
            /* margin-top: 20px; */
        }

        .encabezado-filas, .encabezado-columnas, .tabla-hexagonos {
            display: grid;
            grid-gap: 2px;
            transform: scale(1);

        }

        .numero {
            /* border: 1px solid #ccc; */
            text-align: center;
            padding: 5px; /* Ajusta según tus necesidades */
            transform: scale(1);
            width: 64px;
            display: flex;
            align-items: center;
            vertical-align: middle;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
        }

        .encabezado-filas {
            display: grid;
            grid-template-columns: 1fr;
            grid-gap: 2px;
            transform: scale(1);
        }
        
        .encabezado-columnas {
            padding-left : 54px;
            margin : 5px;
            display: flex;
            flex-direction: row;
            transform: scale(1);
        }

        .encabezado-celda {
            background-color: #64C7CC;
            height: 12px;
            width: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
        }
    </style>

<?php $__env->startSection('content_header'); ?>
    <h1>REGISTRO DE PABELLON</h1>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<?php if (isset($component)) { $__componentOriginal0016fe8f62f0dc60d54a606049e169e1ae7c8127 = $component; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Widget\Card::resolve(['title' => 'REGISTRO DE PABELLON','theme' => 'dark','themeMode' => 'outline','bodyClass' => 'bg-light','headerClass' => '','footerClass' => 'bg-light border-top rounded border-light','icon' => 'fas fa-lg fa-building','collapsible' => true,'maximizable' => true] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Widget\Card::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'elevation-3']); ?>
    <form action="<?php echo e(route('storePabellon')); ?>" method="POST">
        <?php echo csrf_field(); ?>
        <div class="modal-body">
            <div class="card-body">
                <div class="row ">
                    <div class="col-md-6">
                        <div class="row">
                            <div class="col-md-12">
                                <label>NOMBRE PABELLON</label>
                                <?php if (isset($component)) { $__componentOriginal7d1474369c7a69c75ad2fc0edfd903b7880af2ff = $component; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['name' => 'nameCreate','id' => 'nameCreate','labelClass' => 'text-lightblue'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'text','required' => true,'autocomplete' => 'off','placeholder' => 'Ingrese nombre']); ?>
                                     <?php $__env->slot('prependSlot', null, []); ?> 
                                        <div class="input-group-text">
                                            <i class="fas fa-user text-dark"></i>
                                        </div>
                                     <?php $__env->endSlot(); ?>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7d1474369c7a69c75ad2fc0edfd903b7880af2ff)): ?>
<?php $component = $__componentOriginal7d1474369c7a69c75ad2fc0edfd903b7880af2ff; ?>
<?php unset($__componentOriginal7d1474369c7a69c75ad2fc0edfd903b7880af2ff); ?>
<?php endif; ?>  
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="row">
                            <div class="col-md-12">
                                <label>CANTIDAD DE COLUMNAS</label>                                       
                                <?php if (isset($component)) { $__componentOriginal325d3d6934803fba81e0289d299b9960546803c2 = $component; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Select::resolve(['name' => 'columnasCreate','id' => 'columnasCreate','labelClass' => 'text-lightblue'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-select'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Select::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'text','required' => true,'autocomplete' => 'off','placeholder' => 'Ingrese cantidad de columnas']); ?>
                                     <?php $__env->slot('prependSlot', null, []); ?> 
                                        <div class="input-group-text">
                                            <i class="fas fa-user text-dark"></i>
                                        </div>
                                     <?php $__env->endSlot(); ?>
                                    <option value="0">seleccione</option>
                                    <option value="16">16</option>
                                    <option value="17">17</option>
                                    <option value="18">18</option>
                                    <option value="19">19</option>
                                    <option value="20">20</option>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal325d3d6934803fba81e0289d299b9960546803c2)): ?>
<?php $component = $__componentOriginal325d3d6934803fba81e0289d299b9960546803c2; ?>
<?php unset($__componentOriginal325d3d6934803fba81e0289d299b9960546803c2); ?>
<?php endif; ?>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="row">
                            <div class="col-md-12">
                                <label>CANTIDAD DE FILAS</label>                                       
                                <?php if (isset($component)) { $__componentOriginal325d3d6934803fba81e0289d299b9960546803c2 = $component; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Select::resolve(['name' => 'filasCreate','id' => 'filasCreate','labelClass' => 'text-lightblue'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-select'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Select::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'text','required' => true,'autocomplete' => 'off','placeholder' => 'Ingrese cantidad de filas']); ?>
                                     <?php $__env->slot('prependSlot', null, []); ?> 
                                        <div class="input-group-text">
                                            <i class="fas fa-id-card text-dark"></i>
                                        </div>
                                     <?php $__env->endSlot(); ?>
                                    <option value="0">seleccione</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                    <option value="6">6</option>
                                    <option value="7">7</option>
                                    <option value="8">8</option>
                                    <option value="9">9</option>
                                    <option value="10">10</option>
                                    <option value="11">11</option>
                                    <option value="12">12</option>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal325d3d6934803fba81e0289d299b9960546803c2)): ?>
<?php $component = $__componentOriginal325d3d6934803fba81e0289d299b9960546803c2; ?>
<?php unset($__componentOriginal325d3d6934803fba81e0289d299b9960546803c2); ?>
<?php endif; ?>
                            </div>
                        </div>
                    </div>
                    <div  style="overflow-x: inherit">
                        <div class="encabezado-columnas"></div>
                        <div id="contenedor-vista">
                            <!-- <div class="numero">LADO B</div> -->
                            <div class="encabezado-filas"></div>
                            <div class="tabla-hexagonos"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer justify-content-between">
            <button type="submit" class="btn btn-primary">Guardar</button>
        </div>
    </form>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0016fe8f62f0dc60d54a606049e169e1ae7c8127)): ?>
<?php $component = $__componentOriginal0016fe8f62f0dc60d54a606049e169e1ae7c8127; ?>
<?php unset($__componentOriginal0016fe8f62f0dc60d54a606049e169e1ae7c8127); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('css'); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
    $(document).ready(function() {
    $('#filasCreate, #columnasCreate').on('change', function() {
        var filas = parseInt($('#filasCreate').val());
        var columnas = parseInt($('#columnasCreate').val());

        if (!isNaN(filas) && !isNaN(columnas)) {
            actualizarTabla(filas, columnas);
        }
    });

    function actualizarTabla(filas, columnas) {
        document.documentElement.style.setProperty('--filas', filas);
        document.documentElement.style.setProperty('--columnas', columnas);

        mostrarHexagonos(filas, columnas);
    }

    function mostrarHexagonos(filas, columnas) {
        var contenedorFilas = $('.encabezado-filas');
        var contenedorColumnas = $('.encabezado-columnas');
        var contenedorTabla = $('.tabla-hexagonos');

        contenedorFilas.empty();
        contenedorColumnas.empty();
        contenedorTabla.empty();

        var letras = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
        for (var i = 0; i < filas; i++) {
            var letra = letras[i];
            var filaHtml = '<div class="numero">' + letra + '</div>';
            contenedorFilas.append(filaHtml);
        }

        for (var j = 1; j <= columnas; j++) {
            var columnaHtml = '<div class="numero">' + j + '</div>';
            contenedorColumnas.append(columnaHtml);
        }
        contenedorTabla.css('--columnas', columnas);

        for (var i = 65; i < 65 + filas; i++) { 
            var letra = String.fromCharCode(i);
            
            for (var j = 1; j <= columnas; j++) {
                var idTumba = 'tumba-' + letra + '-' + j;
                var imagenTumba = '<?php echo e(asset("vendor/adminlte/dist/img/tumbaGreen.png")); ?>';
                var hexagonHtml = '<div id="' + idTumba + '"><img src="'+imagenTumba+'" alt="Hexagono"></div>';
                contenedorTabla.append(hexagonHtml);
            }
        }
    }
});
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\cementerio\resources\views/administracion/pabellon/pabellonCreate.blade.php ENDPATH**/ ?>