From 5b1acb7bba5abea8e70f56242c2e018c80c39959 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 14 Jun 2024 09:22:22 -0500 Subject: [PATCH] administradores y editores puedes crear distribuidores --- app/Http/Livewire/ShowUsuarios.php | 8 +- .../views/livewire/show-usuarios.blade.php | 189 ++++++++++-------- 2 files changed, 118 insertions(+), 79 deletions(-) diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index 7dba64b..d702441 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -120,7 +120,13 @@ class ShowUsuarios extends Component $consulta_tarifas = TarifaPromo::with('rol')->where('promocion_id', $this->servicio_modTarifas)->get(); } - $this->roles = Role::get(); + if (Auth::user()->rol->nombre == "super") { + + $this->roles = Role::get(); + }else{ + + $this->roles = Role::where('nombre', '=', 'distribuidor')->get(); + } return view('livewire.show-usuarios', [ 'usuarios' => $consulta_usuarios, diff --git a/resources/views/livewire/show-usuarios.blade.php b/resources/views/livewire/show-usuarios.blade.php index dc51520..f390310 100755 --- a/resources/views/livewire/show-usuarios.blade.php +++ b/resources/views/livewire/show-usuarios.blade.php @@ -22,17 +22,27 @@
+ class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10"> + + + + + + + +
+ @endif + @endforeach @@ -143,13 +159,16 @@
+ x-transition:leave-end="opacity-0 scale-100" + class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">

Personalización de precios para {{ $usuario_nombre }}

- +
@@ -237,9 +256,11 @@ @if ($usuarioTarifa->visible !== 'true') - + @else - + @endif ${{ $usuarioTarifa->precio ?? '' }} @@ -589,17 +610,20 @@ Monto a recargar
- +
Tu valor total seria: $

- @php - - $valor_recargar = str_replace([',', '.'], '', $valor_recargar); - @endphp - @if(!empty($valor_recargar)) - {{ number_format((int)$saldo_actual + (int)$valor_recargar) }} + @php + + $valor_recargar = str_replace([',', '.'], '', $valor_recargar); + @endphp + @if (!empty($valor_recargar)) + {{ number_format((int) $saldo_actual + (int) $valor_recargar) }} @else - {{ number_format((int)$saldo_actual)}} + {{ number_format((int) $saldo_actual) }} @endif

@@ -647,7 +671,7 @@ class="border-2 w-1/2 md:w-auto mb-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
Tu valor total seria: $

- {{ number_format((int)$saldo_actual - (int)$valor_recargar) }} + {{ number_format((int) $saldo_actual - (int) $valor_recargar) }}

@@ -693,7 +717,8 @@
- @foreach ($roles as $rol) @@ -703,12 +728,16 @@
- +
- +
@@ -719,7 +748,8 @@ 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">
- +
@@ -750,7 +780,8 @@ {{ number_format($tarifa->precio) ?? 0 }} {{ number_format($tarifa->utilidad) ?? 0 }} - + @endforeach @@ -770,7 +801,11 @@
-
+
@if ($informacionTarifaRol) @@ -779,7 +814,8 @@
- +
@@ -833,14 +870,10 @@
- - - -