planes +30 dias
This commit is contained in:
@@ -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))),
|
||||
|
||||
@@ -332,19 +332,17 @@
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
<div><span class="font-semibold text-gray-700">Email:</span>{{ $consulta_verUsuarios->correo ?? '' }}
|
||||
</div>
|
||||
<div><span class="font-semibold text-gray-700">Password:</span>{{ $consulta_verUsuarios->password ?? '' }}
|
||||
</div>
|
||||
<div><span class="font-semibold text-gray-700">Email:</span>{{ $consulta_verUsuarios->correo ?? '' }}</div>
|
||||
<div><span class="font-semibold text-gray-700">Password:</span>{{ $consulta_verUsuarios->password ?? '' }}</div>
|
||||
<div class="flex justify-end">
|
||||
@if ($consulta_verUsuarios)
|
||||
@if ($consulta_verUsuarios->estado == 'pendiente')
|
||||
@if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->completa)
|
||||
@if (Auth::user()->rol->nombre == 'super')
|
||||
<span class="mr-4">
|
||||
<button wire:click="openAdd" 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 ">Añadir
|
||||
usuario</button>
|
||||
<button wire:click="openAdd" 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 ">
|
||||
Añadir usuario
|
||||
</button>
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
@@ -352,18 +350,17 @@
|
||||
@if (count($consulta_verUsuarios->historiales) != $consulta_verUsuarios->servicio->pantallas)
|
||||
@if (Auth::user()->rol->nombre == 'super')
|
||||
<span class="mr-4">
|
||||
<button wire:click="openAdd" 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 ">Añadir
|
||||
usuario</button>
|
||||
<button wire:click="openAdd" 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 ">
|
||||
Añadir usuario
|
||||
</button>
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
<span>
|
||||
<button wire:click="openRenovar" 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 ">Editar
|
||||
cuenta
|
||||
<button wire:click="openRenovar" 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 ">
|
||||
Editar cuenta
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -371,11 +368,9 @@
|
||||
|
||||
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
|
||||
<span>
|
||||
<button x-on:click="ver=false" wire:click="" type="button"
|
||||
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
||||
<button x-on:click="ver=false" wire:click="" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -391,21 +386,18 @@
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="usuario_renovar" class="block text-gray-700 text-sm font-bold mb-2">Usuario:</label>
|
||||
<input type="email" id="usuario_nrenovar" wire:model="usuario_renovar"
|
||||
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
<input type="email" id="usuario_nrenovar" wire:model="usuario_renovar" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="password_renovar"
|
||||
class="block text-gray-700 text-sm font-bold mb-2">Contraseña:</label>
|
||||
<input type="text" id="password_renovar" wire:model="password_renovar"
|
||||
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
<input type="text" id="password_renovar" wire:model="password_renovar" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="disponible" class="block text-gray-700 text-sm font-bold mb-2">Disponibilidad:</label>
|
||||
<select name="" id="" wire:model="estado"
|
||||
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
<select name="" id="" wire:model="estado" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
|
||||
<option value="activo">Pantallas</option>
|
||||
<option value="pendiente">Cuenta completa</option>
|
||||
<option value="inactivo">Inactivo</option>
|
||||
@@ -420,28 +412,22 @@
|
||||
|
||||
<div date-rangepicker class="flex items-center gap-2 mb-4">
|
||||
<div class="relative">
|
||||
<label for="fecha_inicial_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha
|
||||
inicio:</label>
|
||||
<input name="fecha_inicial_renovar" wire:model.defer="fecha_inicial_renovar" type="date"
|
||||
class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
||||
<label for="fecha_inicial_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha inicio:</label>
|
||||
<input name="fecha_inicial_renovar" wire:model.defer="fecha_inicial_renovar" type="date" class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
||||
</div>
|
||||
|
||||
<div class="relative">
|
||||
<label for="fecha_final_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha
|
||||
Final:</label>
|
||||
<input name="fecha_final_renovar" wire:model.defer="fecha_final_renovar" type="date"
|
||||
class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
||||
<label for="fecha_final_renovar" class="block text-gray-700 text-sm font-bold mb-2">Fecha Final:</label>
|
||||
<input name="fecha_final_renovar" wire:model.defer="fecha_final_renovar" type="date" class="border-2 border-neutral-200 rounded-[0.8rem] px-4 py-2 text-gray-900 sm:text-sm focus:border-neutral-300 focus:outline-none focus:shadow-outline focus:ring-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 datepicker-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
|
||||
<span>
|
||||
<button wire:click="saveRenovar()" 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="saveRenovar()" 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>
|
||||
</span>
|
||||
<span>
|
||||
<button x-on:click="renovar=false" wire:click="" type="button"
|
||||
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
||||
<button x-on:click="renovar=false" wire:click="" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user