update global subvendedor
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Configuracione;
|
||||
use App\Models\Role;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
@@ -22,7 +23,6 @@ class ShowRoles extends Component
|
||||
public function render()
|
||||
{
|
||||
if (auth()->user()->rol_id == 5) {
|
||||
|
||||
$query = Role::withCount('usuarios');
|
||||
if ($this->filtro_id) {
|
||||
$query->where('subvendedor_id', $this->filtro_id);
|
||||
@@ -37,7 +37,8 @@ class ShowRoles extends Component
|
||||
|
||||
return view('livewire.show-roles', [
|
||||
'roles' => $consulta_roles,
|
||||
'usuarios' => $consulta_usuarios
|
||||
'usuarios' => $consulta_usuarios,
|
||||
'config' => Configuracione::with('usuario')->orderby('id', 'desc')->first(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Configuracione;
|
||||
use App\Models\Promociones;
|
||||
use App\Models\Role;
|
||||
use App\Models\Servicio;
|
||||
@@ -62,6 +63,7 @@ class ShowTarifas extends Component
|
||||
'roles' => Role::where('subvendedor_id', auth()->user()->id)->get(),
|
||||
'promo' => Promociones::where('visible', 'true')->get(),
|
||||
'servicios' => Servicio::where('estado', 'activo')->get(),
|
||||
'config' => Configuracione::with('usuario')->orderby('id', 'desc')->first(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Configuracione;
|
||||
use App\Models\Historiale;
|
||||
use App\Models\Log_general;
|
||||
use App\Models\Promociones;
|
||||
@@ -167,6 +168,7 @@ class ShowUsuarios extends Component
|
||||
'usuarios' => $consulta_usuarios,
|
||||
'tarifas' => $consulta_tarifas,
|
||||
'promo' => Promociones::where('visible', 'true')->get(),
|
||||
'config' => Configuracione::with('usuario')->orderby('id', 'desc')->first(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('configuraciones', function (Blueprint $table) {
|
||||
$table->boolean('subvendedor')->default(false)->after('catalogo');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('configuraciones', function (Blueprint $table) {
|
||||
$table->dropColumn('subvendedor');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="sm:block h-full" x-data="{ menuG: false }">
|
||||
|
||||
@php
|
||||
$config = \App\Models\Configuracione::orderby('id', 'desc')->first();
|
||||
$config = \App\Models\Configuracione::orderby('id', 'desc')->first();
|
||||
@endphp
|
||||
|
||||
<div x-cloak x-show="menuG"
|
||||
@@ -74,82 +74,87 @@
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
@if (!empty($config->catalogo))
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<div
|
||||
class="flex cursor-pointer block pl-3 pr-4 py-3 text-base font-medium text-[#000029] transition duration-150 ease-in-out rounded-none">
|
||||
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
||||
class="flex items-center justify-between">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
|
||||
</svg>
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<div
|
||||
class="flex cursor-pointer block pl-3 pr-4 py-3 text-base font-medium text-[#000029] transition duration-150 ease-in-out rounded-none">
|
||||
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
||||
class="flex items-center justify-between">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
|
||||
</svg>
|
||||
|
||||
Descargar Catalogo
|
||||
</a>
|
||||
Descargar Catalogo
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link :href="route('reportes')" :active="request()->routeIs('reportes')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 24 24"
|
||||
class="w-5 mx-3">
|
||||
<rect x="14" y="11" width="2" height="9" />
|
||||
<rect x="6" y="11" width="2" height="9" />
|
||||
<rect x="18" y="6" width="2" height="14" />
|
||||
<rect x="10" y="6" width="2" height="14" />
|
||||
</svg>
|
||||
{{ __('Reportes') }}
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link :href="route('reportes')" :active="request()->routeIs('reportes')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 24 24"
|
||||
class="w-5 mx-3">
|
||||
<rect x="14" y="11" width="2" height="9" />
|
||||
<rect x="6" y="11" width="2" height="9" />
|
||||
<rect x="18" y="6" width="2" height="14" />
|
||||
<rect x="10" y="6" width="2" height="14" />
|
||||
</svg>
|
||||
{{ __('Reportes') }}
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@if (auth()->user()->subvendedor || auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor')
|
||||
<ul class="relative shadow-md block w-11/12 mx-auto select-none " x-data="{ selected: null }">
|
||||
<li class="flex align-center flex-col">
|
||||
<h4 @click="selected !== 0 ? selected = 0 : selected = null" class="cursor-pointer px-5 py-3 bg-[#b221fd] text-white text-center inline-block hover:bg-[#7a02b8] hover:shadow rounded-lg">
|
||||
@if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor')
|
||||
|
||||
Admin
|
||||
@else
|
||||
Subvendedor
|
||||
@endif
|
||||
@if ((auth()->user()->subvendedor && $config->subvendedor) || in_array(auth()->user()->rol->nombre, ['super', 'administrador', 'editor']))
|
||||
<ul class="relative shadow-md block w-11/12 mx-auto select-none " x-data="{ selected: null }">
|
||||
<li class="flex align-center flex-col">
|
||||
<h4 @click="selected !== 0 ? selected = 0 : selected = null" class="cursor-pointer px-5 py-3 bg-[#b221fd] text-white text-center inline-block hover:bg-[#7a02b8] hover:shadow rounded-lg">
|
||||
@if (in_array(auth()->user()->rol->nombre, ['super', 'administrador', 'editor']))
|
||||
Admin
|
||||
@else
|
||||
Subvendedor
|
||||
@endif
|
||||
</h4>
|
||||
<p class="absolute bg-[#f2f4ff] rounded-md @if (auth()->user()->rol->nombre == 'editor') -top-[400%] @elseif (auth()->user()->rol->nombre == 'administrador') -top-[200%] @elseif (auth()->user()->rol->nombre == 'super') -top-[300%] @elseif (auth()->user()->subvendedor) -top-3 @else -top-[800%] @endif -right-[20%] sm:-right-[55%]" x-show="selected == 0">
|
||||
@if ($config->subvendedor && auth()->user()->subvendedor)
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('roles') }}">Gestión Roles</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('usuarios') }}">Gestión Usuarios</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logs-comisiones') }}">Log Comisiones</a>
|
||||
@if (auth()->user()->rol->nombre != 'super')
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('tarifas') }}">Gestión Tarifas</a>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Links para super / administrador / editor --}}
|
||||
@if (in_array(auth()->user()->rol->nombre, ['super', 'administrador', 'editor']))
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('planes') }}">Gestión Planes</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('import') }}">Importar cuentas</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('usuarios') }}">Gestión Usuarios</a>
|
||||
|
||||
</h4>
|
||||
<p class="absolute bg-[#f2f4ff] rounded-md @if (auth()->user()->rol->nombre == 'editor') -top-[400%] @elseif (auth()->user()->rol->nombre == 'administrador') -top-[200%] @elseif (auth()->user()->rol->nombre == 'super') -top-[300%] @elseif (auth()->user()->subvendedor) -top-3 @else -top-[800%] @endif -right-[20%] sm:-right-[55%]" x-show="selected == 0">
|
||||
@if (auth()->user()->subvendedor)
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('roles') }}">Gestión Roles</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('usuarios') }}">Gestión Usuarios</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logs-comisiones') }}">Log Comisiones</a>
|
||||
@if ( auth()->user()->rol->nombre != 'super')
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('tarifas') }}">Gestión Tarifas</a>
|
||||
@endif
|
||||
@if ( auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor')
|
||||
<a class="block cursor-pointer hover:rounded-t-md rounded-t-md text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('planes') }}">Gestión Planes</a>
|
||||
<a class="block cursor-pointer hover:rounded-b-md rounded-b-md text-center hover:bg-[#d1d3e1] w-full px-3 py-1" href="{{ route('import') }}">Importar cuentas</a>
|
||||
@if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
|
||||
<a class="block cursor-pointer hover:rounded-t-md rounded-t-md text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('pendientes') }}">Gestión Pendientes</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logGeneral') }}">Log general</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logs') }}">Log cuentas</a>
|
||||
@if (auth()->user()->rol->nombre == 'super')
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logHistorial') }}">Log historial</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logsRecargas') }}">Log recargas</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('promociones') }}">Gestión Promociones</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('servicio') }}">Gestión Servicios</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('categoria') }}">Gestión Categorias</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('utilidades') }}">Utilidades</a>
|
||||
<a class="block cursor-pointer hover:rounded-b-md rounded-b-md text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('configuracion') }}">Configuración</a>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
@if (in_array(auth()->user()->rol->nombre, ['super', 'administrador']))
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('pendientes') }}">Gestión Pendientes</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logGeneral') }}">Log general</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logs') }}">Log cuentas</a>
|
||||
|
||||
@if (auth()->user()->rol->nombre == 'super')
|
||||
{{-- Solo super --}}
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('tarifas') }}">Gestión Tarifas</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logHistorial') }}">Log historial</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logsRecargas') }}">Log recargas</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('promociones') }}">Gestión Promociones</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('servicio') }}">Gestión Servicios</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('categoria') }}">Gestión Categorias</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('utilidades') }}">Utilidades</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('configuracion') }}">Configuración</a>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
<div class="space-y-1 bg-[#FF5050] mx-4 m-auto rounded-xl mt-2 sm:mt-5 ">
|
||||
@@ -285,30 +290,30 @@
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
@if (!empty($config->catalogo))
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
||||
class="flex block pl-3 pr-4 py-3 text-base font-medium text-[#000029] transition duration-150 ease-in-out rounded-none">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
||||
class="flex block pl-3 pr-4 py-3 text-base font-medium text-[#000029] transition duration-150 ease-in-out rounded-none">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link class="rounded-none" :href="route('reportes')" :active="request()->routeIs('reportes')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1"
|
||||
viewBox="0 0 24 24" class="w-5 m-auto">
|
||||
<rect x="14" y="11" width="2" height="9" />
|
||||
<rect x="6" y="11" width="2" height="9" />
|
||||
<rect x="18" y="6" width="2" height="14" />
|
||||
<rect x="10" y="6" width="2" height="14" />
|
||||
</svg>
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link class="rounded-none" :href="route('reportes')" :active="request()->routeIs('reportes')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1"
|
||||
viewBox="0 0 24 24" class="w-5 m-auto">
|
||||
<rect x="14" y="11" width="2" height="9" />
|
||||
<rect x="6" y="11" width="2" height="9" />
|
||||
<rect x="18" y="6" width="2" height="14" />
|
||||
<rect x="10" y="6" width="2" height="14" />
|
||||
</svg>
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
<div>
|
||||
<div class=" text-center">
|
||||
<div class="flex w-11/12 align-middle">
|
||||
<input type="text" placeholder="Buscar" wire:model="buscar" class="mx-auto text-center rounded my-4">
|
||||
<label for="aprobado" class="my-1 align-middle px-1">Aprobados</label>
|
||||
<input type="checkbox" id="aprobado" wire:model="aprobado" class="my-1 align-middle px-1">
|
||||
</div>
|
||||
<div class=" text-center">
|
||||
<div class="flex w-11/12 align-middle">
|
||||
<input type="text" placeholder="Buscar" wire:model="buscar" class="mx-auto text-center rounded my-4">
|
||||
<label for="aprobado" class="my-1 align-middle px-1">Aprobados</label>
|
||||
<input type="checkbox" id="aprobado" wire:model="aprobado" class="my-1 align-middle px-1">
|
||||
</div>
|
||||
|
||||
<table class="text-center w-11/12 mx-auto">
|
||||
<tr class="border text-left">
|
||||
<th>Compra</th>
|
||||
<th>Usuario</th>
|
||||
<th>Email</th>
|
||||
<th>Valor pagado</th>
|
||||
<th>Estado</th>
|
||||
<th>Saldo</th>
|
||||
</tr>
|
||||
|
||||
<table class="text-center w-11/12 mx-auto">
|
||||
<tr class="border text-left">
|
||||
<th>Compra</th>
|
||||
<th>Usuario</th>
|
||||
<th>Email</th>
|
||||
<th>Valor pagado</th>
|
||||
<th>Estado</th>
|
||||
<th>Saldo</th>
|
||||
</tr>
|
||||
@foreach($historial_recargas as $item)
|
||||
|
||||
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm" >
|
||||
<td>{{\Carbon\Carbon::parse($item->created_at)->format('y/m/d h:i a')}}</td>
|
||||
<td>{{$item->usuario?->name ?? 'N/A'}}</td>
|
||||
<td>{{$item->usuario?->email ?? 'N/A'}}</td>
|
||||
<td>{{$item->monto ?? 'N/A'}}</td>
|
||||
<td>{{$item->status ?? 'N/A'}}</td>
|
||||
<td>{{$item->valor_recarga ?? 'N/A'}}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
<div class="mx-10">
|
||||
{{ $historial_recargas->links( )}}
|
||||
@foreach ($historial_recargas as $item)
|
||||
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm">
|
||||
<td>{{ \Carbon\Carbon::parse($item->created_at)->format('y/m/d h:i a') }}</td>
|
||||
<td>{{ $item->usuario?->name ?? 'N/A' }}</td>
|
||||
<td>{{ $item->usuario?->email ?? 'N/A' }}</td>
|
||||
<td>{{ $item->monto ?? 'N/A' }}</td>
|
||||
<td>{{ $item->status ?? 'N/A' }}</td>
|
||||
<td>{{ $item->valor_recarga ?? 'N/A' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
<div class="mx-10">
|
||||
{{ $historial_recargas->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -92,6 +92,23 @@
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Subvendedor --}}
|
||||
<div class="bg-white text-center rounded-xl py-4 px-8 shadow-md xl:mx-10 mb-8">
|
||||
<div class="flex items-center justify-center gap-2">
|
||||
<span class="text-gray-700">Subvendedores</span>
|
||||
<label class="relative inline-flex items-center cursor-pointer">
|
||||
<input wire:model="subvendedor" type="checkbox" value="" class="sr-only peer">
|
||||
<div class="w-11 h-6 bg-gray-200 rounded-full peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 peer-checked:bg-blue-600"></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{{-- Boton para guardar subvendedor --}}
|
||||
<div class="mt-4">
|
||||
<button wire:click="guardarSubvendedor"
|
||||
class="inline-flex justify-center 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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Slider --}}
|
||||
<div class="bg-white grid grid-cols-1 text-center rounded-xl py-4 px-8 shadow-md xl:mx-10 my-8">
|
||||
|
||||
@@ -626,10 +643,6 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="lg:col-span-1 mb-8 text-center">
|
||||
|
||||
<button wire:click="eliminarCache" class=" mx-auto inline-flex justify-center rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-red-500 hover:bg-red-700 focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Eliminar
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Roles
|
||||
</div>
|
||||
|
||||
@if (auth()->user()->subvendedor)
|
||||
@if (auth()->user()->subvendedor && $config->subvendedor)
|
||||
<a x-on:click="add = !add" class="flex items-center px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] transition">
|
||||
Añadir rol
|
||||
<svg class="w-[0.87rem] ml-2" fill="#ffffff" viewBox="0 0 512 512">
|
||||
@@ -41,9 +41,9 @@
|
||||
this.search = '';
|
||||
this.selectedId = null;
|
||||
}
|
||||
}"
|
||||
}"
|
||||
class="relative w-full max-w-md sm:max-w-xs">
|
||||
|
||||
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Buscar subvendedor</label>
|
||||
|
||||
<div class="relative">
|
||||
@@ -224,4 +224,4 @@
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ editarTarifaPromo: @entangle('editarTarifaPromo'),
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col md:flex-row items-center justify-center gap-6 md:gap-4">
|
||||
@if (auth()->user()->subvendedor)
|
||||
@if (auth()->user()->subvendedor && $config->subvendedor)
|
||||
<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]">
|
||||
Tarifas servicios
|
||||
<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">
|
||||
@@ -34,7 +34,7 @@ editarTarifaPromo: @entangle('editarTarifaPromo'),
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (auth()->user()->subvendedor)
|
||||
@if (auth()->user()->subvendedor && $config->subvendedor)
|
||||
<a x-on:click="modTarifasPromo = true" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">
|
||||
Tarifas promociones
|
||||
<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">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
Usuario
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
@if (auth()->user()->subvendedor || auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'editor' || auth()->user()->rol->nombre === 'super')
|
||||
@if ((auth()->user()->subvendedor && $config->subvendedor) || in_array(auth()->user()->rol->nombre, ['administrador', 'editor', 'super']))
|
||||
<a x-on:click="add = !add" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">Añadir
|
||||
usuario
|
||||
<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">
|
||||
@@ -35,7 +35,7 @@
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador')
|
||||
@if (in_array(auth()->user()->rol->nombre, ['super', '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]">Mod.
|
||||
tarifas promos
|
||||
<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">
|
||||
@@ -107,7 +107,7 @@
|
||||
@if (auth()->user()->rol->nombre == 'super')
|
||||
<button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
|
||||
@else
|
||||
@if (Auth::user()->subvendedor)
|
||||
@if (auth()->user()->subvendedor && $config->subvendedor)
|
||||
<button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
|
||||
@endif
|
||||
@endif
|
||||
@@ -131,7 +131,7 @@
|
||||
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
|
||||
</div>
|
||||
</td>
|
||||
@elseif (Auth::user()->subvendedor)
|
||||
@elseif (Auth::user()->subvendedor && $config->subvendedor)
|
||||
<td>
|
||||
<button x-on:click="openOption=!openOption">
|
||||
<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 cursor-pointer">
|
||||
@@ -660,7 +660,7 @@
|
||||
@if (auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'super')
|
||||
<button wire:click="addSaldo" 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>
|
||||
@else
|
||||
@if (Auth::user()->subvendedor)
|
||||
@if (auth()->user()->subvendedor && $config->subvendedor)
|
||||
<button wire:click="addSaldoSubvendedor" 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>
|
||||
@endif
|
||||
@endif
|
||||
@@ -905,4 +905,4 @@
|
||||
input.value = formattedValue;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user