582 lines
46 KiB
PHP
582 lines
46 KiB
PHP
<div x-data="{ verCliente: @entangle('verCliente'), vencidosHoy: @entangle('vencidosHoy') }" class="h-full w-full md:my-2">
|
|
|
|
<div class=" fixed backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading
|
|
wire:target="verCliente">
|
|
<div class="grid h-full place-items-center ">
|
|
<div class="max-w-xs">
|
|
<img src="./img/loading.gif" alt="" class="w-full text-center">
|
|
<p class="text-gray-500 text-center">Cargando</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Buscador --}}
|
|
<div
|
|
class="bg-[#f5f5f5] m-auto p-2 md:p-5 rounded-[1.2rem] w-auto mb-4 x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
|
|
<div class="md:flex justify-center my-2 items-center text-center ">
|
|
<div class="flex text-sm">
|
|
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0"
|
|
viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
|
|
<g>
|
|
<path
|
|
d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z"
|
|
fill="#b221fd" data-original="#000000" />
|
|
</g>
|
|
</svg>
|
|
Clientes
|
|
</div>
|
|
<div class=" flex relative text-sm mx-auto w-64 md:w-auto my-2">
|
|
<input id="buscar" type="search" wire:model="buscar" placeholder="Buscar"
|
|
class=" shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-[0.8rem] pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
|
|
<svg class="w-5 absolute top-2 right-3" xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute"
|
|
x="0" y="0" viewBox="0 0 24 24"
|
|
style="enable-background:new 0 0 512 512;rotate: 90deg;" xml:space="preserve" class="">
|
|
<g>
|
|
<g id="Layer_31" data-name="Layer 31">
|
|
<path
|
|
d="m21.71 20.29-5.4-5.39a7.92 7.92 0 0 0 1.69-4.9 8 8 0 1 0 -8 8 7.92 7.92 0 0 0 4.9-1.69l5.39 5.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zm-17.71-10.29a6 6 0 1 1 6 6 6 6 0 0 1 -6-6z"
|
|
fill="#b221fd" data-original="#000000" class=""></path>
|
|
</g>
|
|
</g>
|
|
</svg>
|
|
</div>
|
|
<div class="text-sm mr-auto ">
|
|
<label for="cbox2">Vencidos (Hace 5 días)</label>
|
|
<input type="checkbox" name="" id="cbox2" wire:model="venceHoy">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{-- tabla clientes --}}
|
|
<div class="overflow-y-auto max-h-full overflow-x-auto w-full mx-auto text-sm">
|
|
<table class="w-full text-center mt-4 border-separate border-spacing-y-2">
|
|
<thead class="font-normal bg-[#000029] text-white h-9">
|
|
<tr class="text-left">
|
|
<th class="rounded-l-lg font-normal w-1/8 pl-2 sm:w-1/8 ">Nombre</th>
|
|
<th class="font-normal w-1/8 sm:w-1/8 pl-2 ">Correo</th>
|
|
<th class="font-normal w-1/8 sm:w-1/8 pl-2 ">Compra</th>
|
|
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Servicio</th>
|
|
<th class="font-normal w-1/8 sm:w-1/8 pl-2 px-6">Vence</th>
|
|
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Restante</th>
|
|
<th class="font-normal w-1/8 pl-2 sm:w-1/8 "></th>
|
|
<th class="rounded-r-lg w-1/8 font-normal sm:w-1/8 "></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-gray-500 select-none ">
|
|
@foreach ($clientes as $cliente)
|
|
<tr class="border-gray-200 text-left w-full pl-4 hover:bg-gray-200 hover:ring-gray-500 "
|
|
x-data="{ openOption: false }">
|
|
|
|
<td class="pl-2">{{ $cliente->nombre_cliente ?? $cliente->cliente->name }}</td>
|
|
<td class="pl-2">{{ $cliente->cliente->email ?? '' }}</td>
|
|
<td class="pl-2">
|
|
{{ Carbon\Carbon::parse($cliente->created_at)->locale('co')->Format('d M Y, h:m a') ?? '' }}
|
|
</td>
|
|
|
|
@if (!empty($cliente->tarifa_id))
|
|
<td class="pl-2">{{ $cliente->tarifa->servicio->nombre }}
|
|
|
|
@if ($cliente->tarifa->servicio->nombre != 'Spotify Premium' && $cliente->tarifa->servicio->nombre != 'Youtube Premium')
|
|
{{ $cliente->tarifa->pantallas }} Pantallas
|
|
@endif
|
|
|
|
</td>
|
|
@endif
|
|
|
|
@if (!empty($cliente->promocion_id))
|
|
<td class="pl-2">{{ $cliente->promocion->nombre }}
|
|
</td>
|
|
@endif
|
|
|
|
<td class="pl-2 ">{{ Carbon\Carbon::parse($cliente->fecha_final)->format('M j') ?? '' }}
|
|
</td>
|
|
|
|
@php
|
|
|
|
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
|
|
$date2 = new DateTime(strtr(strval($cliente->fecha_final), '/', '-'));
|
|
|
|
@endphp
|
|
|
|
@if ($date1 < $date2)
|
|
<td class="pl-2">
|
|
@php
|
|
$diff = $date1->diff($date2);
|
|
echo $diff->days . ' dias';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 > $date2)
|
|
<td class="pl-2">
|
|
@php
|
|
echo 'Vencido';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 == $date2)
|
|
<td class="pl-2">
|
|
@php
|
|
echo 'Vence hoy!!';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if (!empty($cliente->tarifa_id))
|
|
<td class=" w-[1rem]">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white px-4 py-1 rounded-lg"
|
|
wire:click="enviarNotificacion({{ $cliente->id }})">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
fill="#ffffff" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</td>
|
|
<td class="pl-2 w-[1rem]">
|
|
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg"
|
|
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
|
|
class="w-6 h-6 cursor-pointer">
|
|
<path stroke-linecap="round" stroke-linejoin="round"
|
|
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
|
|
</svg>
|
|
<div x-cloak x-show="openOption"
|
|
class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="verCliente({{ $cliente->id }})"
|
|
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Ver</button>
|
|
|
|
@if (!empty($cliente->cuentas->first()->estado))
|
|
@if ($cliente->cuentas->first()->estado == 'pendiente' && $cliente->tarifa->servicio->renovacion == true)
|
|
{{-- renovar --}}
|
|
|
|
@if (Auth::user()->saldo->valor >= $cliente->tarifa->valor)
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="renovar({{ $cliente->id }})"
|
|
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Renovar</button>
|
|
@else
|
|
<button
|
|
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 active:bg-red-500 active:text-white cursor-not-allowed">Renovar</button>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
|
|
{{-- whatsapp --}}
|
|
<a x-on:click="openOption=!openOption" target="_blank"
|
|
href="https://wa.me/57{{ $cliente->cliente->celular ?? '' }}?text=Hola *{{ $cliente->cliente->name ?? '' }}* tu servicio de *{{ $cliente->tarifa->servicio->nombre }} de {{ $cliente->tarifa->pantallas }} pantallas * vence el *{{ $cliente->fecha_final }}*"
|
|
class="hover:fill-white fill-gray-500 flex justify-center items-center border-b gap-2 text-gray-500 w-full py-1 hover:bg-[#00be00] hover:text-white border-gray-300 ">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 682 682.66669"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m544.386719 93.007812c-59.875-59.945312-139.503907-92.9726558-224.335938-93.007812-174.804687 0-317.070312 142.261719-317.140625 317.113281-.023437 55.894531 14.578125 110.457031 42.332032 158.550781l-44.992188 164.335938 168.121094-44.101562c46.324218 25.269531 98.476562 38.585937 151.550781 38.601562h.132813c174.785156 0 317.066406-142.273438 317.132812-317.132812.035156-84.742188-32.921875-164.417969-92.800781-224.359376zm-224.335938 487.933594h-.109375c-47.296875-.019531-93.683594-12.730468-134.160156-36.742187l-9.621094-5.714844-99.765625 26.171875 26.628907-97.269531-6.269532-9.972657c-26.386718-41.96875-40.320312-90.476562-40.296875-140.28125.054688-145.332031 118.304688-263.570312 263.699219-263.570312 70.40625.023438 136.589844 27.476562 186.355469 77.300781s77.15625 116.050781 77.132812 186.484375c-.0625 145.34375-118.304687 263.59375-263.59375 263.59375zm144.585938-197.417968c-7.921875-3.96875-46.882813-23.132813-54.148438-25.78125-7.257812-2.644532-12.546875-3.960938-17.824219 3.96875-5.285156 7.929687-20.46875 25.78125-25.09375 31.066406-4.625 5.289062-9.242187 5.953125-17.167968 1.984375-7.925782-3.964844-33.457032-12.335938-63.726563-39.332031-23.554687-21.011719-39.457031-46.960938-44.082031-54.890626-4.617188-7.9375-.039062-11.8125 3.476562-16.171874 8.578126-10.652344 17.167969-21.820313 19.808594-27.105469 2.644532-5.289063 1.320313-9.917969-.664062-13.882813-1.976563-3.964844-17.824219-42.96875-24.425782-58.839844-6.4375-15.445312-12.964843-13.359374-17.832031-13.601562-4.617187-.230469-9.902343-.277344-15.1875-.277344-5.28125 0-13.867187 1.980469-21.132812 9.917969-7.261719 7.933594-27.730469 27.101563-27.730469 66.105469s28.394531 76.683594 32.355469 81.972656c3.960937 5.289062 55.878906 85.328125 135.367187 119.648438 18.90625 8.171874 33.664063 13.042968 45.175782 16.695312 18.984374 6.03125 36.253906 5.179688 49.910156 3.140625 15.226562-2.277344 46.878906-19.171875 53.488281-37.679687 6.601563-18.511719 6.601563-34.375 4.617187-37.683594-1.976562-3.304688-7.261718-5.285156-15.183593-9.253906zm0 0"
|
|
fill-rule="evenodd" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</a>
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="notSMS({{ $cliente->id }})"
|
|
class="items-center gap-2 justify-center flex fill-gray-500 text-gray-500 w-full py-1 hover:bg-gray-200 border-b md:border-none border-gray-300 hover:md:rounded-b-[1rem]">SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" id="Filled"
|
|
viewBox="0 0 24 24" class="w-4">
|
|
<path
|
|
d="M20,0H4A4,4,0,0,0,0,4V16a4,4,0,0,0,4,4H6.9l4.451,3.763a1,1,0,0,0,1.292,0L17.1,20H20a4,4,0,0,0,4-4V4A4,4,0,0,0,20,0ZM7,5h5a1,1,0,0,1,0,2H7A1,1,0,0,1,7,5ZM17,15H7a1,1,0,0,1,0-2H17a1,1,0,0,1,0,2Zm0-4H7A1,1,0,0,1,7,9H17a1,1,0,0,1,0,2Z" />
|
|
</svg></button>
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="enviarNotificacion({{ $cliente->id }})"
|
|
class=" md:hidden hover:fill-white fill-gray-500 flex justify-center items-center gap-2 text-gray-500 w-full py-1 hover:bg-[#00be00] hover:text-white border-b border-gray-300 ">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
|
|
</div>
|
|
</td>
|
|
@elseif(!empty($cliente->promocion_id))
|
|
<td class=" w-[1rem]">
|
|
<button
|
|
class=" md:flex m-auto gap-2 items-center bg-[#B221FD] text-white px-4 py-1 rounded-lg"
|
|
wire:click="enviarNotificacionPromo({{ $cliente->id }})">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
fill="#ffffff" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</td>
|
|
<td class="pl-2 w-[1rem]">
|
|
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg"
|
|
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
|
|
class="w-6 h-6 cursor-pointer">
|
|
<path stroke-linecap="round" stroke-linejoin="round"
|
|
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
|
|
</svg>
|
|
<div x-cloak x-show="openOption"
|
|
class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="verCliente({{ $cliente->id }})"
|
|
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Ver</button>
|
|
{{-- whatsapp --}}
|
|
<a x-on:click="openOption=!openOption" target="_blank"
|
|
href="https://wa.me/57{{ $cliente->cliente->celular ?? '' }}?text=Hola *{{ $cliente->cliente->name ?? '' }}* tu servicio de *{{ $cliente->promocion->nombre }}* vence el *{{ $cliente->fecha_final }}*"
|
|
class="hover:fill-white cursor-pointer fill-gray-500 flex justify-center border-b items-center gap-2 text-gray-500 w-full py-1 hover:bg-[#00be00] hover:text-white border-gray-300 ">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 682 682.66669"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m544.386719 93.007812c-59.875-59.945312-139.503907-92.9726558-224.335938-93.007812-174.804687 0-317.070312 142.261719-317.140625 317.113281-.023437 55.894531 14.578125 110.457031 42.332032 158.550781l-44.992188 164.335938 168.121094-44.101562c46.324218 25.269531 98.476562 38.585937 151.550781 38.601562h.132813c174.785156 0 317.066406-142.273438 317.132812-317.132812.035156-84.742188-32.921875-164.417969-92.800781-224.359376zm-224.335938 487.933594h-.109375c-47.296875-.019531-93.683594-12.730468-134.160156-36.742187l-9.621094-5.714844-99.765625 26.171875 26.628907-97.269531-6.269532-9.972657c-26.386718-41.96875-40.320312-90.476562-40.296875-140.28125.054688-145.332031 118.304688-263.570312 263.699219-263.570312 70.40625.023438 136.589844 27.476562 186.355469 77.300781s77.15625 116.050781 77.132812 186.484375c-.0625 145.34375-118.304687 263.59375-263.59375 263.59375zm144.585938-197.417968c-7.921875-3.96875-46.882813-23.132813-54.148438-25.78125-7.257812-2.644532-12.546875-3.960938-17.824219 3.96875-5.285156 7.929687-20.46875 25.78125-25.09375 31.066406-4.625 5.289062-9.242187 5.953125-17.167968 1.984375-7.925782-3.964844-33.457032-12.335938-63.726563-39.332031-23.554687-21.011719-39.457031-46.960938-44.082031-54.890626-4.617188-7.9375-.039062-11.8125 3.476562-16.171874 8.578126-10.652344 17.167969-21.820313 19.808594-27.105469 2.644532-5.289063 1.320313-9.917969-.664062-13.882813-1.976563-3.964844-17.824219-42.96875-24.425782-58.839844-6.4375-15.445312-12.964843-13.359374-17.832031-13.601562-4.617187-.230469-9.902343-.277344-15.1875-.277344-5.28125 0-13.867187 1.980469-21.132812 9.917969-7.261719 7.933594-27.730469 27.101563-27.730469 66.105469s28.394531 76.683594 32.355469 81.972656c3.960937 5.289062 55.878906 85.328125 135.367187 119.648438 18.90625 8.171874 33.664063 13.042968 45.175782 16.695312 18.984374 6.03125 36.253906 5.179688 49.910156 3.140625 15.226562-2.277344 46.878906-19.171875 53.488281-37.679687 6.601563-18.511719 6.601563-34.375 4.617187-37.683594-1.976562-3.304688-7.261718-5.285156-15.183593-9.253906zm0 0"
|
|
fill-rule="evenodd" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</a>
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="notSMSpromo({{ $cliente->id }})"
|
|
class="items-center gap-2 justify-center flex fill-gray-500 text-gray-500 w-full py-1 hover:bg-gray-200 border-b md:border-none border-gray-300 hover:md:rounded-b-[1rem]">SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" id="Filled"
|
|
viewBox="0 0 24 24" class="w-4">
|
|
<path
|
|
d="M20,0H4A4,4,0,0,0,0,4V16a4,4,0,0,0,4,4H6.9l4.451,3.763a1,1,0,0,0,1.292,0L17.1,20H20a4,4,0,0,0,4-4V4A4,4,0,0,0,20,0ZM7,5h5a1,1,0,0,1,0,2H7A1,1,0,0,1,7,5ZM17,15H7a1,1,0,0,1,0-2H17a1,1,0,0,1,0,2Zm0-4H7A1,1,0,0,1,7,9H17a1,1,0,0,1,0,2Z" />
|
|
</svg></button>
|
|
<button x-on:click="openOption=!openOption"
|
|
wire:click="enviarNotificacionPromo({{ $cliente->id }})"
|
|
class=" md:hidden hover:fill-white fill-gray-500 flex justify-center items-center gap-2 text-gray-500 w-full py-1 hover:bg-[#B221FD] hover:text-white border-b border-gray-300 ">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0"
|
|
y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
<!--button x-on:click="openOption=!openOption" class="text-gray-500 w-full py-1 hover:bg-gray-200 hover:rounded-b-[1rem]">Renovar</button-->
|
|
</div>
|
|
</td>
|
|
@endif
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
{{ $clientes->links() }}
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
{{-- Modal ver clientes --}}
|
|
<div x-cloak x-show="verCliente" x-transition:enter="transition duration-350"
|
|
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-100"
|
|
class="fixed backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full z-20">
|
|
<div class="grid h-full place-items-center ">
|
|
|
|
@if (!empty($consulta_historial))
|
|
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
|
|
<div class="mb-4 max-w-lg">
|
|
<label for="ver_paquete" class="block text-gray-700 text-sm font-bold mb-2">Paquete:</label>
|
|
<div class="grid grid-cols-1 items-center">
|
|
|
|
@if (!empty($consulta_historial->tarifa_id))
|
|
<div>
|
|
<p class="text-sm">
|
|
{{ $consulta_historial->tarifa->servicio->nombre . ' - ' . $consulta_historial->tarifa->pantallas . ' Pantalla' ?? '' }}
|
|
</p>
|
|
</div>
|
|
<div class="justify-self-end">
|
|
<p class="text-sm">${{ number_format($consulta_historial->tarifa->valor) }}</p>
|
|
<p class="text-sm">{{ $consulta_historial->tarifa->dias }} Días</p>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Credenciales:</label>
|
|
<p class="text-sm">
|
|
@foreach ($consulta_historial->cuentas->unique() as $cuenta)
|
|
<div class="py-2">
|
|
<div class="text-sm font-semibold"> {{ $cuenta->servicio->nombre }}
|
|
</div>
|
|
@if (!empty($cuenta->servicio->ver_url))
|
|
- URL: <span
|
|
class="font-semibold text-gray-600">{{ $cuenta->servicio->url }}</span>
|
|
@else
|
|
@foreach ($cuenta->perfil as $perfil)
|
|
@if ($consulta_historial->id == $perfil->historial_id)
|
|
- Perfil <span
|
|
class="font-semibold text-gray-600">{{ $perfil->perfil }}</span>
|
|
|
|
@if (!empty($cuenta->servicio->perfiles))
|
|
@switch($perfil->perfil)
|
|
@case(1)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_1 }}</span>
|
|
@break
|
|
|
|
@case(2)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_2 }}</span>
|
|
@break
|
|
|
|
@case(3)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_3 }}</span>
|
|
@break
|
|
|
|
@case(4)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_4 }}</span>
|
|
@break
|
|
|
|
@case(5)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_5 }}</span>
|
|
@break
|
|
|
|
@case(6)
|
|
: <span
|
|
class="font-semibold text-gray-600">{{ $msj->clave_6 }}</span>
|
|
@break
|
|
|
|
@default
|
|
@endswitch
|
|
@endif
|
|
@endif
|
|
@endforeach
|
|
@endif
|
|
<div class="text-sm"><span class="font-semibold">Email:
|
|
</span>{{ $cuenta->correo }}</div>
|
|
<div class="text-sm"><span class="font-semibold">Pass:</span>
|
|
{{ $cuenta->password }}</div>
|
|
</div>
|
|
@endforeach
|
|
</p>
|
|
</div>
|
|
@endif
|
|
@if (!empty($consulta_historial->promocion_id))
|
|
<div>
|
|
<p class="text-sm">{{ $consulta_historial->promocion->nombre ?? '' }} </p>
|
|
</div>
|
|
<div class="justify-self-end">
|
|
<p class="text-sm">${{ number_format($consulta_historial->promocion->precio) }}
|
|
</p>
|
|
<p class="text-sm">{{ $consulta_historial->promocion->dias }} Días</p>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Credenciales:</label>
|
|
<p class="text-sm">
|
|
@foreach ($consulta_historial->cuentas->unique() as $cuenta)
|
|
<div class="py-2">
|
|
<div class="text-sm font-semibold"> {{ $cuenta->servicio->nombre }}
|
|
</div>
|
|
@foreach ($cuenta->perfil as $perfil)
|
|
@if ($consulta_historial->id == $perfil->historial_id)
|
|
- Perfil <span
|
|
class="font-semibold text-gray-600">{{ $perfil->perfil }}</span>
|
|
@endif
|
|
@endforeach
|
|
<div class="text-sm"><span class="font-semibold">Email:
|
|
</span>{{ $cuenta->correo }}</div>
|
|
<div class="text-sm"><span class="font-semibold">Pass:</span>
|
|
{{ $cuenta->password }}</div>
|
|
</div>
|
|
@endforeach
|
|
</p>
|
|
</div>
|
|
@endif
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{{-- <div class="mb-4">
|
|
<label for="ver_paquete" class="block text-gray-700 text-sm font-bold mb-2">Credenciales:</label>
|
|
<input type="text" readonly id="ver_paquete" wire:model="ver_paquete"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div> --}}
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
|
|
<p class="text-sm">
|
|
{{ $consulta_historial->cliente->name ?? '' }}
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email" class="block text-gray-700 text-sm font-bold mb-2">E-mail:</label>
|
|
<p class="text-sm">
|
|
{{ $consulta_historial->cliente->email ?? '' }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email" class="block text-gray-700 text-sm font-bold mb-2">Inicio:</label>
|
|
<p class="text-sm">
|
|
{{ Carbon\Carbon::parse($consulta_historial->fecha_inicio)->format('Y/m/d') ?? '' }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="ver_email" class="block text-gray-700 text-sm font-bold mb-2">Vence:</label>
|
|
<p class="text-sm">
|
|
{{ Carbon\Carbon::parse($consulta_historial->fecha_final)->diffInDays() ?? '' }} días
|
|
</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
|
|
<span>
|
|
<button x-on:click="verCliente=false" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{{-- Modal ver vencidos --}}
|
|
<div x-cloak x-show="vencidosHoy" x-transition:enter="transition duration-350"
|
|
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-100"
|
|
class="fixed backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full z-20 overflow-y-auto">
|
|
|
|
<div class="grid h-full place-items-center ">
|
|
|
|
@if (!empty($vencidHoy))
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="text-black text-center">Los siguientes servicios vencen hoy: </div>
|
|
<table class="w-full sm-w-[20rem] text-center mt-4 border-separate border-spacing-y-2">
|
|
<thead class="font-normal bg-[#000029] text-white h-9">
|
|
<tr class="text-left">
|
|
<th class="rounded-l-lg font-normal w-1/3 pl-[1rem] sm:w-1/4 sm:pl-[1rem]">Nombre</th>
|
|
<th class="font-normal w-1/3 sm:w-1/4 pl-[1rem] sm:pl-[1rem] ">Fecha de Compra</th>
|
|
<th class="font-normal w-1/3 sm:w-1/4 pl-[1rem] sm:pl-[1rem]">Servicio</th>
|
|
<th class="font-normal pl-[1rem] sm:pl-[2rem] sm:w-1/4 hidden md:inline-table"></th>
|
|
<th class="rounded-r-lg font-normal"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($vencidHoy as $h)
|
|
<tr>
|
|
<td class="pl-[1rem] sm:pl-[1rem]">{{ $h->cliente->name ?? '' }}</td>
|
|
<td class="pl-[1rem] sm:pl-[1rem]">
|
|
{{ Carbon\Carbon::parse($h->created_at)->locale('co')->Format('d M Y, h:m a') ?? '' }}
|
|
</td>
|
|
|
|
@if (!empty($h->tarifa_id))
|
|
<td class="pl-[1rem] sm:pl-[1rem]">{{ $h->tarifa->servicio->nombre }}
|
|
|
|
@if ($h->tarifa->servicio->nombre != 'Spotify Premium' && $h->tarifa->servicio->nombre != 'Youtube Premium')
|
|
{{ $h->tarifa->pantallas }} Pantallas
|
|
@endif
|
|
|
|
</td>
|
|
@endif
|
|
|
|
@if (!empty($h->promocion_id))
|
|
<td class="pl-[1rem] sm:pl-[1rem]">{{ $h->promocion->nombre }}
|
|
</td>
|
|
@endif
|
|
|
|
@if (!empty($h->tarifa_id))
|
|
<td class="hidden md:inline-table w-[1rem]">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white px-4 py-1 rounded-lg"
|
|
wire:click="enviarNotificacion({{ $h->id }})">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4"
|
|
x="0" y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
fill="#ffffff" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</td>
|
|
@elseif(!empty($h->promocion_id))
|
|
<td class="hidden md:inline-table w-[1rem]">
|
|
<button
|
|
class="hidden md:flex m-auto gap-2 items-center bg-[#B221FD] text-white px-4 py-1 rounded-lg"
|
|
wire:click="enviarNotificacionPromo({{ $h->id }})">Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" class="w-4"
|
|
x="0" y="0" viewBox="0 0 511.996 511.996"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve"
|
|
class="">
|
|
<path
|
|
d="m511.996 127.512v-8.079c0-30.419-24.748-55.166-55.166-55.166h-401.664c-30.419 0-55.166 24.747-55.166 55.166v8.079.059 264.995c0 30.417 24.747 55.163 55.166 55.163h401.667c30.417 0 55.163-24.746 55.163-55.163v-264.995c0-.019 0-.039 0-.059zm-456.83-33.245h401.664c13.876 0 25.166 11.289 25.166 25.166v.007l-200.896 133.93c-13.372 8.915-36.83 8.914-50.2.001l-200.9-133.932v-.007c0-13.876 11.289-25.165 25.166-25.165zm401.667 323.462h-401.667c-13.877 0-25.166-11.288-25.166-25.163v-237.072l184.259 122.838c11.704 7.803 26.719 11.703 41.74 11.703 15.017 0 30.039-3.901 41.742-11.703l184.256-122.838v237.072c-.001 13.875-11.289 25.163-25.164 25.163z"
|
|
fill="#ffffff" data-original="#000000" class="">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</td>
|
|
@endif
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
|
|
</table>
|
|
<span class="text-center mx-auto ">
|
|
<button wire:click="cerrar" type="button"
|
|
class="mx-auto inline-flex justify-center w-full w-24 mx-auto rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
@endif
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|