844 lines
73 KiB
PHP
Executable File
844 lines
73 KiB
PHP
Executable File
<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,enviarNotificacion,renovar">
|
|
<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 w-auto 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">
|
|
<x-icon-arrow-right />
|
|
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-sm border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-md 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 Hoy</label>
|
|
<input type="checkbox" name="" id="cbox2" wire:model="venceHoy">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<x-ver-entrada />
|
|
|
|
{{-- tabla clientes --}}
|
|
<x-primary-table>
|
|
<x-slot name="thead">
|
|
<tr class="table-row md:hidden text-left">
|
|
<th class="rounded-l-lg font-normal">Nombre</th>
|
|
<th class="font-normal">Usuario</th>
|
|
<th class="font-normal">Contraseña</th>
|
|
<th class="rounded-r-lg font-normal">Estado</th>
|
|
</tr>
|
|
<tr class="hidden md:table-row text-left">
|
|
<th class="rounded-l-lg font-normal">Nombre</th>
|
|
<th class="font-normal">Usuario</th>
|
|
<th class="font-normal">Contraseña</th>
|
|
<th class="font-normal">Servicio</th>
|
|
<th class="font-normal">Compra</th>
|
|
<th class="font-normal">Estado</th>
|
|
<th class="font-normal">Restante</th>
|
|
<th class="rounded-r-lg font-normal">Acciones</th>
|
|
</tr>
|
|
</x-slot>
|
|
<x-slot name="tbody">
|
|
@foreach ($clientes as $cliente)
|
|
<tr class="table-row md:hidden border-gray-200 text-left" x-data="{ extraInfo: false, openOption: false, isOpen1: false, isOpen2: false }">
|
|
<td @click="extraInfo = true">{{ $cliente->nombre_cliente ?? $cliente->cliente->name }}</td>
|
|
<td @click="extraInfo = true" class="relative">
|
|
@if (!empty($cliente->cuentas_obsoletas->unique()))
|
|
@foreach ($cliente->cuentas_obsoletas->unique() as $cuenta)
|
|
{{ $cuenta->correo }} <br>
|
|
@endforeach
|
|
@endif
|
|
@if (!empty($cliente->cuentas->unique()))
|
|
@foreach ($cliente->cuentas->unique() as $cuenta1)
|
|
{{ $cuenta1->correo }} <br>
|
|
@endforeach
|
|
@endif
|
|
<div class="flex justify-end">
|
|
<div
|
|
class="flex justify-center w-8 gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md cursor-pointer">
|
|
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
|
|
<path
|
|
d="M440-440H240q-17 0-28.5-11.5T200-480q0-17 11.5-28.5T240-520h200v-200q0-17 11.5-28.5T480-760q17 0 28.5 11.5T520-720v200h200q17 0 28.5 11.5T760-480q0 17-11.5 28.5T720-440H520v200q0 17-11.5 28.5T480-200q-17 0-28.5-11.5T440-240v-200Z" />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div x-cloak x-show="extraInfo" class="mt-2 mx-2 p-2 bg-gray-200 rounded-md shadow-md"
|
|
@click.outside="extraInfo = false">
|
|
<div class="mb-2">
|
|
<p class="text-center font-semibold mb-1">Contraseña</p>
|
|
<p>{{ $this->consultaPassword($cliente->id) }}</p>
|
|
</div>
|
|
<div class="mb-2">
|
|
<p class="text-center font-semibold mb-1">Servicio</p>
|
|
@if (!empty($cliente->tarifa->servicio))
|
|
<p>{{ $cliente->tarifa->servicio->nombre }}
|
|
|
|
@if ($cliente->tarifa->servicio->nombre != 'Spotify Premium' && $cliente->tarifa->servicio->nombre != 'Youtube Premium')
|
|
{{ $cliente->tarifa->pantallas }} Pantallas
|
|
@endif
|
|
|
|
</p>
|
|
@endif
|
|
|
|
@if (!empty($cliente->promocion_id))
|
|
<p>{{ $cliente->promocion->nombre }}</p>
|
|
@endif
|
|
</div>
|
|
<div class="mb-2">
|
|
<p class="text-center font-semibold mb-1">Estado</p>
|
|
<p
|
|
class="rounded-md font-medium text-center @if ($cliente->estado == 'activo') bg-green-500 text-white @endif @if ($cliente->estado == 'pendiente') bg-yellow-500 @endif">
|
|
{{ $cliente->estado ?? '' }}
|
|
</p>
|
|
</div>
|
|
<div class="mb-2">
|
|
<p class="text-center font-semibold mb-1">Restante</p>
|
|
<p
|
|
class="rounded-md font-medium text-center @if ($cliente->estado == 'activo') bg-green-500 text-white @endif @if ($cliente->estado == 'pendiente') bg-yellow-500 @endif">
|
|
@php
|
|
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
|
|
$date2 = new DateTime(strtr(strval($cliente->fecha_final), '/', '-'));
|
|
@endphp
|
|
|
|
@if ($date1 < $date2)
|
|
<p>
|
|
@php
|
|
$diff = $date1->diff($date2);
|
|
echo $diff->days . ' dias';
|
|
@endphp
|
|
</p>
|
|
@endif
|
|
|
|
@if ($date1 > $date2)
|
|
<p>
|
|
@php
|
|
echo 'Vencido';
|
|
@endphp
|
|
</p>
|
|
@endif
|
|
|
|
@if ($date1 == $date2)
|
|
<p>
|
|
@php
|
|
echo 'Vence hoy!!';
|
|
@endphp
|
|
</p>
|
|
@endif
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="mb-2">
|
|
<p class="text-center font-semibold mb-1">Acciones</p>
|
|
@if (!empty($cliente->tarifa_id))
|
|
<p class="w-4">
|
|
<div class="flex justify-center items-center gap-2">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen1=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M405-80q-15 0-26-10t-13-25l-12-93q-13-5-24.5-12T307-235l-87 36q-14 6-28 1.5T170-215L96-344q-8-13-5-28t15-24l75-57q-1-7-1-13.5v-27q0-6.5 1-13.5l-75-57q-12-9-15-24t5-28l74-129q8-13 22-17.5t28 1.5l87 36q11-8 23-15t24-12l12-93q2-15 13-25t26-10h150q15 0 26 10t13 25l12 93q13 5 24.5 12t22.5 15l87-36q14-6 28-1.5t22 17.5l74 129q8 13 5 28t-15 24l-75 57q1 7 1 13.5v27q0 6.5-2 13.5l75 57q12 9 15 24t-5 28l-74 128q-8 13-22.5 18t-28.5-1l-85-36q-11 8-23 15t-24 12l-12 93q-2 15-13 25t-26 10H405Zm35-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen1" @click.outside="isOpen1 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="verCliente({{ $cliente->id }})">
|
|
Ver
|
|
</p>
|
|
@if (!empty($cliente->cuentas->first()->estado) && !empty($cliente->tarifa->servicio))
|
|
@if ($cliente->cuentas->first()->estado == 'pendiente' && $cliente->tarifa->servicio->renovacion == true)
|
|
{{-- renovar --}}
|
|
@if (Auth::user()->saldo->valor >= $cliente->tarifa->valor)
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="renovar({{ $cliente->id }})">Renovar</p>
|
|
@else
|
|
<p
|
|
class="active:bg-red-500 active:text-white cursor-not-allowed">
|
|
Renovar</p>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen2=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M200-200q-17 0-28.5-11.5T160-240q0-17 11.5-28.5T200-280h40v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h40q17 0 28.5 11.5T800-240q0 17-11.5 28.5T760-200H200Zm280-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen2" @click.outside="isOpen2 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="enviarNotificacion({{ $cliente->id }})">
|
|
Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-4"
|
|
viewBox="0 -960 960 960">
|
|
<path
|
|
d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm640-480L501-453q-5 3-10.5 4.5T480-447q-5 0-10.5-1.5T459-453L160-640v400h640v-400ZM480-520l320-200H160l320 200ZM160-640v10-59 1-32 32-.5 58.5-10 400-400Z" />
|
|
</svg>
|
|
</p>
|
|
@if(!empty($cliente->tarifa->servicio))
|
|
<p class="hover:bg-[#00be00] hover:text-white">
|
|
<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="flex justify-center items-center gap-2 w-full hover:fill-white fill-gray-500">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">
|
|
<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>
|
|
</p>
|
|
@endif
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="notSMS({{ $cliente->id }})">
|
|
SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-4">
|
|
<path
|
|
d="M320-520q17 0 28.5-11.5T360-560q0-17-11.5-28.5T320-600q-17 0-28.5 11.5T280-560q0 17 11.5 28.5T320-520Zm160 0q17 0 28.5-11.5T520-560q0-17-11.5-28.5T480-600q-17 0-28.5 11.5T440-560q0 17 11.5 28.5T480-520Zm160 0q17 0 28.5-11.5T680-560q0-17-11.5-28.5T640-600q-17 0-28.5 11.5T600-560q0 17 11.5 28.5T640-520ZM240-240l-92 92q-19 19-43.5 8.5T80-177v-623q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240Zm-34-80h594v-480H160v525l46-45Zm-46 0v-480 480Z" />
|
|
</svg>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
@elseif(!empty($cliente->promocion_id))
|
|
<p class="w-4">
|
|
<div class="flex justify-center items-center gap-2">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen1=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M405-80q-15 0-26-10t-13-25l-12-93q-13-5-24.5-12T307-235l-87 36q-14 6-28 1.5T170-215L96-344q-8-13-5-28t15-24l75-57q-1-7-1-13.5v-27q0-6.5 1-13.5l-75-57q-12-9-15-24t5-28l74-129q8-13 22-17.5t28 1.5l87 36q11-8 23-15t24-12l12-93q2-15 13-25t26-10h150q15 0 26 10t13 25l12 93q13 5 24.5 12t22.5 15l87-36q14-6 28-1.5t22 17.5l74 129q8 13 5 28t-15 24l-75 57q1 7 1 13.5v27q0 6.5-2 13.5l75 57q12 9 15 24t-5 28l-74 128q-8 13-22.5 18t-28.5-1l-85-36q-11 8-23 15t-24 12l-12 93q-2 15-13 25t-26 10H405Zm35-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen1" @click.outside="isOpen1 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="verCliente({{ $cliente->id }})">Ver
|
|
</p>
|
|
@if (!empty($cliente->cuentas->first()->estado) && !empty($cliente->tarifa->servicio))
|
|
@if ($cliente->cuentas->first()->estado == 'pendiente' && $cliente->tarifa->servicio->renovacion == true)
|
|
{{-- renovar --}}
|
|
@if (Auth::user()->saldo->valor >= $cliente->tarifa->valor)
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="renovar({{ $cliente->id }})">Renovar</p>
|
|
@else
|
|
<p
|
|
class="active:bg-red-500 active:text-white cursor-not-allowed">
|
|
Renovar</p>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen2=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M200-200q-17 0-28.5-11.5T160-240q0-17 11.5-28.5T200-280h40v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h40q17 0 28.5 11.5T800-240q0 17-11.5 28.5T760-200H200Zm280-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen2" @click.outside="isOpen2 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="enviarNotificacionPromo({{ $cliente->id }})">
|
|
Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-4"
|
|
viewBox="0 -960 960 960">
|
|
<path
|
|
d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm640-480L501-453q-5 3-10.5 4.5T480-447q-5 0-10.5-1.5T459-453L160-640v400h640v-400ZM480-520l320-200H160l320 200ZM160-640v10-59 1-32 32-.5 58.5-10 400-400Z" />
|
|
</svg>
|
|
</p>
|
|
<p class="hover:bg-[#00be00] hover:text-white">
|
|
<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="flex justify-center items-center gap-2 w-full hover:fill-white fill-gray-500">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">
|
|
<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>
|
|
</p>
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="notSMSpromo({{ $cliente->id }})">
|
|
SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-4">
|
|
<path
|
|
d="M320-520q17 0 28.5-11.5T360-560q0-17-11.5-28.5T320-600q-17 0-28.5 11.5T280-560q0 17 11.5 28.5T320-520Zm160 0q17 0 28.5-11.5T520-560q0-17-11.5-28.5T480-600q-17 0-28.5 11.5T440-560q0 17 11.5 28.5T480-520Zm160 0q17 0 28.5-11.5T680-560q0-17-11.5-28.5T640-600q-17 0-28.5 11.5T600-560q0 17 11.5 28.5T640-520ZM240-240l-92 92q-19 19-43.5 8.5T80-177v-623q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240Zm-34-80h594v-480H160v525l46-45Zm-46 0v-480 480Z" />
|
|
</svg>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td @click="extraInfo = true">{{ $this->consultaPassword($cliente->id) }}</td>
|
|
<td @click="extraInfo = true">
|
|
<p
|
|
class="rounded-md font-medium text-center @if ($cliente->estado == 'activo') bg-green-500 text-white @endif @if ($cliente->estado == 'pendiente') bg-yellow-500 @endif">
|
|
{{ $cliente->estado ?? '' }}
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="hidden md:table-row border-gray-200 text-left w-full" x-data="{ openOption: false, isOpen1: false, isOpen2: false }">
|
|
<td>{{ $cliente->nombre_cliente ?? $cliente->cliente->name }}</td>
|
|
|
|
<td>
|
|
@if (!empty($cliente->cuentas_obsoletas->unique()))
|
|
@foreach ($cliente->cuentas_obsoletas->unique() as $cuenta)
|
|
{{ $cuenta->correo }} <br>
|
|
@endforeach
|
|
@endif
|
|
@if (!empty($cliente->cuentas->unique()))
|
|
@foreach ($cliente->cuentas->unique() as $cuenta1)
|
|
{{ $cuenta1->correo }} <br>
|
|
@endforeach
|
|
@endif
|
|
</td>
|
|
|
|
<td>{{ $this->consultaPassword($cliente->id) }}</td>
|
|
|
|
@if (!empty($cliente->tarifa->servicio))
|
|
<td>{{ $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>{{ $cliente->promocion->nombre }}</td>
|
|
@endif
|
|
|
|
<td>
|
|
{{ Carbon\Carbon::parse($cliente->created_at)->locale('co')->Format('d M Y, h:m a') ?? '' }}
|
|
</td>
|
|
<td>
|
|
<p
|
|
class="rounded-md font-medium text-center @if ($cliente->estado == 'activo') bg-green-500 text-white @endif @if ($cliente->estado == 'pendiente') bg-yellow-500 @endif">
|
|
{{ $cliente->estado ?? '' }}
|
|
</p>
|
|
</td>
|
|
@php
|
|
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
|
|
$date2 = new DateTime(strtr(strval($cliente->fecha_final), '/', '-'));
|
|
@endphp
|
|
|
|
@if ($date1 < $date2)
|
|
<td>
|
|
@php
|
|
$diff = $date1->diff($date2);
|
|
echo $diff->days . ' dias';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 > $date2)
|
|
<td>
|
|
@php
|
|
echo 'Vencido';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 == $date2)
|
|
<td>
|
|
@php
|
|
echo 'Vence hoy!!';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if (!empty($cliente->tarifa_id))
|
|
<td class="w-4">
|
|
<div class="flex justify-center items-center gap-2">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen1=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M405-80q-15 0-26-10t-13-25l-12-93q-13-5-24.5-12T307-235l-87 36q-14 6-28 1.5T170-215L96-344q-8-13-5-28t15-24l75-57q-1-7-1-13.5v-27q0-6.5 1-13.5l-75-57q-12-9-15-24t5-28l74-129q8-13 22-17.5t28 1.5l87 36q11-8 23-15t24-12l12-93q2-15 13-25t26-10h150q15 0 26 10t13 25l12 93q13 5 24.5 12t22.5 15l87-36q14-6 28-1.5t22 17.5l74 129q8 13 5 28t-15 24l-75 57q1 7 1 13.5v27q0 6.5-2 13.5l75 57q12 9 15 24t-5 28l-74 128q-8 13-22.5 18t-28.5-1l-85-36q-11 8-23 15t-24 12l-12 93q-2 15-13 25t-26 10H405Zm35-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen1" @click.outside="isOpen1 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200" wire:click="verCliente({{ $cliente->id }})">Ver
|
|
</p>
|
|
@if (!empty($cliente->cuentas->first()->estado) && !empty($cliente->tarifa->servicio))
|
|
@if ($cliente->cuentas->first()->estado == 'pendiente' && $cliente->tarifa->servicio->renovacion == true)
|
|
{{-- renovar --}}
|
|
@if (Auth::user()->saldo->valor >= $cliente->tarifa->valor)
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="renovar({{ $cliente->id }})">Renovar</p>
|
|
@else
|
|
<p class="active:bg-red-500 active:text-white cursor-not-allowed">
|
|
Renovar</p>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen2=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M200-200q-17 0-28.5-11.5T160-240q0-17 11.5-28.5T200-280h40v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h40q17 0 28.5 11.5T800-240q0 17-11.5 28.5T760-200H200Zm280-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen2" @click.outside="isOpen2 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="enviarNotificacion({{ $cliente->id }})">
|
|
Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-4"
|
|
viewBox="0 -960 960 960">
|
|
<path
|
|
d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm640-480L501-453q-5 3-10.5 4.5T480-447q-5 0-10.5-1.5T459-453L160-640v400h640v-400ZM480-520l320-200H160l320 200ZM160-640v10-59 1-32 32-.5 58.5-10 400-400Z" />
|
|
</svg>
|
|
</p>
|
|
@if(!empty($cliente->tarifa->servicio))
|
|
<p class="hover:bg-[#00be00] hover:text-white">
|
|
<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="flex justify-center items-center gap-2 w-full hover:fill-white fill-gray-500">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">
|
|
<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>
|
|
</p>
|
|
@endif
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="notSMS({{ $cliente->id }})">
|
|
SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-4">
|
|
<path
|
|
d="M320-520q17 0 28.5-11.5T360-560q0-17-11.5-28.5T320-600q-17 0-28.5 11.5T280-560q0 17 11.5 28.5T320-520Zm160 0q17 0 28.5-11.5T520-560q0-17-11.5-28.5T480-600q-17 0-28.5 11.5T440-560q0 17 11.5 28.5T480-520Zm160 0q17 0 28.5-11.5T680-560q0-17-11.5-28.5T640-600q-17 0-28.5 11.5T600-560q0 17 11.5 28.5T640-520ZM240-240l-92 92q-19 19-43.5 8.5T80-177v-623q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240Zm-34-80h594v-480H160v525l46-45Zm-46 0v-480 480Z" />
|
|
</svg>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
@elseif(!empty($cliente->promocion_id))
|
|
<td class="w-4">
|
|
<div class="flex justify-center items-center gap-2">
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen1=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M405-80q-15 0-26-10t-13-25l-12-93q-13-5-24.5-12T307-235l-87 36q-14 6-28 1.5T170-215L96-344q-8-13-5-28t15-24l75-57q-1-7-1-13.5v-27q0-6.5 1-13.5l-75-57q-12-9-15-24t5-28l74-129q8-13 22-17.5t28 1.5l87 36q11-8 23-15t24-12l12-93q2-15 13-25t26-10h150q15 0 26 10t13 25l12 93q13 5 24.5 12t22.5 15l87-36q14-6 28-1.5t22 17.5l74 129q8 13 5 28t-15 24l-75 57q1 7 1 13.5v27q0 6.5-2 13.5l75 57q12 9 15 24t-5 28l-74 128q-8 13-22.5 18t-28.5-1l-85-36q-11 8-23 15t-24 12l-12 93q-2 15-13 25t-26 10H405Zm35-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen1" @click.outside="isOpen1 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200" wire:click="verCliente({{ $cliente->id }})">Ver
|
|
</p>
|
|
|
|
@if (!empty($cliente->cuentas->first()->estado) && !empty($cliente->tarifa->servicio))
|
|
@if ($cliente->cuentas->first()->estado == 'pendiente' && $cliente->tarifa->servicio->renovacion == true)
|
|
{{-- renovar --}}
|
|
@if (Auth::user()->saldo->valor >= $cliente->tarifa->valor)
|
|
<p class="hover:bg-gray-200"
|
|
wire:click="renovar({{ $cliente->id }})">Renovar</p>
|
|
@else
|
|
<p class="active:bg-red-500 active:text-white cursor-not-allowed">
|
|
Renovar</p>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<button
|
|
class="flex m-auto gap-2 items-center bg-[#B221FD] text-white fill-white px-2 py-1 rounded-md"
|
|
x-on:click="isOpen2=true">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-5">
|
|
<path
|
|
d="M200-200q-17 0-28.5-11.5T160-240q0-17 11.5-28.5T200-280h40v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h40q17 0 28.5 11.5T800-240q0 17-11.5 28.5T760-200H200Zm280-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<div x-cloak x-show="isOpen2" @click.outside="isOpen2 = false"
|
|
class="sm:absolute bg-white text-center w-32 rounded-md shadow-md [&>p]:py-1 [&>p]:cursor-pointer overflow-hidden text-gray-800">
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="enviarNotificacionPromo({{ $cliente->id }})">
|
|
Notificar
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-4"
|
|
viewBox="0 -960 960 960">
|
|
<path
|
|
d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm640-480L501-453q-5 3-10.5 4.5T480-447q-5 0-10.5-1.5T459-453L160-640v400h640v-400ZM480-520l320-200H160l320 200ZM160-640v10-59 1-32 32-.5 58.5-10 400-400Z" />
|
|
</svg>
|
|
</p>
|
|
<p class="hover:bg-[#00be00] hover:text-white">
|
|
<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="flex justify-center items-center gap-2 w-full hover:fill-white fill-gray-500">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">
|
|
<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>
|
|
</p>
|
|
<p class="hover:bg-gray-200 fill-gray-500 flex justify-center items-center gap-2"
|
|
wire:click="notSMSpromo({{ $cliente->id }})">
|
|
SMS
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"
|
|
class="w-4">
|
|
<path
|
|
d="M320-520q17 0 28.5-11.5T360-560q0-17-11.5-28.5T320-600q-17 0-28.5 11.5T280-560q0 17 11.5 28.5T320-520Zm160 0q17 0 28.5-11.5T520-560q0-17-11.5-28.5T480-600q-17 0-28.5 11.5T440-560q0 17 11.5 28.5T480-520Zm160 0q17 0 28.5-11.5T680-560q0-17-11.5-28.5T640-600q-17 0-28.5 11.5T600-560q0 17 11.5 28.5T640-520ZM240-240l-92 92q-19 19-43.5 8.5T80-177v-623q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240Zm-34-80h594v-480H160v525l46-45Zm-46 0v-480 480Z" />
|
|
</svg>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
@endif
|
|
</tr>
|
|
@endforeach
|
|
</x-slot>
|
|
<x-slot name="tlink">
|
|
{{ $clientes->links() }}
|
|
</x-slot>
|
|
</x-primary-table>
|
|
</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_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 mañana: </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>
|