From 55f95f2e177ccf2124a1a82fe75d12ef22649d88 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 12 Jul 2024 10:53:59 -0500 Subject: [PATCH] botones de color --- app/Http/Livewire/ShowConfiguracion.php | 5 +++++ app/Http/Livewire/ShowPlanes.php | 8 ++++++-- app/Http/Livewire/ShowPromociones.php | 12 +++++++++++- app/Http/Livewire/ShowRoles.php | 13 +++++++++---- app/Http/Livewire/ShowServicio.php | 7 ++++++- app/Http/Livewire/ShowTop.php | 10 ++++++---- app/Http/Livewire/ShowUsuarios.php | 5 +++++ 7 files changed, 48 insertions(+), 12 deletions(-) diff --git a/app/Http/Livewire/ShowConfiguracion.php b/app/Http/Livewire/ShowConfiguracion.php index f901ba5..f3460e1 100755 --- a/app/Http/Livewire/ShowConfiguracion.php +++ b/app/Http/Livewire/ShowConfiguracion.php @@ -296,6 +296,11 @@ class ShowConfiguracion extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); } diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 52f5645..8cc2eaa 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -129,7 +129,7 @@ class ShowPlanes extends Component if (empty($this->fecha_inicial)) { $this->fecha_inicial = Carbon::now()->toDateTimeString(); - $this->fecha_final = Carbon::now()->addDay(30)->toDateTimeString(); + $this->fecha_final = Carbon::now()->addDay(30)->toDateTimeString(); } if ($this->servicio_modTarifas) { $this->tarifas = Tarifas::with('rol') @@ -224,7 +224,7 @@ class ShowPlanes extends Component { $this->fecha_inicial_renovar = now()->format('Y-m-d H:i:s'); $this->fecha_final_renovar = now()->addDays(30)->format('Y-m-d H:i:s'); - + } @@ -251,6 +251,10 @@ class ShowPlanes extends Component 'showConfirmButton' => true, 'onConfirmed' => 'siRenovar', 'confirmButtonText' => 'Si, liberar cuenta', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + ] ]); } else { $cuenta_renovar = Cuentas::find($this->id_cuentaVer); diff --git a/app/Http/Livewire/ShowPromociones.php b/app/Http/Livewire/ShowPromociones.php index 72d351d..94b0886 100755 --- a/app/Http/Livewire/ShowPromociones.php +++ b/app/Http/Livewire/ShowPromociones.php @@ -345,6 +345,11 @@ class ShowPromociones extends Component // 'cancelButtonText' => 'No, abandonar.', 'denyButtonText' => 'No, abandonar.', 'confirmButtonText' => 'Sí, comprar.', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); } } else { @@ -371,7 +376,7 @@ class ShowPromociones extends Component ]); } } - } + } public function confirmarCompra() { @@ -645,6 +650,11 @@ class ShowPromociones extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); } diff --git a/app/Http/Livewire/ShowRoles.php b/app/Http/Livewire/ShowRoles.php index dc59191..4ecdd82 100755 --- a/app/Http/Livewire/ShowRoles.php +++ b/app/Http/Livewire/ShowRoles.php @@ -15,8 +15,8 @@ class ShowRoles extends Component public function render() { - - + + $consulta_roles = Role::withCount('usuarios')->get(); //dd($consulta_roles); return view('livewire.show-roles',['roles'=>$consulta_roles]); @@ -33,7 +33,7 @@ class ShowRoles extends Component $crear_rol = new Role; $crear_rol->nombre = $this->nombre; $crear_rol->save(); - + $this->alert('success', 'Rol creado correctamente!', [ 'position' => 'top' ]); @@ -43,7 +43,7 @@ class ShowRoles extends Component 'position' => 'top' ]); } - + } public function eliminar($id) @@ -62,6 +62,11 @@ class ShowRoles extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); } diff --git a/app/Http/Livewire/ShowServicio.php b/app/Http/Livewire/ShowServicio.php index 4baf761..dde9e81 100755 --- a/app/Http/Livewire/ShowServicio.php +++ b/app/Http/Livewire/ShowServicio.php @@ -237,6 +237,11 @@ class ShowServicio extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); } @@ -267,4 +272,4 @@ class ShowServicio extends Component $this->renovacion = null; $this->servicio = null; } -} \ No newline at end of file +} diff --git a/app/Http/Livewire/ShowTop.php b/app/Http/Livewire/ShowTop.php index a3d931a..3a3e69b 100755 --- a/app/Http/Livewire/ShowTop.php +++ b/app/Http/Livewire/ShowTop.php @@ -30,10 +30,11 @@ class ShowTop extends Component $query->whereMonth('fecha_inicio', $month) ->whereYear('fecha_inicio', $currentYear) ->where('estado', 'activo'); - }]) + }]) ->withCount(['historiales_venta' => function ($query) use ($month, $currentYear) { $query->whereMonth('fecha_inicio', $month) - ->whereYear('fecha_inicio', $currentYear); + ->whereYear('fecha_inicio', $currentYear) + ->where('estado', 'activo'); }]) ->orderBy('historiales_venta_count', 'desc') ->limit(10) @@ -63,10 +64,11 @@ class ShowTop extends Component $query->whereMonth('fecha_inicio', $month) ->whereYear('fecha_inicio', $currentYear) ->where('estado', 'activo'); - }]) + }]) ->withCount(['historiales_venta' => function ($query) use ($month, $currentYear) { $query->whereMonth('fecha_inicio', $month) - ->whereYear('fecha_inicio', $currentYear); + ->whereYear('fecha_inicio', $currentYear) + ->where('estado', 'activo'); }]) ->orderBy('historiales_venta_count', 'desc') ->limit(10) diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index d702441..b51ad98 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -508,6 +508,11 @@ class ShowUsuarios extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', + 'customClass' => [ + 'confirmButton' => 'bg-green-500', + 'denyButton' => 'bg-red-500', + 'cancelButton' => 'bg-gray-500', + ] ]); }