Files
sirpremiumv2/resources/views/livewire/show-top.blade.php
T

160 lines
9.3 KiB
PHP
Executable File

<div class="h-full w-full md:my-2">
<div class="bg-[#f5f5f5] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-2">
<div class="flex justify-start my-2 items-center mb-4">
<div class="flex text-sm">
<x-icon-arrow-right />
Distribuidores
</div>
</div>
{{-- tabla --}}
<div
class="mx-auto bg-white grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 shadow-md xl:mx-10 mb-8 ">
<p class="text-center font-semibold text-base sm:text-2xl">Mejores distribuidores del mes</p>
<div class="text-center w-full">
<img src="{{ asset($configuracion->img_top) }}" alt=""
class="object-cover h-24 sm:h-48 w-full rounded-lg shadow my-3">
<p class=" text-sm sm:text-base my-2 ">{{ $configuracion->mensaje_top }}</p>
</div>
<div class="flex items-center justify-between mx-8 my-4">
<label class="inline-flex items-center cursor-pointer">
<input type="checkbox" wire:model="showLastMonth" class="hidden" />
@if ($showLastMonth)
<div class="w-12 h-6 bg-[#d6a5ee] rounded-full shadow-inner flex justify-end">
<div class="w-6 h-6 rounded-full bg-[#b221fd]"></div>
</div>
@else
<div class="w-12 h-6 bg-gray-300 rounded-full shadow-inner flex justify-start">
<div class="w-6 h-6 rounded-full bg-gray-600"></div>
</div>
@endif
<div class="ml-2 font-medium text-gray-700">Mostrar resultados del mes pasado</div>
</label>
@if (Auth::user()->rol->nombre == 'super')
<div class="flex flex-col items-center justify-center">
<x-primary-button wire:click="entregarPremio" class="ml-4 disabled:cursor-not-allowed"
:disabled="$consultaPremioEntregado">Entregar premios de
{{ Carbon\Carbon::now()->subMonth()->format('M') }}</x-primary-button>
@if ($consultaPremioEntregado)
<span class="text-xs pt-1 text-gray-400 cursor-not-allowed">
Los premios del mes de {{ Carbon\Carbon::now()->subMonth()->format('M') }} ya fueron
entregados
</span>
@endif
</div>
@endif
</div>
<table
class="sm:text-base text-sm text-center rounded-lg shadow-lg m-auto sm:mt-4 mb-4 border-separate border-spacing-y-2"
wire:loading.class="opacity-50 cursor-wait">
<thead class="font-normal bg-[#000029] text-white h-9">
<tr class="text-left">
<th class="rounded-l-lg font-normal pl-[1rem] sm:pl-[2rem]"></th>
<th class="font-normal pl-[1rem] sm:pl-[2rem]">Nombre</th>
<th class="font-normal pl-[1rem] sm:pl-[2rem] hidden">Email</th>
<th class="font-normal pl-[1rem] sm:pl-[2rem]">Ventas</th>
<th class="font-normal pl-[1rem] sm:pl-[2rem]">Premio</th>
<th class="rounded-r-lg font-normal sm:pr-[2rem] sm:pl-[2rem]"></th>
</tr>
</thead>
@php
$i = 0;
@endphp
<tbody class="text-gray-500 select-none">
@foreach ($usuarios as $usuario)
@if ($usuario->name == 'usuarioEliminado')
@else
@php
$i++;
@endphp
<tr class="border-gray-200 text-left w-full pl-4">
<td class="pl-[1rem] sm:pl-[2rem]">
<img src="{{ asset('img/' . $i . '.png') }}" alt="" class="w-12">
</td>
<td class="pl-[1rem] sm:pl-[2rem]">{{ $usuario->name }}</td>
<td class="pl-[1rem] sm:pl-[2rem] hidden">{{ $usuario->email }}</td>
<td class="pl-[1rem] sm:pl-[2rem]">{{ $usuario->historiales_venta_count }}</td>
@if ($i == 1)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_1) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_1 }}</span>
</td>
@elseif ($i == 2)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_2) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_2 }}</span>
</td>
@elseif ($i == 3)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_3) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_3 }}</span>
</td>
@elseif ($i == 4)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_4) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_4 }}</span>
</td>
@elseif ($i == 5)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_5) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_5 }}</span>
</td>
@elseif ($i == 6)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_6) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_6 }}</span>
</td>
@elseif ($i == 7)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_7) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_7 }}</span>
</td>
@elseif ($i == 8)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_8) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_8 }}</span>
</td>
@elseif ($i == 9)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_9) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_9 }}</span>
</td>
@elseif ($i == 10)
<td class="pl-[1rem] pr-[1rem] sm:pl-[2rem] flex">
<img src="{{ asset($configuracion->top_10) }}" alt=""
class="h-4 w-4 sm:h-6 sm:w-6 object-cover">
<span class="pl-1 ms:pl-3">{{ $configuracion->premio_10 }}</span>
</td>
@endif
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
@include('layouts.footer')
</div>