This commit is contained in:
Felipe
2023-10-07 12:58:41 -05:00
parent 87124fdf46
commit 3d3a9cca5e
6 changed files with 242 additions and 271 deletions
+14 -4
View File
@@ -45,7 +45,7 @@ class ShowClientes extends Component
public $configuracion;
public $msj;
public $entradas = 10;
public function render()
{
@@ -53,7 +53,8 @@ class ShowClientes extends Component
$this->fechaActual = date('d/m/Y');
$fechaVencimiento = Carbon::now()->subDay(30);
$consulta_clientes = Historiale::where('vendedor_id', Auth()->user()->id)->whereDate('fecha_final', '>', $fechaVencimiento);
// $consulta_clientes = Historiale::where('vendedor_id', Auth()->user()->id)->whereDate('fecha_final', '>', $fechaVencimiento);
$consulta_clientes = Historiale::whereDate('fecha_final', '>', $fechaVencimiento);
$this->configuracion = User::where('id', Auth::user()->id)->whereDate('updated_at', '!=', $fechaHoy)->first();
@@ -82,7 +83,7 @@ class ShowClientes extends Component
$consulta_clientes = $consulta_clientes->with('tarifa', 'promocion', 'cliente')
->orderBy('id', 'DESC')
->paginate(15);
->paginate($this->entradas);
@@ -96,12 +97,21 @@ class ShowClientes extends Component
public function verCliente($id)
{
$this->consulta_historial = Historiale::with('promocion', 'tarifa', 'cliente', 'cuentas')->where('id', $id)->first();
// dd($this->consulta_historial );
$this->verCliente = true;
}
public function consultaPassword($id)
{
$historiale = Historiale::with('promocion', 'tarifa', 'cliente', 'cuentas')->where('id', $id)->first();
if ($historiale && $historiale->cuentas->isNotEmpty()) {
// Assuming 'password' is a property on the Cuentas model
return $historiale->cuentas->first()->password ?? '';
} else {
return '';
}
}
public function enviarNotificacion($id)
{
@@ -1,5 +1,5 @@
<div class="overflow-y-auto max-h-full">
<table wire:loading.class="opacity-50 cursor-wait" class="w-full sm-w-[20rem] text-center mt-4 border-separate border-spacing-y-2">
<div class="overflow-y-auto max-h-full overflow-x-auto w-full mx-auto text-sm">
<table wire:loading.class="opacity-50 cursor-wait" class="w-full text-center mt-4 border-separate border-spacing-y-2">
<thead class="font-normal bg-[#000029] text-white h-9">
{{ $thead }}
</thead>
@@ -0,0 +1,10 @@
<div class="flex justify-start items-center gap-x-2">
<p class="text-sm">Ver</p>
<select wire:model="entradas" name="entradas" id="entradas" class="border-gray-200 rounded-md appearance-none text-sm">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<p class="text-sm">entradas</p>
</div>
+210 -219
View File
@@ -50,175 +50,148 @@
</div>
<x-ver-entrada />
{{-- 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 }">
<x-primary-table>
<x-slot name="thead">
<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">Usuario</th>
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Contraseña</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">Compra</th>
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Estado</th>
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Restante</th>
<th class="font-normal w-1/8 sm:w-1/8 pl-2">Acciones</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>
</x-slot>
<x-slot name="tbody">
@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->nombre_cliente ?? $cliente->cliente->name }}</td>
<td class="pl-2">{{ $cliente->cliente->email ?? '' }}</td>
<td class="pl-2">{{ $cliente->cliente->email ?? '' }}</td>
<td class="pl-2">{{ $this->consultaPassword($cliente->id) }}</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->created_at)->locale('co')->Format('d M Y, h:m a') ?? '' }}
</td>
<td class="pl-2">{{ $cliente->estado ?? '' }}</td>
@php
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
$date2 = new DateTime(strtr(strval($cliente->fecha_final), '/', '-'));
@endphp
@if ($date1 < $date2)
<td class="pl-2">
{{ Carbon\Carbon::parse($cliente->created_at)->locale('co')->Format('d M Y, h:m a') ?? '' }}
@php
$diff = $date1->diff($date2);
echo $diff->days . ' dias';
@endphp
</td>
@endif
@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') ?? '' }}
@if ($date1 > $date2)
<td class="pl-2">
@php
echo 'Vencido';
@endphp
</td>
@endif
@php
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
$date2 = new DateTime(strtr(strval($cliente->fecha_final), '/', '-'));
@endphp
@if ($date1 == $date2)
<td class="pl-2">
@php
echo 'Vence hoy!!';
@endphp
</td>
@endif
@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" />
@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>
<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>
</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 (!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
@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
{{-- 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"
@@ -227,74 +200,92 @@
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="">
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" />
</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>
<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>
</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
</x-slot>
<x-slot name="tlink">
{{ $clientes->links() }}
</x-slot>
</x-primary-table>
</div>
{{-- Modal ver clientes --}}
+1 -45
View File
@@ -132,21 +132,11 @@
</div>
</div>
<div class="flex justify-start items-center gap-x-2">
<p>Ver</p>
<select wire:model="entradas" name="entradas" id="entradas" class="border-gray-200 rounded-md appearance-none">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<p>entradas</p>
</div>
<x-ver-entrada />
<x-primary-table>
<x-slot name="thead">
<tr class="text-left">
<th class="rounded-l-lg font-normal pl-[2rem]"></th>
<th class="font-normal pl-[2rem]">id</th>
<th class="font-normal pl-[2rem]">Servicio</th>
@@ -197,40 +187,6 @@
{{ $cuentas->links() }}
</x-slot>
</x-primary-table>
{{-- tabla --}}
<div class="overflow-y-auto max-h-full">
<table wire:loading.class="opacity-50 cursor-wait" 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">
</tr>
</thead>
<tbody class="text-gray-500 select-none">
@php
$n = 0;
@endphp
@foreach ($cuentas as $cuenta)
@php
$n++;
$historiales=false;
if(now()->addDay()->gt($cuenta->vencimiento)){
$historiales = $cuenta->historiales()->where('fecha_final', '>', now()->addDay()->toDateString())->count();
//var_dump(now()->toDateString(), $historiales);
}
@endphp
@include('components/listado-planes')
@endforeach
</tbody>
</table>
{{ $cuentas->links() }}
</div>
</div>
+5 -1
View File
@@ -1,3 +1,7 @@
<x-app-layout>
<livewire:show-clientes />
<div class="pb-4">
<livewire:show-clientes />
</div>
@include('layouts.footer')
</x-app-layout>