1077 lines
72 KiB
PHP
Executable File
1077 lines
72 KiB
PHP
Executable File
<div x-data="{
|
|
observacionesm: @entangle('observacionesm'),
|
|
observacionesm1: @entangle('observacionesm1'),
|
|
newCuenta: @entangle('newCuenta'),
|
|
modTarifas: @entangle('modTarifas'),
|
|
serviciosModal: @entangle('serviciosModal'),
|
|
notaEliminarModal: @entangle('notaEliminarModal'),
|
|
notaEliminarVariosModal: @entangle('notaEliminarVariosModal'),
|
|
ver: @entangle('ver'),
|
|
renovar: @entangle('renovar'),
|
|
addUser: @entangle('addUser'),
|
|
editarTarifaRol: @entangle('editarTarifaRol'),
|
|
|
|
}" 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="noRenovar,calcularFechas,siRenovar,ver,openRenovar,confirm_delete_cuenta,saveRenovar,createNewCuenta,createServicio,verObservacion,update,verObservacion1,update_observaciones1,eliminarCuentas,updateTarifas">
|
|
<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] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-4">
|
|
<div class="grid grid-cols-1 text-center sm:flex justify-between my-2 items-center text-sm ">
|
|
<div class="grid grid-cols-1 sm:flex items-center gap-4">
|
|
<div class="flex text-sm">
|
|
<x-icon-arrow-right />
|
|
Planes
|
|
</div>
|
|
|
|
<a x-on:click="newCuenta = true"
|
|
class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">
|
|
Nueva cuenta
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
|
|
id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;"
|
|
xml:space="preserve" class="w-[0.87rem] ml-2">
|
|
<path
|
|
d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z"
|
|
fill="#ffffff" />
|
|
</svg>
|
|
</a>
|
|
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
|
<a x-on:click="modTarifas = true"
|
|
class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">
|
|
Modificar tarifas
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" class="w-4 ml-2" x="0" y="0"
|
|
viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
|
|
<polygon points="14.604 5.687 0 20.29 0 24 3.71 24 18.313 9.396 14.604 5.687" fill="#ffffff"
|
|
data-original="#000000" />
|
|
<path
|
|
d="M23.232.768a2.624,2.624,0,0,0-3.71,0l-3.5,3.505,3.709,3.709,3.5-3.5A2.624,2.624,0,0,0,23.232.768Z"
|
|
fill="#ffffff" data-original="#000000" />
|
|
</svg>
|
|
</a>
|
|
@endif
|
|
</div>
|
|
<div class="flex relative my-2">
|
|
<input id="buscar" type="search" wire:model="buscar" placeholder="Buscar"
|
|
class="w-full md:w-auto shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 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="my-1 md:my-0">
|
|
<label for="completa">Completas</label>
|
|
<input type="checkbox" name="" id="completa" wire:model="completa">
|
|
</div>
|
|
<div class="my-1 md:my-0">
|
|
<label for="Pantallas">Pantallas</label>
|
|
<input type="checkbox" name="" id="Pantallas" wire:model="pantallas">
|
|
</div>
|
|
<div class="my-1 md:my-0">
|
|
<label for="cbox2">Vencidos</label>
|
|
<input type="checkbox" name="" id="cbox2" wire:model="venceHoy">
|
|
|
|
</div>
|
|
<div class="my-1 md:my-0">
|
|
<div class="my-1 md:my-0">
|
|
<label for="activos">Activos</label>
|
|
<input type="checkbox" name="" id="activos" wire:model="activoHoy">
|
|
</div>
|
|
<div class="my-1 md:my-0">
|
|
<label for="Libres 100%">Libres 100%</label>
|
|
<input type="checkbox" name="" id="Libres 100%" wire:model="libres">
|
|
</div>
|
|
<div class="my-1 md:my-0">
|
|
<label for="Repetidas">Repetidas</label>
|
|
<input type="checkbox" name="" id="Repetidas" wire:model="repetidas">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="my-1 md:my-0">
|
|
<button wire:click="eliminarCuentas" class="bg-red-400 text-white px-4 py-2 rounded">Eliminar</button>
|
|
</div>
|
|
|
|
<div class="grid mt-4 sm:mt-0 sm:flex w-[8rem]">
|
|
<select name="servicios" id="servicios" wire:model.debounce.500ms="servicios_id"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
<option value="" selected>Servicios</option>
|
|
@foreach ($servicios as $servicio)
|
|
<option value="{{ $servicio->id }}">{{ $servicio->nombre ?? '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between items-center gap-x-2">
|
|
|
|
<div>
|
|
<div class="my-1 md:my-0 text-sm">
|
|
<input type="checkbox" name="" id="Libres 100%" wire:click="seleccionarTodos">
|
|
<label for="Libres 100%">Seleccionar todos</label>
|
|
</div>
|
|
</div>
|
|
|
|
<x-ver-entrada />
|
|
</div>
|
|
|
|
<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>
|
|
<th class="font-normal pl-[2rem]">Correo</th>
|
|
<th class="font-normal pl-[2rem]">Contraseña</th>
|
|
<th class="font-normal pl-[2rem] hidden md:table-cell">Inicio - Final</th>
|
|
<th class="font-normal pl-[2rem]">Restante</th>
|
|
<th class="font-normal pl-[2rem]">Ocupado</th>
|
|
<th class="font-normal pl-[2rem]"></th>
|
|
<th class="font-normal pl-[2rem] hidden md:table-cell"></th>
|
|
<th class="font-normal rounded-r-lg md:rounded-r-none"></th>
|
|
<th class="rounded-r-lg font-normal hidden md:table-cell"></th>
|
|
</tr>
|
|
</x-slot>
|
|
<x-slot name="tbody">
|
|
@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();
|
|
}
|
|
|
|
@endphp
|
|
|
|
@include('components/listado-planes')
|
|
@endforeach
|
|
</x-slot>
|
|
<x-slot name="tlink">
|
|
{{ $cuentas->links() }}
|
|
</x-slot>
|
|
</x-primary-table>
|
|
</div>
|
|
|
|
{{-- Modal ver --}}
|
|
<div x-cloak x-show="ver" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="bg-[#000029] text-white text-center text-lg py-3 rounded-xl">
|
|
{{ $nombre_servicios }}
|
|
</div>
|
|
|
|
{{-- tabla usuarios --}}
|
|
<div class="overflow-y-auto max-h-96">
|
|
<table class="w-full sm-w-[20rem] text-center mt-4 border-separate border-spacing-y-2 mb-4">
|
|
<thead class="font-normal bg-[#000029] text-white h-9">
|
|
<tr class="text-left">
|
|
<th class="rounded-l-lg font-normal pl-[2rem]">Distribuidor</th>
|
|
<th class="font-normal pl-[2rem]">Perfil</th>
|
|
<th class="font-normal pl-[2rem]">Cliente</th>
|
|
<th class="font-normal pl-[2rem]">Restante</th>
|
|
<th class="font-normal pl-[2rem]">Inicio</th>
|
|
<th class="font-normal pl-[2rem]">Final</th>
|
|
<th class="font-normal"></th>
|
|
<th class="rounded-r-lg font-normal w-[1rem]"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-gray-500 select-none">
|
|
@if (!is_null($consulta_verUsuarios))
|
|
@foreach ($consulta_verUsuarios->historiales->unique() as $verUsuarios)
|
|
<tr class="border-gray-200 text-left w-full pl-4" x-data="{ openOption: false }">
|
|
<td class="pl-[2rem]">{{ $verUsuarios->vendedor->name ?? '' }}</td>
|
|
@if ($consulta_verUsuarios->estado == 'activo')
|
|
<td class="pl-[2rem]">
|
|
@foreach ($consulta_verUsuarios->perfil as $perfil)
|
|
@if ($verUsuarios->id == $perfil->historial_id)
|
|
-Perfil: {{ $perfil->perfil ?? '' }}
|
|
@endif
|
|
@endforeach
|
|
|
|
|
|
</td>
|
|
@else
|
|
<td class="pl-[2rem]"></td>
|
|
@endif
|
|
|
|
<td class="pl-[2rem]">{{ $verUsuarios->cliente->name ?? '' }}</td>
|
|
|
|
@php
|
|
|
|
$date1 = new DateTime(strtr(strval($fechaActual), '/', '-'));
|
|
$date2 = new DateTime(strtr(strval($verUsuarios->fecha_final), '/', '-'));
|
|
|
|
@endphp
|
|
|
|
@if ($date1 < $date2)
|
|
<td class="pl-[2rem]">
|
|
@php
|
|
$diff = $date1->diff($date2);
|
|
echo $diff->days . ' dias';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 > $date2)
|
|
<td class="pl-[2rem]">
|
|
@php
|
|
echo 'Vencido';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
@if ($date1 == $date2)
|
|
<td class="pl-[2rem]">
|
|
@php
|
|
echo 'Vence hoy!!';
|
|
@endphp
|
|
</td>
|
|
@endif
|
|
|
|
<td class="pl-[2rem]">
|
|
{{ \Carbon\Carbon::parse($verUsuarios->fecha_inicio)->format('d/m/Y') }}
|
|
</td>
|
|
<td class="pl-[2rem]">
|
|
{{ \Carbon\Carbon::parse($verUsuarios->fecha_final)->format('d/m/Y') }}
|
|
</td>
|
|
|
|
@php
|
|
$promocion = $verUsuarios->promocion_id;
|
|
$observaciones = $verUsuarios->observaciones;
|
|
@endphp
|
|
|
|
@if (!is_null($promocion))
|
|
<td class="pl-2">
|
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" version="1.1"
|
|
class="w-5 " x="0" y="0" viewBox="0 0 24 24"
|
|
style="enable-background:new 0 0 512 512" xml:space="preserve">
|
|
<path
|
|
d="M19.467,23.316,12,17.828,4.533,23.316,7.4,14.453-.063,9H9.151L12,.122,14.849,9h9.213L16.6,14.453Z"
|
|
fill="#b221fd" data-original="#000000" />
|
|
</svg>
|
|
</td>
|
|
@else
|
|
<td class="pl-2">
|
|
|
|
</td>
|
|
@endif
|
|
|
|
@if (!is_null($observaciones))
|
|
<td class="pl-2">
|
|
<div class="cursor-pointer"
|
|
wire:click="verObservacion({{ $verUsuarios->id }})"
|
|
x-on:click="observacionesm=true" title="{{ $observaciones }}">
|
|
<svg 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 text-green-700">
|
|
<path stroke-linecap="round" stroke-linejoin="round"
|
|
d="M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" />
|
|
</svg>
|
|
</div>
|
|
</td>
|
|
@else
|
|
<td class="pl-2">
|
|
<svg wire:click="verObservacion({{ $verUsuarios->id }})"
|
|
x-on:click="observacionesm=true" class="w-7 cursor-pointer"
|
|
xmlns="http://www.w3.org/2000/svg" version="1.1"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
xmlns:svgjs="http://svgjs.com/svgjs" x="0" y="0"
|
|
viewBox="0 0 32 32" style="enable-background:new 0 0 512 512"
|
|
xml:space="preserve" class="">
|
|
<g>
|
|
<g id="Layer_57" data-name="Layer 57">
|
|
<path
|
|
d="m23 28a3 3 0 0 0 3-3v-13.17a3 3 0 0 0 -.88-2.12l-4.83-4.83a3 3 0 0 0 -2.12-.88h-8.17a3 3 0 0 0 -3 3v18a3 3 0 0 0 3 3zm-.41-18h-1.59a1 1 0 0 1 -1-1v-1.59zm-13.59 15v-18a1 1 0 0 1 1-1h8v3a3 3 0 0 0 3 3h3v13a1 1 0 0 1 -1 1h-13a1 1 0 0 1 -1-1z"
|
|
fill="#d3b637" data-original="#000000"
|
|
class=""></path>
|
|
<path
|
|
d="m12.5 19.5h2.5v2.5a1 1 0 0 0 2 0v-2.5h2.5a1 1 0 0 0 0-2h-2.5v-2.5a1 1 0 0 0 -2 0v2.5h-2.5a1 1 0 0 0 0 2z"
|
|
fill="#d3b637" data-original="#000000"
|
|
class=""></path>
|
|
</g>
|
|
</g>
|
|
</svg>
|
|
</td>
|
|
@endif
|
|
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
<div><span class="font-semibold text-gray-700">Email:</span>{{ $consulta_verUsuarios->correo ?? '' }}</div>
|
|
<div><span class="font-semibold text-gray-700">Password:</span>{{ $consulta_verUsuarios->password ?? '' }}</div>
|
|
<div class="flex justify-end">
|
|
@if ($consulta_verUsuarios)
|
|
@if ($consulta_verUsuarios->estado == 'pendiente')
|
|
@if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->completa)
|
|
@if (Auth::user()->rol->nombre == 'super')
|
|
<span class="mr-4">
|
|
<button wire:click="openAdd" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5 ">
|
|
Añadir usuario
|
|
</button>
|
|
</span>
|
|
@endif
|
|
@endif
|
|
@else
|
|
@if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->pantallas)
|
|
@if (Auth::user()->rol->nombre == 'super')
|
|
<span class="mr-4">
|
|
<button wire:click="openAdd" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5 ">
|
|
Añadir usuario
|
|
</button>
|
|
</span>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
@endif
|
|
<span>
|
|
<button wire:click="openRenovar" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5 ">
|
|
Editar cuenta
|
|
</button>
|
|
</span>
|
|
</div>
|
|
</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="ver=false" wire:click="" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal renovar --}}
|
|
<div x-cloak x-show="renovar" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
|
|
<div class="mb-4">
|
|
<label for="usuario_renovar" class="block text-gray-700 text-sm font-bold mb-2">Usuario:</label>
|
|
<input type="email" id="usuario_nrenovar" wire:model="usuario_renovar" 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="password_renovar"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Contraseña:</label>
|
|
<input type="text" id="password_renovar" wire:model="password_renovar" 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="disponible" class="block text-gray-700 text-sm font-bold mb-2">Disponibilidad:</label>
|
|
<select name="" id="" wire:model="estado" 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">
|
|
<option value="activo">Pantallas</option>
|
|
<option value="pendiente">Cuenta completa</option>
|
|
<option value="inactivo">Inactivo</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<button wire:click="calcularFechas" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5" >
|
|
+ 30 dias
|
|
</button>
|
|
</div>
|
|
|
|
<div date-rangepicker class="flex items-center gap-2 mb-4">
|
|
<div class="relative">
|
|
<label for="fecha_inicial_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha inicio:</label>
|
|
<input name="fecha_inicial_renovar" wire:model.defer="fecha_inicial_renovar" type="date" class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
|
</div>
|
|
|
|
<div class="relative">
|
|
<label for="fecha_final_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha Final:</label>
|
|
<input name="fecha_final_renovar" wire:model.defer="fecha_final_renovar" type="date" class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
|
</div>
|
|
</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 wire:click="saveRenovar()" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button x-on:click="renovar=false" wire:click="" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal add user --}}
|
|
<div x-cloak x-show="addUser" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="mb-2">
|
|
<label for="correo" class="block text-gray-700 text-sm font-bold mb-2">Correo:</label>
|
|
<input wire:model="searchTerm" id="correo" type="text" placeholder="Escribir correo"
|
|
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" />
|
|
|
|
<select wire:model="selectedOption"
|
|
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">
|
|
@if ($usuarios)
|
|
@foreach ($usuarios as $option)
|
|
<option value="{{ $option->email }}" selected>{{ $option->email }}</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</div>
|
|
|
|
{{-- @if (!empty($consulta_verUsuarios->servicio->perfiles))
|
|
|
|
<div class="mb-4">
|
|
<label for="Perfil " class="block text-gray-700 text-sm font-bold mb-2">Perfil:</label>
|
|
<select name="" id="" wire:model="perfil" disabled 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">
|
|
@if ($consulta_verUsuarios)
|
|
<option value="" select>Seleccionar</option>
|
|
@php
|
|
$pantallas = $consulta_verUsuarios->servicio->pantallas;
|
|
@endphp
|
|
|
|
@for ($i = 1; $i <= $pantallas; $i++)
|
|
<option value="{{$i}}">Perfil {{$i}}</option>
|
|
@endfor
|
|
@endif
|
|
</select>
|
|
</div>
|
|
|
|
@endif --}}
|
|
|
|
@if (!empty($consulta_verUsuarios->servicio->tarifas))
|
|
<label for="tarifa " class="block text-gray-700 text-sm font-bold mb-2">Tarifa:</label>
|
|
<select name="" id="" wire:model="tarifa"
|
|
class="border-2 border-neutral-200 rounded-lg 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">
|
|
<option value="" select>Seleccionar</option>
|
|
@foreach ($consulta_verUsuarios->servicio->tarifas as $tarifaItem)
|
|
@if ($consulta_verUsuarios->estado == 'pendiente' && $tarifaItem->rol_id == '5')
|
|
@if ($tarifaItem->pantallas == $tarifaItem->servicio->completa)
|
|
@if ($tarifaItem->servicio->por_tiempo)
|
|
<option value="{{ $tarifaItem }}">{{ $tarifaItem->servicio->nombre }} -
|
|
{{ $tarifaItem->dias }} {{ __($tarifaItem->dias == 1 ? 'día' : 'días') }}
|
|
</option>
|
|
@else
|
|
<option value="{{ $tarifaItem }}">{{ $tarifaItem->servicio->nombre }} -
|
|
{{ $tarifaItem->pantallas }}
|
|
{{ __($tarifaItem->pantallas == 1 ? 'pantalla' : 'pantallas') }} -
|
|
{{ $tarifaItem->dias }} {{ __($tarifaItem->dias == 1 ? 'día' : 'días') }}
|
|
</option>
|
|
@endif
|
|
@endif
|
|
@else
|
|
@if (
|
|
$tarifaItem->rol_id == '5' &&
|
|
$tarifaItem->pantallas <= $tarifaItem->servicio->pantallas - count($consulta_verUsuarios->historiales))
|
|
@if ($tarifaItem->servicio->por_tiempo)
|
|
<option value="{{ $tarifaItem }}">{{ $tarifaItem->servicio->nombre }} -
|
|
{{ $tarifaItem->dias }} {{ __($tarifaItem->dias == 1 ? 'día' : 'días') }}
|
|
</option>
|
|
@else
|
|
<option value="{{ $tarifaItem }}">{{ $tarifaItem->servicio->nombre }} -
|
|
{{ $tarifaItem->pantallas }}
|
|
{{ __($tarifaItem->pantallas == 1 ? 'pantalla' : 'pantallas') }} -
|
|
{{ $tarifaItem->dias }} {{ __($tarifaItem->dias == 1 ? 'día' : 'días') }}
|
|
</option>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
@endforeach
|
|
</select>
|
|
@error('tarifa')
|
|
<p class="text-sm text-red-400">{{ 'Requerido*' }}</p>
|
|
@enderror
|
|
@endif
|
|
|
|
<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 wire:click="saveUser()" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button x-on:click="addUser=false" wire:click="" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal observaciones --}}
|
|
<div x-cloak x-show="observacionesm" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="mb-4 hidden">
|
|
<input type="number" id="id_observacion" wire:model="id_observacion"
|
|
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 mt-4">
|
|
<label for="observaciones"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Observaciones:</label>
|
|
<textarea type="text" id="observaciones" wire:model="observaciones"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 h-40 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
|
|
</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 wire:click="update" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button x-on:click="observacionesm=false" wire:click="limpiarInputObservaciones"
|
|
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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal observaciones1 --}}
|
|
<div x-cloak x-show="observacionesm1" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="mb-4 hidden">
|
|
<input type="number" id="id_observacion1" wire:model="id_observacion1"
|
|
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 mt-4">
|
|
<label for="observaciones1"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Observaciones:</label>
|
|
<textarea type="text" id="observaciones1" wire:model="observaciones1"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 h-40 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
|
|
</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 wire:click="update_observaciones1" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button wire:click="limpiarInputObservaciones1" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal newCuenta --}}
|
|
<div x-cloak x-show="newCuenta" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
|
|
<div class="mb-4">
|
|
<select name="servicioNew" id="servicioNew" wire:model.debounce.500ms="servicio_newCuenta"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-[72%] sm:w-60 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
<option value="" selected>Servicios</option>
|
|
@foreach ($servicios as $servicio)
|
|
<option value="{{ $servicio->id }}">{{ $servicio->nombre ?? '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('servicio_newCuenta')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
<button x-on:click.prevent="serviciosModal=!serviciosModal" x-transition.duration.300ms
|
|
class="p-0 w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
|
|
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block">
|
|
<path fill="#FFFFFF" d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
|
|
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
|
|
C15.952,9,16,9.447,16,10z" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="usuario_newCuenta" class="block text-gray-700 text-sm font-bold mb-2">Usuario:</label>
|
|
<input type="email" id="usuario_newCuenta" wire:model="usuario_newCuenta"
|
|
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">
|
|
@error('usuario_newCuenta')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="password_newCuenta"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Contraseña:</label>
|
|
<input type="text" id="password_newCuenta" wire:model="password_newCuenta"
|
|
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">
|
|
@error('password_newCuenta')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="disponible" class="block text-gray-700 text-sm font-bold mb-2">Disponibilidad:</label>
|
|
<select name="" id="" wire:model="estado"
|
|
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">
|
|
<option value="activo">Pantallas</option>
|
|
<option value="pendiente">Cuenta completa</option>
|
|
<option value="inactivo">Inactivo</option>
|
|
</select>
|
|
@error('estado')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
|
|
</div>
|
|
|
|
<div date-rangepicker class="flex items-center gap-2 mb-4">
|
|
<div class="relative">
|
|
<label for="fecha_inicial" class="block text-gray-700 text-sm font-bold mb-2">Fecha
|
|
inicio:</label>
|
|
<input name="fecha_inicial" wire:model.defer="fecha_inicial" type="date"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-0 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
|
@error('fecha_inicial')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="relative">
|
|
<label for="fecha_final" class="block text-gray-700 text-sm font-bold mb-2">Fecha
|
|
Final:</label>
|
|
<input name="fecha_final" wire:model.defer="fecha_final" type="date"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-0 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
|
@error('fecha_final')
|
|
<div class="text-red-500 text-sm">{{ 'Requerido*' }}</div>
|
|
@enderror
|
|
</div>
|
|
</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 wire:click="createNewCuenta" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button wire:click="limpiarInputNewCuenta" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal tarifas --}}
|
|
<div x-cloak x-show="modTarifas" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
|
|
<div class="mb-4">
|
|
<select name="servicio" id="servicio" wire:model.debounce.500ms="servicio_modTarifas"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-[72%] sm:w-60 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
<option value="" selected>Servicios</option>
|
|
@foreach ($servicios as $servicio)
|
|
<option value="{{ $servicio->id }}">{{ $servicio->nombre ?? '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
<button x-on:click.prevent="serviciosModal=!serviciosModal" x-transition.duration.300ms
|
|
class="p-0 w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
|
|
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block">
|
|
<path fill="#FFFFFF" d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
|
|
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
|
|
C15.952,9,16,9.447,16,10z" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-gray-700 text-sm font-bold mb-2">Pantallas:</label>
|
|
<div class="grid grid-cols-4 gap-2 text-left mb-4">
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Rol</label>
|
|
<select name="roles" id="roles" wire:model.debounce.500ms="roles_modTarifas"
|
|
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">
|
|
<option value="" selected>Roles</option>
|
|
@foreach ($roles as $rol)
|
|
<option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Pantallas</label>
|
|
<input type="number" id="pantallas_modTarifas" wire:model="pantallas_modTarifas"
|
|
min="1"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Precio</label>
|
|
<input type="number" id="precio_modTarifas" wire:model="precio_modTarifas"
|
|
min="0"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Utilidad</label>
|
|
<input type="number" id="utilidad" wire:model="utilidad" min="0"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4 grid grid-cols-3">
|
|
<div class="w-[7rem] flex items-center">
|
|
<label class="text-gray-500 text-sm mr-2">Dias</label>
|
|
<input type="number" min="30" id="diasTarifa" wire:model="diasTarifa"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
|
|
<div class="flex m-auto items-center">
|
|
<label class="text-gray-500 text-sm mr-2">Activa</label>
|
|
<input type="checkbox" id="estadoTarifa" wire:model="estadoTarifa" checked
|
|
class="border-2 border-neutral-200 focus:ring-0 shadow apperance-none focus:border-neutral-300 text-[#B221FD] leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="mb-3 mt-3 flex justify-end">
|
|
<span>
|
|
<button wire:click="updateTarifas" type="button"
|
|
class="inline-flex justify-center w-full md:w-auto rounded-md border border-transparent px-4 py-1 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Añadir</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="overflow-y-auto max-h-48">
|
|
<table class="w-full sm-w-[20rem] text-center mt-4 border-separate border-spacing-y-2 mb-4">
|
|
<thead class="font-normal bg-[#000029] text-white h-9">
|
|
<tr class="text-left">
|
|
<th class="rounded-l-lg font-normal pl-[1rem]">Estado</th>
|
|
<th class="font-normal pl-[1rem]">Rol</th>
|
|
<th class="font-normal pl-[1rem] whitespace-nowrap">Pantallas</th>
|
|
<th class="font-normal pl-[1rem]">Valor</th>
|
|
<th class="font-normal pl-[1rem]">Dias</th>
|
|
<th class="font-normal pl-[1rem]">Utilidad</th>
|
|
<th class="font-normal pl-[1rem]"></th>
|
|
<th class="rounded-r-lg font-normal w-[1rem]"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-gray-500 select-none">
|
|
@if (!empty($tarifas))
|
|
@foreach ($tarifas as $tarifa)
|
|
<tr class="border-gray-200 text-left w-full pl-4">
|
|
<td class="pl-[1rem]">
|
|
@if ($tarifa->estado == 'activo')
|
|
<div class="bg-green-500 rounded-full w-3 h-3"></div>
|
|
@else
|
|
<div class="bg-red-500 rounded-full w-3 h-3"></div>
|
|
@endif
|
|
</td>
|
|
<td class="pl-[1rem]">{{ $tarifa->rol->nombre ?? '' }}</td>
|
|
<td class="pl-[1rem]">{{ $tarifa->pantallas ?? '' }}</td>
|
|
<td class="pl-[1rem]">{{ number_format($tarifa->valor ?? 0) }}</td>
|
|
<td class="pl-[1rem]">{{ $tarifa->dias ?? '' }}</td>
|
|
<td class="pl-[1rem]">{{ number_format($tarifa->utilidad ?? 0) }}</td>
|
|
<td class="pl-[1rem]">
|
|
<button wire:click="editar({{ $tarifa }})"
|
|
class="justify-center flex px-3 py-2 rounded-lg text-xs cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">Editar</button>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</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="modTarifas=false" wire:click="" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div x-cloak x-show="editarTarifaRol" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
@if ($informacionTarifaRol)
|
|
<div>
|
|
<label class="block text-gray-700 text-sm font-bold mb-2">Pantallas:</label>
|
|
<div class="grid grid-cols-4 gap-2 text-left mb-4">
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Rol</label>
|
|
<select name="roles" id="roles" wire:model.debounce.500ms="roles_modTarifas"
|
|
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">
|
|
<option value="" selected>Roles</option>
|
|
@foreach ($roles as $rol)
|
|
<option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Pantallas</label>
|
|
<input type="number" id="pantallas_modTarifas" wire:model="pantallas_modTarifas"
|
|
min="1"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Precio</label>
|
|
<input type="number" id="precio_modTarifas" wire:model="precio_modTarifas"
|
|
min="0"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="w-[6rem]">
|
|
<label class="text-gray-500 text-sm">Utilidad</label>
|
|
<input type="number" id="utilidad" wire:model="utilidad" min="0"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4 grid grid-cols-3">
|
|
<div class="w-[7rem] flex items-center">
|
|
<label class="text-gray-500 text-sm mr-2">Dias</label>
|
|
<input type="number" min="30" id="diasTarifa" wire:model="diasTarifa"
|
|
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
|
|
<div class="flex m-auto items-center">
|
|
<label class="text-gray-500 text-sm mr-2">Activa</label>
|
|
<input type="checkbox" id="estadoTarifa" wire:model="estadoTarifa"
|
|
class="border-2 border-neutral-200 focus:ring-0 shadow apperance-none focus:border-neutral-300 text-[#B221FD] leading-tight focus:outline-none focus:shadow-outline">
|
|
</div>
|
|
<div class="mb-3 mt-3 flex justify-end">
|
|
<span>
|
|
<button wire:click="actualizarTarifaRol('{{ $informacionTarifaRol['id'] }}')"
|
|
type="button"
|
|
class="inline-flex justify-center w-full md:w-auto rounded-md border border-transparent px-4 py-1 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Actualizar</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
|
|
|
|
<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="editarTarifaRol=false" wire:click="" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Modal agregar servicios --}}
|
|
<div x-cloak x-show="serviciosModal" 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 ">
|
|
<form>
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
|
|
<div class="mb-4 grid grid-cols-2 items-center justify-items-center">
|
|
<div>
|
|
<label for="imagen_servicios"
|
|
class="text-white bg-[#B221FD] hover:bg-[#7a02b8] px-3 py-1 rounded-md cursor-pointer">Subir
|
|
logo</label>
|
|
<input type="file" name="imagen_servicios" id="imagen_servicios" wire:model="photo"
|
|
class="hidden">
|
|
</div>
|
|
|
|
<div>
|
|
@if ($photo)
|
|
<img src="{{ $photo->temporaryUrl() }}" alt=""
|
|
class="object-cover rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20">
|
|
@else
|
|
<div class="rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20"></div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4 grid grid-cols-2 items-center justify-items-center">
|
|
<div>
|
|
<label for="imagen_inicio_servicios"
|
|
class="text-white bg-[#B221FD] hover:bg-[#7a02b8] px-3 py-1 rounded-md cursor-pointer">Img
|
|
inicio
|
|
</label>
|
|
<input type="file" name="imagen_inicio_servicios" id="imagen_inicio_servicios"
|
|
wire:model="photo_inicio" class="hidden">
|
|
</div>
|
|
|
|
<div>
|
|
@if ($photo_inicio)
|
|
<img src="{{ $photo_inicio->temporaryUrl() }}" alt=""
|
|
class="object-cover rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20">
|
|
@else
|
|
<div class="rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20"></div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="nombre_servicio"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
|
|
<input type="text" id="nombre_servicio" wire:model="nombre_servicio"
|
|
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="descripcion_servicio"
|
|
class="block text-gray-700 text-sm font-bold mb-2">Descripción:</label>
|
|
<textarea type="text" id="descripcion_servicio" wire:model="descripcion_servicio"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<select name="estado" id="estado" wire:model.debounce.500ms="estado_servicio"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-[72%] sm:w-60 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
|
<option value="" selected>Estado</option>
|
|
<option value="activo">Activo</option>
|
|
<option value="inactivo">Inactivo</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-4 grid grid-cols-2 items-center">
|
|
<label for="color_servicio" class="text-gray-700 text-sm font-bold">Color fondo:</label>
|
|
<input type="color" id="color_servicio" wire:model="color_servicio"
|
|
class="border-neutral-200 w-full shadow apperance-none focus:border-neutral-300 focus:ring-0 leading-tight focus:outline-none focus:shadow-outline">
|
|
</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 wire:click="createServicio" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
|
|
</span>
|
|
<span>
|
|
<button x-on:click="serviciosModal=false" wire:click="limpiarInputServiciosModal"
|
|
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>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div x-cloak x-show="notaEliminarModal" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-lg shadow-md">
|
|
|
|
<div class="mb-4 flex flex-col">
|
|
<label for="nota_eliminacion" class="block text-gray-700 text-sm font-bold mb-2">Nota:</label>
|
|
<textarea type="text" id="nota_eliminacion" wire:model="nota_eliminacion" placeholder="Porque quieres eliminar esta cuenta?" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 h-40 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
|
|
@error('nota_eliminacion')
|
|
<div class="text-red-500">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="bg-white py-3 sm:flex sm:flex-row-reverse sm:justify-between gap-5 mt-4">
|
|
<button wire:click="confirm_delete_cuenta" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Eliminar</button>
|
|
<button x-on:click="notaEliminarModal=false"
|
|
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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div x-cloak x-show="notaEliminarVariosModal" 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">
|
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-lg shadow-md">
|
|
|
|
<div class="mb-4 flex flex-col">
|
|
<label for="nota_eliminacion" class="block text-gray-700 text-sm font-bold mb-2">Nota:</label>
|
|
<textarea type="text" id="nota_eliminacion" wire:model="nota_eliminacion"
|
|
placeholder="Porque quieres eliminar estas cuentas?"
|
|
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 h-40 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
|
|
@error('nota_eliminacion')
|
|
<div class="text-red-500">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<div class="bg-white py-3 sm:flex sm:flex-row-reverse sm:justify-between gap-5 mt-4">
|
|
<button wire:click="confirm_delete_cuentas" type="button"
|
|
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Eliminar</button>
|
|
<button x-on:click="notaEliminarVariosModal=false"
|
|
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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@include('layouts.footer')
|
|
|
|
<script>
|
|
function copiarAlPortapapeles(id_elemento) {
|
|
var aux = document.createElement("input");
|
|
aux.setAttribute("value", document.getElementById(id_elemento).innerHTML);
|
|
document.body.appendChild(aux);
|
|
aux.select();
|
|
document.execCommand("copy");
|
|
document.body.removeChild(aux);
|
|
}
|
|
</script>
|
|
|
|
</div>
|