From 2043acc81c34e4c1b8d7bcafc8be213dab64f591 Mon Sep 17 00:00:00 2001 From: Felipe Date: Tue, 30 Apr 2024 10:00:57 -0500 Subject: [PATCH] planes +30 dias --- app/Http/Livewire/ShowPlanes.php | 10 ++-- .../views/livewire/show-planes.blade.php | 54 +++++++------------ 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 3a08c6f..9d84006 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -204,8 +204,6 @@ class ShowPlanes extends Component } public function openRenovar() { - $this->renovar = true; - $id = $this->id_cuentaVer; $renovarCuenta = Cuentas::findOrFail($id); @@ -217,14 +215,16 @@ class ShowPlanes extends Component $this->fecha_final_renovar_old = $renovarCuenta->vencimiento; $this->fecha_final_renovar = $renovarCuenta->vencimiento; $this->estado = $renovarCuenta->estado; + + $this->renovar = true; } public function calcularFechas() { - $this->fecha_inicial_renovar = Carbon::now()->format('Y-m-d'); - $this->fecha_final_renovar = Carbon::now()->addDays(30)->format('Y-m-d'); + $this->fecha_final_renovar = Carbon::parse($this->fecha_final_renovar)->addDays(30)->format('Y-m-d'); } + public function getListeners() { return [ @@ -277,7 +277,7 @@ class ShowPlanes extends Component { $id = $this->id_cuentaVer; - $historial = Historial_cuenta::where('cuenta_id', $id)->first(); + $historial = Historial_cuenta::where('cuenta_id', $id)->get(); Historiale::where('id', $historial->historiale_id)->update([ 'fecha_final' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))), diff --git a/resources/views/livewire/show-planes.blade.php b/resources/views/livewire/show-planes.blade.php index 4ba392f..8f767eb 100755 --- a/resources/views/livewire/show-planes.blade.php +++ b/resources/views/livewire/show-planes.blade.php @@ -332,19 +332,17 @@ @endif -
Email:{{ $consulta_verUsuarios->correo ?? '' }} -
-
Password:{{ $consulta_verUsuarios->password ?? '' }} -
+
Email:{{ $consulta_verUsuarios->correo ?? '' }}
+
Password:{{ $consulta_verUsuarios->password ?? '' }}
@if ($consulta_verUsuarios) @if ($consulta_verUsuarios->estado == 'pendiente') @if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->completa) @if (Auth::user()->rol->nombre == 'super') - + @endif @endif @@ -352,18 +350,17 @@ @if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->pantallas) @if (Auth::user()->rol->nombre == 'super') - + @endif @endif @endif @endif -
@@ -371,11 +368,9 @@
- +
- @@ -391,21 +386,18 @@
- +
- +
- @@ -420,28 +412,22 @@
- - + +
- - + +
- + - +