diff --git a/.env b/.env index 4638f5d..290b041 100644 --- a/.env +++ b/.env @@ -9,7 +9,7 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=31.220.16.2 +DB_HOST=82.180.168.2 DB_PORT=3306 DB_DATABASE=u111286300_sir DB_USERNAME=u111286300_sir diff --git a/app/Http/Livewire/ShowIndexServicio.php b/app/Http/Livewire/ShowIndexServicio.php index 7e78efc..5877869 100644 --- a/app/Http/Livewire/ShowIndexServicio.php +++ b/app/Http/Livewire/ShowIndexServicio.php @@ -54,11 +54,11 @@ class ShowIndexServicio extends Component $this->fecha= $date->format('Y-m-d'); if (!empty($this->tarifa_id)) { - + + + $tarifas = Tarifas::with('servicio')->where('id', $this->tarifa_id)->first(); $this->fecha_final_1 = $today = Carbon::now()->addDays($tarifas->dias-15); $this->fecha_final_2 = $today = Carbon::now()->addDays($tarifas->dias+15); - - $tarifas = Tarifas::with('servicio')->where('id', $this->tarifa_id)->first(); $cuentas_creadas = Cuentas::whereDate('inicio','>=',$this->fecha)->where('servicio_id',$this->servicio_id)->where('estado','activo')->get(); $cuentas_tomadas = Historial_cuenta::whereIn('cuenta_id', $cuentas_creadas->pluck('id'))->count(); diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index a2ab656..97e3c0d 100644 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -274,7 +274,7 @@ class ShowServicios extends Component if ((int) $pantalla_servicio >= (int) $cantidad_solicitada && (int) $pantalla_servicio_completa != (int) $this->pantallas_tarjetaPlan) { $suma = $pantalla_servicio - $cantidad_solicitada; - $cantidad_necesaria = 1; + $cantidad_necesaria = $this->cantidad_tarjetaPlan; $cuenta = Cuentas::where('servicio_id', $this->servicio_id)->whereDate('inicio', '>=', $this->fecha)->Orderby('created_at', 'ASC')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', $suma)->get(); } elseif ((int) $pantalla_servicio_completa == (int) $this->pantallas_tarjetaPlan) { @@ -292,10 +292,11 @@ class ShowServicios extends Component $cuenta = null; $cantidad_necesaria = null; } - + //dd($cuenta, $cantidad_necesaria); for ($h = 0; $h < (int) $cantidad_necesaria; $h++) { - + //dd($h); if (!empty($cuenta)) { + $perfil = $cuenta[$h]->historiales_count; for ($y = 0; $y < (int) $pantallas; $y++) { @@ -315,6 +316,7 @@ class ShowServicios extends Component } } + //dd($historial->cuentas); $descuento = Saldo::where('usuario_id', Auth::user()->id)->first(); $saldo_anterior = $descuento->valor; @@ -323,6 +325,7 @@ class ShowServicios extends Component $cobro = $descuento->update(['valor' => $nuevo_saldo]); if ($cobro) { $historial->update(['estado' => 'activo']); + $this->credenciales($historial); } else { $this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [ diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index f631308..b69c1da 100644 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -77,6 +77,7 @@ class ShowUsuarios extends Component public $precio_modTarifas = 0; public $consulta_saldo; public $modTarifas; + public $modalSaldoDesc; @@ -173,6 +174,23 @@ class ShowUsuarios extends Component $this->saldo_actual = $this->consulta_saldo->valor; $this->modalSaldo = true; + } + public function saldodesc($user_saldo) + { + $this->user_saldo = $user_saldo; + $this->consulta_saldo = Saldo::where('usuario_id', $this->user_saldo)->first(); + + if (is_null($this->consulta_saldo)) { + $saldo = new Saldo; + $saldo->valor = 0; + $saldo->usuario_id = $this->user_saldo; + $saldo->save(); + $this->consulta_saldo = $saldo; + } + + $this->saldo_actual = $this->consulta_saldo->valor; + $this->modalSaldoDesc = true; + } public function addSaldo() @@ -200,6 +218,31 @@ class ShowUsuarios extends Component } + public function descontar() + { + $recarga = new recarga; + $recarga->payment_method_id = 'manual'; + $recarga->status = 'Descuento'; + $recarga->usuario_id = $this->user_saldo; + $recarga->saldo_id = $this->consulta_saldo->id; + $recarga->monto = $this->valor_recargar; + $recarga->valor_recarga = $this->valor_recargar; + $recarga->save(); + + + $this->consulta_saldo->update([ + 'valor' => $this->saldo_actual - $this->valor_recargar + ]); + + $this->alert('success', 'Saldo actualizado con exito!', [ + 'position' => 'top' + ]); + + + $this->limpiarSaldo(); + + } + public function editar($id) { $this->id_edit = $id; @@ -455,6 +498,7 @@ $usuarioEliminado = User::where('name', 'usuarioEliminado')->value('id'); { $this->valor_recargar = null; $this->modalSaldo = false; + $this->modalSaldoDesc = false; } /* ------------- ACTUALIZAR ------------- */ diff --git a/public/photos/I8y14wajBG.webp b/public/photos/I8y14wajBG.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/public/photos/I8y14wajBG.webp differ diff --git a/public/photos/KLJIjZiBK5.webp b/public/photos/KLJIjZiBK5.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/public/photos/KLJIjZiBK5.webp differ diff --git a/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg b/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg new file mode 100644 index 0000000..7dc6f98 Binary files /dev/null and b/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg differ diff --git a/public/photos/gKVoc6IFjX.webp b/public/photos/gKVoc6IFjX.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/public/photos/gKVoc6IFjX.webp differ diff --git a/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg b/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg new file mode 100644 index 0000000..443088c Binary files /dev/null and b/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg differ diff --git a/public/photos/kyMjdozMZe.webp b/public/photos/kyMjdozMZe.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/public/photos/kyMjdozMZe.webp differ diff --git a/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png b/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png new file mode 100644 index 0000000..661ad7b Binary files /dev/null and b/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png differ diff --git a/resources/views/livewire/show-index-categoria.blade.php b/resources/views/livewire/show-index-categoria.blade.php index ac228e2..8f356e5 100644 --- a/resources/views/livewire/show-index-categoria.blade.php +++ b/resources/views/livewire/show-index-categoria.blade.php @@ -1,132 +1,132 @@ -
-
- - - -
-
- -
-
-

Seleccione una categoria:

-
- -
-
- - @foreach ($categorias as $categoria1) - - @endforeach -
-
- - imagen de {{ $categoria1->nombre }} - -
-
-
- - -
- +
+ +
-
- @if ($categorian) -
-
-

Seleccione una promocion:

-
- -
- - @foreach ($categorias->where('nombre', $categorian)->first()->promociones as $promocion) - @if ($promocion->visible == 'true') - -
- - - -
- - @endif - @endforeach -
+
+
+

Seleccione una categoria:

- @endif -
- -
- - {{-- Modal ver promociones --}} -
-
- -
- - - @foreach ($categorias as $categoria1) - -
- +
+
+ + @foreach ($categorias as $categoria1) + + @endforeach +
+
+ + alt="imagen de {{ $categoria1->nombre }}"> + +
+
+
+ + +
+ +
+ +
+ @if ($categorian) +
+
+

Seleccione una promocion:

+
+ +
+ + @foreach ($categorias->where('nombre', $categorian)->first()->promociones as $promocion) + @if ($promocion->visible == 'true') + +
+ + + +
+ + @endif + @endforeach +
+
+ @endif +
+ + +
+ + {{-- Modal ver promociones --}} +
+
+ +
+ + + @foreach ($categorias as $categoria1) + +
- -
- - @endforeach - - - - + + + +
+ + @endforeach + + + + +
+ + +
- - - -
diff --git a/resources/views/livewire/show-planes.blade.php b/resources/views/livewire/show-planes.blade.php index a238ddd..c82909e 100644 --- a/resources/views/livewire/show-planes.blade.php +++ b/resources/views/livewire/show-planes.blade.php @@ -161,8 +161,9 @@ $n++; $historiales=false; - if(now()->gt($cuenta->vencimiento)){ - $historiales = $cuenta->historiales()->where('fecha_final', '>=', now()->toDateString())->count(); + if(now()->addDay()->gt($cuenta->vencimiento)){ + $historiales = $cuenta->historiales()->where('fecha_final', '>', now()->addDay()->toDateString())->count(); + //var_dump(now()->toDateString(), $historiales); } @endphp diff --git a/resources/views/livewire/show-servicios.blade.php b/resources/views/livewire/show-servicios.blade.php index b048e2d..c97f855 100644 --- a/resources/views/livewire/show-servicios.blade.php +++ b/resources/views/livewire/show-servicios.blade.php @@ -276,7 +276,7 @@
- + {{ $disponibles < 0 ? 0 : (int) $disponibles }} {{ $disponibles == 1 ? 'plan disponible' : 'planes disponibles' }} para esta cantidad
@@ -391,7 +391,7 @@ @php $n = 0; @endphp - + {{ dd($cuentas->cuentas) }} @foreach ($cuentas->cuentas->unique() as $cuenta) @php $n++; @@ -403,8 +403,8 @@ - URL: {{ $cuenta->servicio->url }} @else - @foreach ($cuenta->perfil as $perfil) - @if (!empty($cuenta->servicio->ver_perfiles)) + @if (!empty($cuenta->servicio->ver_perfiles)) + @foreach ($cuenta->perfil as $perfil) @if ($cuentas->id == $perfil->historial_id && $cuenta->estado == 'activo') - Perfil {{ $perfil->perfil }} @@ -445,8 +445,8 @@ @endswitch @endif @endif - @endif - @endforeach + @endforeach + @endif @endif

@@ -525,8 +525,8 @@ @if (!empty($cuenta->servicio->ver_url)) *URL:* {{ $cuenta->servicio->url }} @else -@foreach ($cuenta->perfil as $perfil) @if (!empty($cuenta->servicio->ver_perfiles)) +@foreach ($cuenta->perfil as $perfil) @if ($cuentas->id == $perfil->historial_id && $cuenta->estado == 'activo') *Perfil {{ $perfil->perfil }}* @if (!empty($cuenta->servicio->perfiles)) @switch($perfil->perfil) @@ -558,9 +558,9 @@ @endswitch @endif @endif -@endif @endforeach @endif +@endif *Usuario:* {{ trim($cuenta->correo) }} *Contraseña:* {{ trim($cuenta->password) }} diff --git a/resources/views/livewire/show-usuarios.blade.php b/resources/views/livewire/show-usuarios.blade.php index e507579..a6e6393 100644 --- a/resources/views/livewire/show-usuarios.blade.php +++ b/resources/views/livewire/show-usuarios.blade.php @@ -1,15 +1,18 @@ -
-
+
+
- +

Cargando

@@ -63,7 +66,8 @@ modTarifas: @entangle('modTarifas'), {{-- Buscar --}}
- +
{{-- -Tabla usuarios - --}} @@ -82,49 +86,59 @@ modTarifas: @entangle('modTarifas'), @foreach ($usuarios as $usuario) - @if($usuario->name == 'usuarioEliminado') - @else - - - {{ $usuario->name ?? '' }} + @if ($usuario->name == 'usuarioEliminado') + @else + + {{ $usuario->name ?? '' }} - {{ $usuario->email ?? '' }} + {{ $usuario->email ?? '' }} - {{ $usuario->rol->nombre ?? '' }} + {{ $usuario->rol->nombre ?? '' }} - {{ $usuario->historiales_venta_count ?? '' }} + {{ $usuario->historiales_venta_count ?? '' }} - {{ $usuario->saldo->valor ?? '' }} - + {{ $usuario->saldo->valor ?? '' }} + + - - - -
- - - - - - -
- - + + + +
+ + + + + + + +
+ + @endif @endforeach @@ -134,42 +148,54 @@ modTarifas: @entangle('modTarifas'), {{-- Gestionar precios --}}
+ x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100" + x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100" + x-transition:leave-end="opacity-0 scale-100" + class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
-

Personalización de precios para {{$usuario_nombre}}

+

Personalización de precios para {{ $usuario_nombre }}

- +
-
- +
@@ -181,7 +207,8 @@ modTarifas: @entangle('modTarifas'),
- +
@@ -194,32 +221,53 @@ modTarifas: @entangle('modTarifas'), @if (!empty($consulta_usuarioTarifas)) @foreach ($consulta_usuarioTarifas as $usuarioTarifa) - - - - + + + + @if ($usuarioTarifa->visible != 'true') + @else - {{ $usuarioTarifa->tarifa->pantallas ?? '' }} {{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} - {{ $usuarioTarifa->tarifa->dias ?? '' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} - + @endif - - - @if ($usuarioTarifa->visible != 'true') - - @else - - @endif - - - - + + + + @endforeach @endif @@ -234,101 +282,125 @@ modTarifas: @entangle('modTarifas'), - + - {{-- Gestionar promocion --}} -
-
-
-

Personalización de precios para {{$usuario_nombre}}

- -
- -
- -
-
-
- +
+ +
+
+
+ -
-
- -
-
- - -
-
- -
-
- - - -
- -
Servicio
{{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }} - @if($usuarioTarifa->tarifa->servicio->por_tiempo) - {{ $usuarioTarifa->tarifa->dias ?? '' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} +
{{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }} + + @if ($usuarioTarifa->tarifa->servicio->por_tiempo) + {{ $usuarioTarifa->tarifa->dias ?? '' }} + {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} + @else + {{ $usuarioTarifa->tarifa->pantallas ?? '' }} + {{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} + - {{ $usuarioTarifa->tarifa->dias ?? '' }} + {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} + @endif + ${{ $usuarioTarifa->precio ?? '' }} - - -
${{ $usuarioTarifa->precio ?? '' }} + + + + + + + + + + +
- - - - - - - - - + + +
+ +
+
+ + +
+ - @if (!empty($consulta_usuarioPromo)) - @foreach ($consulta_usuarioPromo as $usuarioPromo) - - - - @if ($usuarioPromo->visible != 'true') - - @else - - @endif - - - - - - @endforeach - @endif + +
+ + + +
- -
PromocionOcultoPrecio
{{ $usuarioPromo->promocion->nombre ?? '' }}${{ $usuarioPromo->precio ?? '' }} - - -
- - -
- - - -
-
-
-
+ + + + + + + + + + + + @if (!empty($consulta_usuarioPromo)) + @foreach ($consulta_usuarioPromo as $usuarioPromo) + + + + @if ($usuarioPromo->visible != 'true') + + @else + + @endif + + + + + + @endforeach + @endif + + +
PromocionOcultoPrecio
{{ $usuarioPromo->promocion->nombre ?? '' }}${{ $usuarioPromo->precio ?? '' }} + + + + + + + + + + +
+ + +
+ + + +
+
+
+
{{-- Añadir usuario --}}
- + - @error('nombre') Requerido* @enderror -
+ @error('nombre') + Requerido* + @enderror +
- + - @error('email') Requerido* @enderror -
+ @error('email') + Requerido* + @enderror +
- @error('password') Requerido* @enderror -
+ @error('password') + Requerido* + @enderror +

@@ -369,10 +445,12 @@ modTarifas: @entangle('modTarifas'), class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> @foreach ($roles as $rol) - + @endforeach - @error('rol') Requerido* @enderror + @error('rol') + Requerido* + @enderror
- {{-- editar usuario --}} -
-
-
-
-
- - - @error('nombre_edit') Requerido* @enderror -
- -
- - - @error('email_edit') Requerido* @enderror -
- -
- - - @error('rol_edit') Requerido* @enderror + {{-- editar usuario --}} +
+
+ +
+
+ + + @error('nombre_edit') + Requerido* + @enderror
-
- - - - - - -
-
- -
-
+
+ + + @error('email_edit') + Requerido* + @enderror +
- {{-- Modal contraseña --}} -
-
-
-
- Cambiar Contraseña -
+
+ + - @error('newPassword') {{ 'Diligencie correctamente*'}} @enderror -
+ + @error('rol_edit') + Requerido* + @enderror +
-
- - - - - - -
-
-
-
- - {{-- Modal add saldo --}} -
-
-
-
- Recargar saldo -
-
-
- Saldo actual: $

{{number_format($saldo_actual)}}

+
+ + + + + + +
-
- Monto a recargar -
-
- - -
Tu valor total seria: $

{{$saldo_actual + $valor_recargar}} + +

+
-

-
+ {{-- Modal contraseña --}} +
+
+
+
+ Cambiar Contraseña
- + +
+ + + @error('newPassword') + {{ 'Diligencie correctamente*' }} + @enderror +
+
- + - +
- -
- -
-
-
- - {{-- Modal tarifas --}} - -
-
-
- -
- - -
- -
- -
-
- - -
- -
- - -
-
- - - -
- -
- - - - - - - - - - @if (!empty($tarifas)) - @foreach ($tarifas as $tarifa) - - - - - - @endforeach - @endif - -
RolValor
{{ $tarifa->rol->nombre ?? '' }}{{ $tarifa->precio ?? '' }} - - -
-
- -
- - -
- -
- - - - -
-
-
-
+ + {{-- Modal add saldo --}} +
+
+
+
+ Recargar saldo +
+
+
+ Saldo actual: $

{{ number_format($saldo_actual) }}

+
+
+ Monto a recargar +
+
+ + +
Tu valor total seria: $

+ {{ $saldo_actual + $valor_recargar }} + +

+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+ + {{-- Modal quitar saldo --}} +
+
+
+
+ Descontar saldo +
+
+
+ Saldo actual: $

{{ number_format($saldo_actual) }}

+
+
+ Monto a descontar +
+
+ + +
Tu valor total seria: $

+ {{ $saldo_actual - $valor_recargar }} + +

+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+ + {{-- Modal tarifas --}} + +
+
+
+ +
+ + +
+ +
+ +
+
+ + +
+ +
+ + +
+
+
+
+ + + +
+ +
+ + + + + + + + + + @if (!empty($tarifas)) + @foreach ($tarifas as $tarifa) + + + + + + @endforeach + @endif + +
RolValor
{{ $tarifa->rol->nombre ?? '' }}{{ $tarifa->precio ?? '' }} + + + + + + + + +
+
+ +
+ + +
+ +
+ + + + +
+ +
+
+
diff --git a/storage/app/photos/I8y14wajBG.webp b/storage/app/photos/I8y14wajBG.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/storage/app/photos/I8y14wajBG.webp differ diff --git a/storage/app/photos/KLJIjZiBK5.webp b/storage/app/photos/KLJIjZiBK5.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/storage/app/photos/KLJIjZiBK5.webp differ diff --git a/storage/app/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg b/storage/app/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg new file mode 100644 index 0000000..7dc6f98 Binary files /dev/null and b/storage/app/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg differ diff --git a/storage/app/photos/gKVoc6IFjX.webp b/storage/app/photos/gKVoc6IFjX.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/storage/app/photos/gKVoc6IFjX.webp differ diff --git a/storage/app/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg b/storage/app/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg new file mode 100644 index 0000000..443088c Binary files /dev/null and b/storage/app/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg differ diff --git a/storage/app/photos/kyMjdozMZe.webp b/storage/app/photos/kyMjdozMZe.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/storage/app/photos/kyMjdozMZe.webp differ diff --git a/storage/app/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png b/storage/app/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png new file mode 100644 index 0000000..661ad7b Binary files /dev/null and b/storage/app/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png differ