update global subvendedor
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Livewire;
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
|
use App\Models\Configuracione;
|
||||||
use App\Models\Role;
|
use App\Models\Role;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
@@ -22,7 +23,6 @@ class ShowRoles extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
if (auth()->user()->rol_id == 5) {
|
if (auth()->user()->rol_id == 5) {
|
||||||
|
|
||||||
$query = Role::withCount('usuarios');
|
$query = Role::withCount('usuarios');
|
||||||
if ($this->filtro_id) {
|
if ($this->filtro_id) {
|
||||||
$query->where('subvendedor_id', $this->filtro_id);
|
$query->where('subvendedor_id', $this->filtro_id);
|
||||||
@@ -37,7 +37,8 @@ class ShowRoles extends Component
|
|||||||
|
|
||||||
return view('livewire.show-roles', [
|
return view('livewire.show-roles', [
|
||||||
'roles' => $consulta_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;
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
|
use App\Models\Configuracione;
|
||||||
use App\Models\Promociones;
|
use App\Models\Promociones;
|
||||||
use App\Models\Role;
|
use App\Models\Role;
|
||||||
use App\Models\Servicio;
|
use App\Models\Servicio;
|
||||||
@@ -62,6 +63,7 @@ class ShowTarifas extends Component
|
|||||||
'roles' => Role::where('subvendedor_id', auth()->user()->id)->get(),
|
'roles' => Role::where('subvendedor_id', auth()->user()->id)->get(),
|
||||||
'promo' => Promociones::where('visible', 'true')->get(),
|
'promo' => Promociones::where('visible', 'true')->get(),
|
||||||
'servicios' => Servicio::where('estado', 'activo')->get(),
|
'servicios' => Servicio::where('estado', 'activo')->get(),
|
||||||
|
'config' => Configuracione::with('usuario')->orderby('id', 'desc')->first(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Livewire;
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
|
use App\Models\Configuracione;
|
||||||
use App\Models\Historiale;
|
use App\Models\Historiale;
|
||||||
use App\Models\Log_general;
|
use App\Models\Log_general;
|
||||||
use App\Models\Promociones;
|
use App\Models\Promociones;
|
||||||
@@ -167,6 +168,7 @@ class ShowUsuarios extends Component
|
|||||||
'usuarios' => $consulta_usuarios,
|
'usuarios' => $consulta_usuarios,
|
||||||
'tarifas' => $consulta_tarifas,
|
'tarifas' => $consulta_tarifas,
|
||||||
'promo' => Promociones::where('visible', 'true')->get(),
|
'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 }">
|
<div class="sm:block h-full" x-data="{ menuG: false }">
|
||||||
|
|
||||||
@php
|
@php
|
||||||
$config = \App\Models\Configuracione::orderby('id', 'desc')->first();
|
$config = \App\Models\Configuracione::orderby('id', 'desc')->first();
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div x-cloak x-show="menuG"
|
<div x-cloak x-show="menuG"
|
||||||
@@ -74,82 +74,87 @@
|
|||||||
</x-responsive-nav-link>
|
</x-responsive-nav-link>
|
||||||
</div>
|
</div>
|
||||||
@if (!empty($config->catalogo))
|
@if (!empty($config->catalogo))
|
||||||
<div class="space-y-1 border-b border-gray-100">
|
<div class="space-y-1 border-b border-gray-100">
|
||||||
<div
|
<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">
|
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) }}"
|
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
||||||
class="flex items-center justify-between">
|
class="flex items-center justify-between">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
<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">
|
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round"
|
<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" />
|
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>
|
</svg>
|
||||||
|
|
||||||
Descargar Catalogo
|
Descargar Catalogo
|
||||||
</a>
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<x-responsive-nav-link :href="route('reportes')" :active="request()->routeIs('reportes')">
|
<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"
|
<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">
|
class="w-5 mx-3">
|
||||||
<rect x="14" y="11" width="2" height="9" />
|
<rect x="14" y="11" width="2" height="9" />
|
||||||
<rect x="6" 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="18" y="6" width="2" height="14" />
|
||||||
<rect x="10" y="6" width="2" height="14" />
|
<rect x="10" y="6" width="2" height="14" />
|
||||||
</svg>
|
</svg>
|
||||||
{{ __('Reportes') }}
|
{{ __('Reportes') }}
|
||||||
</x-responsive-nav-link>
|
</x-responsive-nav-link>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</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
|
@if ((auth()->user()->subvendedor && $config->subvendedor) || in_array(auth()->user()->rol->nombre, ['super', 'administrador', 'editor']))
|
||||||
@else
|
<ul class="relative shadow-md block w-11/12 mx-auto select-none " x-data="{ selected: null }">
|
||||||
Subvendedor
|
<li class="flex align-center flex-col">
|
||||||
@endif
|
<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>
|
@if (in_array(auth()->user()->rol->nombre, ['super', 'administrador']))
|
||||||
<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">
|
<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>
|
||||||
@if (auth()->user()->subvendedor)
|
<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('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('logs') }}">Log 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>
|
|
||||||
<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')
|
||||||
@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('tarifas') }}">Gestión Tarifas</a>
|
||||||
@endif
|
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logHistorial') }}">Log historial</a>
|
||||||
@if ( auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor')
|
<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 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 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 hover:rounded-b-md rounded-b-md text-center hover:bg-[#d1d3e1] 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('servicio') }}">Gestión Servicios</a>
|
||||||
@if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
|
<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 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('utilidades') }}">Utilidades</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('configuracion') }}">Configuración</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>
|
@endif
|
||||||
@if (auth()->user()->rol->nombre == 'super')
|
@endif
|
||||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logHistorial') }}">Log historial</a>
|
@endif
|
||||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logsRecargas') }}">Log recargas</a>
|
</p>
|
||||||
<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>
|
</li>
|
||||||
<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>
|
</ul>
|
||||||
<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>
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="space-y-1 bg-[#FF5050] mx-4 m-auto rounded-xl mt-2 sm:mt-5 ">
|
<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>
|
</x-responsive-nav-link>
|
||||||
</div>
|
</div>
|
||||||
@if (!empty($config->catalogo))
|
@if (!empty($config->catalogo))
|
||||||
<div class="space-y-1 border-b border-gray-100">
|
<div class="space-y-1 border-b border-gray-100">
|
||||||
<a href="{{ asset($config->catalogo) }}" download="{{ basename($config->catalogo) }}"
|
<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">
|
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"
|
<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">
|
stroke-width="1.5" stroke="currentColor" class="w-5 mx-3">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round"
|
<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" />
|
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>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
@if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador')
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<x-responsive-nav-link class="rounded-none" :href="route('reportes')" :active="request()->routeIs('reportes')">
|
<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"
|
<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">
|
viewBox="0 0 24 24" class="w-5 m-auto">
|
||||||
<rect x="14" y="11" width="2" height="9" />
|
<rect x="14" y="11" width="2" height="9" />
|
||||||
<rect x="6" 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="18" y="6" width="2" height="14" />
|
||||||
<rect x="10" y="6" width="2" height="14" />
|
<rect x="10" y="6" width="2" height="14" />
|
||||||
</svg>
|
</svg>
|
||||||
</x-responsive-nav-link>
|
</x-responsive-nav-link>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,34 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class=" text-center">
|
<div class=" text-center">
|
||||||
<div class="flex w-11/12 align-middle">
|
<div class="flex w-11/12 align-middle">
|
||||||
<input type="text" placeholder="Buscar" wire:model="buscar" class="mx-auto text-center rounded my-4">
|
<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>
|
<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">
|
<input type="checkbox" id="aprobado" wire:model="aprobado" class="my-1 align-middle px-1">
|
||||||
</div>
|
</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">
|
@foreach ($historial_recargas as $item)
|
||||||
<tr class="border text-left">
|
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm">
|
||||||
<th>Compra</th>
|
<td>{{ \Carbon\Carbon::parse($item->created_at)->format('y/m/d h:i a') }}</td>
|
||||||
<th>Usuario</th>
|
<td>{{ $item->usuario?->name ?? 'N/A' }}</td>
|
||||||
<th>Email</th>
|
<td>{{ $item->usuario?->email ?? 'N/A' }}</td>
|
||||||
<th>Valor pagado</th>
|
<td>{{ $item->monto ?? 'N/A' }}</td>
|
||||||
<th>Estado</th>
|
<td>{{ $item->status ?? 'N/A' }}</td>
|
||||||
<th>Saldo</th>
|
<td>{{ $item->valor_recarga ?? 'N/A' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@foreach($historial_recargas as $item)
|
@endforeach
|
||||||
|
</table>
|
||||||
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm" >
|
<div class="mx-10">
|
||||||
<td>{{\Carbon\Carbon::parse($item->created_at)->format('y/m/d h:i a')}}</td>
|
{{ $historial_recargas->links() }}
|
||||||
<td>{{$item->usuario?->name ?? 'N/A'}}</td>
|
</div>
|
||||||
<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>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -92,6 +92,23 @@
|
|||||||
|
|
||||||
</div>
|
</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 --}}
|
{{-- Slider --}}
|
||||||
<div class="bg-white grid grid-cols-1 text-center rounded-xl py-4 px-8 shadow-md xl:mx-10 my-8">
|
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="lg:col-span-1 mb-8 text-center">
|
<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
|
<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
|
Roles
|
||||||
</div>
|
</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 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
|
Añadir rol
|
||||||
<svg class="w-[0.87rem] ml-2" fill="#ffffff" viewBox="0 0 512 512">
|
<svg class="w-[0.87rem] ml-2" fill="#ffffff" viewBox="0 0 512 512">
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
this.search = '';
|
this.search = '';
|
||||||
this.selectedId = null;
|
this.selectedId = null;
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
class="relative w-full max-w-md sm:max-w-xs">
|
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>
|
<label class="block text-sm font-medium text-gray-700 mb-1">Buscar subvendedor</label>
|
||||||
|
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
@@ -224,4 +224,4 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ editarTarifaPromo: @entangle('editarTarifaPromo'),
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col md:flex-row items-center justify-center gap-6 md:gap-4">
|
<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]">
|
<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
|
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">
|
<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>
|
</a>
|
||||||
@endif
|
@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]">
|
<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
|
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">
|
<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
|
Usuario
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-4">
|
<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
|
<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
|
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">
|
<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>
|
</a>
|
||||||
@endif
|
@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.
|
<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
|
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">
|
<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')
|
@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>
|
<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
|
@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>
|
<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
|
||||||
@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>
|
<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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@elseif (Auth::user()->subvendedor)
|
@elseif (Auth::user()->subvendedor && $config->subvendedor)
|
||||||
<td>
|
<td>
|
||||||
<button x-on:click="openOption=!openOption">
|
<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">
|
<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')
|
@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>
|
<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
|
@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>
|
<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
|
||||||
@endif
|
@endif
|
||||||
@@ -905,4 +905,4 @@
|
|||||||
input.value = formattedValue;
|
input.value = formattedValue;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user