diff --git a/app/Http/Controllers/MenuController.php b/app/Http/Controllers/MenuController.php index f560e07..ea8e1b2 100644 --- a/app/Http/Controllers/MenuController.php +++ b/app/Http/Controllers/MenuController.php @@ -53,6 +53,9 @@ class MenuController extends Controller public function showperfil(){ return view('menu/perfil'); } + public function showpendientes(){ + return view('menu/pendientes'); + } public function showconfiguracion(){ return view('menu/configuracion'); } diff --git a/app/Http/Livewire/ShowConfiguracion.php b/app/Http/Livewire/ShowConfiguracion.php index 88575ac..c41d32d 100644 --- a/app/Http/Livewire/ShowConfiguracion.php +++ b/app/Http/Livewire/ShowConfiguracion.php @@ -11,6 +11,8 @@ use Livewire\WithFileUploads; use App\Models\Cuentas; use App\Models\Historial_cuenta; use App\Models\Historiale; +use App\Models\Notificacion; +use App\Models\User; use Intervention\Image\ImageManagerStatic as Img; use Illuminate\Support\Str; use Artisan; @@ -55,13 +57,13 @@ class ShowConfiguracion extends Component public $premio_8; public $premio_9; public $premio_10; - + public $mensaje_top; public $img_top; public $mensaje_msj_compra; public $mensaje_msj_wp; - + public $clave_1; public $clave_2; public $clave_3; @@ -69,18 +71,22 @@ class ShowConfiguracion extends Component public $clave_5; public $clave_6; - public $iptv; - public $notificacion; + public $iptv; + public $notificacion; public $consulta_configuracion; - + + public $titulo_noti; + public $descripcion_noti; + public $destinatario_noti; + public function render() - { + { //$consulta = Configuracione::with('usuario')->orderby('id','desc'); - $consulta_configuracion= Configuracione::with('usuario')->orderby('id','desc')->first(); + $consulta_configuracion = Configuracione::with('usuario')->orderby('id', 'desc')->first(); $this->consulta_configuracion = $consulta_configuracion; //dd($consulta_configuraciones); - if (empty($this->nombre) && empty($this->slogan) && empty($this->color_boton) ) { + if (empty($this->nombre) && empty($this->slogan) && empty($this->color_boton)) { $this->nombre = $consulta_configuracion->nombre; $this->slogan = $consulta_configuracion->slogan; @@ -117,9 +123,9 @@ class ShowConfiguracion extends Component //msj - $this->mensaje_msj_compra= $consulta_configuracion->msj_compra; - $this->mensaje_msj_wp= $consulta_configuracion->msj_wp; - + $this->mensaje_msj_compra = $consulta_configuracion->msj_compra; + $this->mensaje_msj_wp = $consulta_configuracion->msj_wp; + $this->clave_1 = $consulta_configuracion->clave_1; $this->clave_2 = $consulta_configuracion->clave_2; $this->clave_3 = $consulta_configuracion->clave_3; @@ -129,19 +135,44 @@ class ShowConfiguracion extends Component $this->iptv = $consulta_configuracion->iptv; $this->notificacion = $consulta_configuracion->hora; - - } - - - return view('livewire.show-configuracion',[ + return view('livewire.show-configuracion', [ 'sliders' => slider::get(), + 'usuarios' => User::get(), ]); } - public function guardarclaves(){ - $claves=$this->consulta_configuracion->update([ + + public function guardarNoti() + { + $this->validate([ + 'titulo_noti' => 'required', + 'descripcion_noti' => 'required', + ]); + + $consulta = new Notificacion(); + $consulta->remitente_id = Auth::user()->id; + $consulta->destinatario_id = $this->destinatario_noti == 'todos' ? Auth::user()->id : $this->destinatario_noti; + $consulta->titulo = trim($this->titulo_noti); + $consulta->descripcion = trim($this->descripcion_noti); + $consulta->estado = true; + $consulta->todos = $this->destinatario_noti == 'todos' || !$this->destinatario_noti ? true : false; + $consulta->save(); + + $this->alert('success', 'Notificacion creada exitosamente!', [ + 'position' => 'top' + ]); + + + $this->titulo_noti = null; + $this->descripcion_noti = null; + $this->destinatario_noti = null; + } + + public function guardarclaves() + { + $claves = $this->consulta_configuracion->update([ 'clave_1' => $this->clave_1, 'clave_2' => $this->clave_2, 'clave_3' => $this->clave_3, @@ -151,74 +182,72 @@ class ShowConfiguracion extends Component ]); if ($claves) { - + $this->alert('success', 'claves actualizado', [ 'position' => 'top' - ]); - - } + ]); + } } - public function guardar(){ + public function guardar() + { if (!empty($this->photo)) { - $nombre=Str::random(10); - - $img = img::make($this->photo)->orientate()->resize(1000, null, function($constraint){ + $nombre = Str::random(10); + + $img = img::make($this->photo)->orientate()->resize(1000, null, function ($constraint) { $constraint->aspectRatio(); $constraint->upsize(); })->encode('webp'); - - $location = "photos/".$nombre.".webp"; - + + $location = "photos/" . $nombre . ".webp"; + Storage::disk('local')->put($location, $img); - + $url_logo = $location; - }else{ - $url_logo = $this->url_logo ; + } else { + $url_logo = $this->url_logo; } - - $configuracion=$this->consulta_configuracion->update([ + + $configuracion = $this->consulta_configuracion->update([ 'nombre' => $this->nombre, 'slogan' => $this->slogan, 'color_boton' => $this->color_boton, 'url_logo' => $url_logo, 'color_barra' => $this->color_barra, - 'color_menu'=> $this->color_menu, - 'usermodifico_id'=>Auth::user()->id, + 'color_menu' => $this->color_menu, + 'usermodifico_id' => Auth::user()->id, ]); if ($configuracion) { - + $this->alert('success', 'Configuración actualizada', [ 'position' => 'top' - ]); - + ]); } - - } - public function guardarSlider(){ + public function guardarSlider() + { if (!empty($this->slider)) { - - $nombre=Str::random(12); - - $img = img::make($this->slider)->orientate()->resize(1000, null, function($constraint){ + + $nombre = Str::random(12); + + $img = img::make($this->slider)->orientate()->resize(1000, null, function ($constraint) { $constraint->aspectRatio(); $constraint->upsize(); })->encode('webp'); - - $location = "photos/".$nombre.".webp"; - + + $location = "photos/" . $nombre . ".webp"; + Storage::disk('local')->put($location, $img); - + $url_slider = $location; - }else{ - $url_slider = '' ; + } else { + $url_slider = ''; } - + $guardar = new slider; $guardar->slider = $url_slider; $guardar->save(); @@ -247,196 +276,200 @@ class ShowConfiguracion extends Component 'onDismissed' => '', 'cancelButtonText' => 'Salir', 'confirmButtonText' => 'Si', - ]); + ]); } public function getListeners() { - return [ - 'confirmed' - ]; + return [ + 'confirmed' + ]; } - public function confirmed(){ - slider::where('id',$this->delete_slider)->delete(); + public function confirmed() + { + slider::where('id', $this->delete_slider)->delete(); $this->alert('success', 'Imagen eliminada correctamente!', [ 'position' => 'top' ]); } - public function guardarTop(){ + public function guardarTop() + { if (!empty($this->photo_top)) { - $nombre=Str::random(10); - $img = img::make($this->photo_top)->orientate()->resize(1000, null, function($constraint){ + $nombre = Str::random(10); + $img = img::make($this->photo_top)->orientate()->resize(1000, null, function ($constraint) { $constraint->aspectRatio(); $constraint->upsize(); })->encode('webp'); - $location = "photos/".$nombre.".webp"; - Storage::disk('local')->put($location, $img); - $photo_top = $location; - - }else{ - $photo_top = $this->img_top ; + $location = "photos/" . $nombre . ".webp"; + Storage::disk('local')->put($location, $img); + $photo_top = $location; + } else { + $photo_top = $this->img_top; } if (!empty($this->imgP1)) { - $imgP1=$this->imgP1->store('photos'); - }else{ - $imgP1 = $this->top_1 ; + $imgP1 = $this->imgP1->store('photos'); + } else { + $imgP1 = $this->top_1; } if (!empty($this->imgP2)) { - $imgP2=$this->imgP2->store('photos'); - }else{ - $imgP2 = $this->top_2 ; + $imgP2 = $this->imgP2->store('photos'); + } else { + $imgP2 = $this->top_2; } if (!empty($this->imgP3)) { - $imgP3=$this->imgP3->store('photos'); - }else{ - $imgP3 = $this->top_3 ; + $imgP3 = $this->imgP3->store('photos'); + } else { + $imgP3 = $this->top_3; } if (!empty($this->imgP4)) { - $imgP4=$this->imgP4->store('photos'); - }else{ - $imgP4 = $this->top_4 ; + $imgP4 = $this->imgP4->store('photos'); + } else { + $imgP4 = $this->top_4; } if (!empty($this->imgP5)) { - $imgP5=$this->imgP5->store('photos'); - }else{ - $imgP5 = $this->top_5 ; + $imgP5 = $this->imgP5->store('photos'); + } else { + $imgP5 = $this->top_5; } if (!empty($this->imgP6)) { - $imgP6=$this->imgP6->store('photos'); - }else{ - $imgP6 = $this->top_6 ; + $imgP6 = $this->imgP6->store('photos'); + } else { + $imgP6 = $this->top_6; } if (!empty($this->imgP7)) { - $imgP7=$this->imgP7->store('photos'); - }else{ - $imgP7 = $this->top_7 ; + $imgP7 = $this->imgP7->store('photos'); + } else { + $imgP7 = $this->top_7; } if (!empty($this->imgP8)) { - $imgP8=$this->imgP8->store('photos'); - }else{ - $imgP8 = $this->top_8 ; + $imgP8 = $this->imgP8->store('photos'); + } else { + $imgP8 = $this->top_8; } if (!empty($this->imgP9)) { - $imgP9=$this->imgP9->store('photos'); - }else{ - $imgP9 = $this->top_9 ; + $imgP9 = $this->imgP9->store('photos'); + } else { + $imgP9 = $this->top_9; } if (!empty($this->imgP10)) { - $imgP10=$this->imgP10->store('photos'); - }else{ - $imgP10 = $this->top_10 ; + $imgP10 = $this->imgP10->store('photos'); + } else { + $imgP10 = $this->top_10; } - + $top = $this->consulta_configuracion->update([ - 'top_1' => $imgP1, - 'top_2' => $imgP2, - 'top_3' => $imgP3, - 'top_4' => $imgP4, - 'top_5' => $imgP5, - 'top_6' => $imgP6, - 'top_7' => $imgP7, - 'top_8' => $imgP8, - 'top_9' => $imgP9, - 'top_10' => $imgP10, - - 'img_top' => $photo_top, - 'mensaje_top' => $this->mensaje_top, - 'premio_1' => $this->premio_1, - 'premio_2' => $this->premio_2, - 'premio_3' => $this->premio_3, - 'premio_4' => $this->premio_4, - 'premio_5' => $this->premio_5, - 'premio_6' => $this->premio_6, - 'premio_7' => $this->premio_7, - 'premio_8' => $this->premio_8, - 'premio_9' => $this->premio_9, - 'premio_10' => $this->premio_10, + 'top_1' => $imgP1, + 'top_2' => $imgP2, + 'top_3' => $imgP3, + 'top_4' => $imgP4, + 'top_5' => $imgP5, + 'top_6' => $imgP6, + 'top_7' => $imgP7, + 'top_8' => $imgP8, + 'top_9' => $imgP9, + 'top_10' => $imgP10, + + 'img_top' => $photo_top, + 'mensaje_top' => $this->mensaje_top, + 'premio_1' => $this->premio_1, + 'premio_2' => $this->premio_2, + 'premio_3' => $this->premio_3, + 'premio_4' => $this->premio_4, + 'premio_5' => $this->premio_5, + 'premio_6' => $this->premio_6, + 'premio_7' => $this->premio_7, + 'premio_8' => $this->premio_8, + 'premio_9' => $this->premio_9, + 'premio_10' => $this->premio_10, + - ]); - - if($top){ + + if ($top) { $this->alert('success', 'Top distribuidores actualizado', [ 'position' => 'top' - ]); + ]); } - } - public function guardarMsjCompra(){ + public function guardarMsjCompra() + { $msj = $this->consulta_configuracion->update([ 'msj_compra' => $this->mensaje_msj_compra, 'msj_wp' => $this->mensaje_msj_wp, ]); if ($msj) { - - $this->alert('success', 'Mensaje actualizado', [ - 'position' => 'top' - ]); - + + $this->alert('success', 'Mensaje actualizado', [ + 'position' => 'top' + ]); } } - public function guardariptv(){ - // dd($this->iptv); + public function guardariptv() + { + // dd($this->iptv); $iptv = $this->consulta_configuracion->update([ 'iptv' => $this->iptv, ]); if ($iptv) { - - $this->alert('success', 'iptv actualizado', [ - 'position' => 'top' - ]); - + + $this->alert('success', 'iptv actualizado', [ + 'position' => 'top' + ]); } } - public function eliminarC(){ + public function eliminarC() + { //$eliminar_cuentas = Cuentas::truncate(); $this->alert('warning', 'Funcion deshabilitada ', [ 'position' => 'top' - ]); - + ]); } - public function eliminarR(){ - // $eliminar_cuentas = Historial_cuenta::truncate(); + public function eliminarR() + { + // $eliminar_cuentas = Historial_cuenta::truncate(); $this->alert('warning', 'Funcion deshabilitada ', [ 'position' => 'top' - ]); + ]); } - public function eliminarH(){ + public function eliminarH() + { //$desasociar_cuentas = Historiale::truncate(); $this->alert('warning', 'Funcion deshabilitada ', [ 'position' => 'top' - ]); + ]); } - public function guardarnot(){ + public function guardarnot() + { $notificacion = $this->consulta_configuracion->update([ 'hora' => $this->notificacion, ]); $this->alert('success', 'La hora de notificación ha sido actualizada.', [ 'position' => 'top' - ]); + ]); } - public function eliminarCache(){ + public function eliminarCache() + { Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('view:clear'); @@ -445,7 +478,6 @@ class ShowConfiguracion extends Component $this->alert('success', 'Cache removido correctamente', [ 'position' => 'top' - ]); + ]); } - } diff --git a/app/Http/Livewire/ShowPendientes.php b/app/Http/Livewire/ShowPendientes.php new file mode 100644 index 0000000..d95d133 --- /dev/null +++ b/app/Http/Livewire/ShowPendientes.php @@ -0,0 +1,20 @@ +entradas); + + return view('livewire.show-pendientes',[ + 'consulta' => $consulta, + ]); + } +} diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 46edcbb..e6c223b 100644 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -6,12 +6,15 @@ use App\Models\Cuentas; use App\Models\Historiale; use App\Models\Historial_cuenta; use App\Models\Log_general; +use App\Models\Notificacion; use App\Models\Pendientes; use App\Models\Role; use App\Models\Servicio; use App\Models\Tarifas; use App\Models\user; +use App\Notifications\NotificacionPendiente; use Carbon\Carbon; +use Illuminate\Support\Facades\Auth; use Livewire\Component; use Jantinnerezo\LivewireAlert\LivewireAlert; use Livewire\WithFileUploads; @@ -242,12 +245,25 @@ class ShowPlanes extends Component $cuentasPendientes = Pendientes::where('estado', 'pendiente')->where('servicio_id', $this->servicio_newCuenta)->take($servicioPantallas)->get(); foreach ($cuentasPendientes as $i => $cuentaPendiente) { + $servicioName = $cuentaPendiente->servicio->nombre; + $historial_cuenta = new Historial_cuenta(); $historial_cuenta->historial_id = $cuentaPendiente->historial_id; $historial_cuenta->cuenta_id = $cuenta->id; $historial_cuenta->perfil = $i + 1; $historial_cuenta->save(); $cuentaPendiente->update(['estado' => 'cerrado']); + + $cuentaPendiente->historial->vendedor->notify(new NotificacionPendiente($servicioName)); + + $consulta = new Notificacion(); + $consulta->remitente_id = Auth::user()->id; + $consulta->destinatario_id = $historial_cuenta->historial->vendedor_id; + $consulta->titulo = "Licencia asignada para $servicioName"; + $consulta->descripcion = "La licencia de $servicioName ha sido activada y ahora puedes utilizar tu cuenta sin problemas."; + $consulta->estado = true; + $consulta->todos = false; + $consulta->save(); } } diff --git a/app/Imports/UsersImport.php b/app/Imports/UsersImport.php index 0b47e57..3e9791d 100644 --- a/app/Imports/UsersImport.php +++ b/app/Imports/UsersImport.php @@ -5,8 +5,11 @@ namespace App\Imports; use Illuminate\Support\Facades\Hash; use App\Models\Cuentas; use App\Models\Historial_cuenta; +use App\Models\Notificacion; use App\Models\Pendientes; use App\Models\Servicio; +use App\Notifications\NotificacionPendiente; +use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Concerns\ToModel; class UsersImport implements ToModel @@ -39,12 +42,25 @@ class UsersImport implements ToModel ->get(); foreach ($cuentasPendientes as $i => $cuentaPendiente) { + $servicioName = $cuentaPendiente->servicio->nombre; + $historial_cuenta = new Historial_cuenta(); $historial_cuenta->historial_id = $cuentaPendiente->historial_id; $historial_cuenta->cuenta_id = $cuenta->id; $historial_cuenta->perfil = $i + 1; $historial_cuenta->save(); $cuentaPendiente->update(['estado' => 'cerrado']); + + $historial_cuenta->historial->vendedor->notify(new NotificacionPendiente($servicioName)); + + $consulta = new Notificacion(); + $consulta->remitente_id = Auth::user()->id; + $consulta->destinatario_id = $historial_cuenta->historial->vendedor_id; + $consulta->titulo = "Licencia asignada para $servicioName"; + $consulta->descripcion = "La licencia de $servicioName ha sido activada y ahora puedes utilizar tu cuenta sin problemas."; + $consulta->estado = true; + $consulta->todos = false; + $consulta->save(); } } diff --git a/app/Models/Historial_cuenta.php b/app/Models/Historial_cuenta.php index a63bf17..016dde1 100644 --- a/app/Models/Historial_cuenta.php +++ b/app/Models/Historial_cuenta.php @@ -11,6 +11,10 @@ class Historial_cuenta extends Model protected $fillable = [ 'historial_id', 'cuenta_id', - ]; + + public function historial() + { + return $this->belongsTo(Historiale::class, 'historial_id'); + } } diff --git a/app/Models/Historiale.php b/app/Models/Historiale.php index c50be30..e71fa0b 100644 --- a/app/Models/Historiale.php +++ b/app/Models/Historiale.php @@ -24,7 +24,7 @@ class Historiale extends Model public function vendedor() { - return $this->belongsTo(User::class); + return $this->belongsTo(User::class , 'vendedor_id'); } public function tarifa() diff --git a/app/Models/Pendientes.php b/app/Models/Pendientes.php index d67260c..73bf063 100644 --- a/app/Models/Pendientes.php +++ b/app/Models/Pendientes.php @@ -18,10 +18,10 @@ class Pendientes extends Model public function servicio() { - return $this->hasMany(Servicio::class, 'servicio_id'); + return $this->belongsTo(Servicio::class, 'servicio_id'); } public function historial() { - return $this->hasMany(Historiale::class, 'historial_id'); + return $this->belongsTo(Historiale::class, 'historial_id'); } } diff --git a/app/Notifications/NotificacionPendiente.php b/app/Notifications/NotificacionPendiente.php new file mode 100644 index 0000000..77786e3 --- /dev/null +++ b/app/Notifications/NotificacionPendiente.php @@ -0,0 +1,43 @@ +servicioName = $servicioName; + } + + public function via($notifiable) + { + return ['mail']; + } + + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('Licencia asignada para ' . $this->servicioName) + ->greeting('Tu cuenta de ' . $this->servicioName . ' ha sido asignada') + ->line('titulo: ' . 'Licencia asignada para ' . $this->servicioName) + ->line('descripcion: La licencia de ' . $this->servicioName . ' ha sido activada y ahora puedes utilizar tu cuenta sin problemas.') + ->salutation('¡Gracias por tu atención!'); + } + + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/resources/views/components/listado-planes.blade.php b/resources/views/components/listado-planes.blade.php index d62138a..c2a86b5 100644 --- a/resources/views/components/listado-planes.blade.php +++ b/resources/views/components/listado-planes.blade.php @@ -1,129 +1,143 @@
- - - {{ $cuenta->id ?? '' }} - {{ $cuenta->servicio->nombre ?? '' }} + + + {{ $cuenta->id ?? '' }} + {{ $cuenta->servicio->nombre ?? '' }} - {{ $cuenta->correo?? '' }} - {{ $cuenta->password ?? '' }} + {{ $cuenta->correo ?? '' }} + {{ $cuenta->password ?? '' }} - {{ carbon\Carbon::parse($cuenta->inicio)->format('d M Y') ?? '' }} - {{ carbon\Carbon::parse($cuenta->vencimiento)->format('d M Y') ?? '' }} - + + {{ carbon\Carbon::parse($cuenta->inicio)->format('d M Y') ?? '' }} - + {{ carbon\Carbon::parse($cuenta->vencimiento)->format('d M Y') ?? '' }} - @php - $servicioNom = $cuenta->servicio->nombre ?? ''; - - $date1 = new DateTime(strtr(strval($fechaActual), '/', '-')); - $date2 = new DateTime(strtr(strval($cuenta->vencimiento), '/', '-')); - - @endphp - @if ($date1 < $date2) - - @php - $diff = $date1->diff($date2); - echo $diff->days . ' dias'; - @endphp - - @endif + @php + $servicioNom = $cuenta->servicio->nombre ?? ''; - @if ($date1 > $date2) - - @php - echo 'Vencido'; - @endphp - - @endif + $date1 = new DateTime(strtr(strval($fechaActual), '/', '-')); + $date2 = new DateTime(strtr(strval($cuenta->vencimiento), '/', '-')); - @if ($date1 == $date2) - - @php - echo 'Vence hoy!!'; - @endphp - - @endif - - @if($cuenta->estado=='pendiente') - @if($cuenta->historiales_count == 0) -

Disponible

- @else -

Ocupado

- @endif + @endphp - @else -

{{ $cuenta->historiales_count ?? '0' }}/{{$cuenta->servicio->pantallas?? '0'}} @endif @if($historiales >= '1'){{$historiales}}

@endif - - @if ($cuenta->estado == 'pendiente') Cuenta completa @elseif($cuenta->estado == 'activo') Pantallas @else Inactiva @endif - - - - - - -
- - - - - @if (auth()->user()->rol->nombre != "editor") - - @endif -
- - - @if(!empty($cuenta->observaciones)) -
- - - -
- @else -
- - - - - - + @if ($date1 < $date2) + + @php + $diff = $date1->diff($date2); + echo $diff->days . ' dias'; + @endphp + + @endif + + @if ($date1 > $date2) + + @php + echo 'Vencido'; + @endphp + + @endif + + @if ($date1 == $date2) + + @php + echo 'Vence hoy!!'; + @endphp + + @endif + + + @if ($cuenta->estado == 'pendiente') + @if ($cuenta->historiales_count == 0) +

Disponible

+ @else +

Ocupado

+ @endif + @else +

+ {{ $cuenta->historiales_count ?? '0' }}/{{ $cuenta->servicio->pantallas ?? '0' }} @endif + @if ($historiales >= '1') + {{ $historiales }} +

+ @endif + + + @if ($cuenta->estado == 'pendiente') + Cuenta completa + @elseif($cuenta->estado == 'activo') + Pantallas + @else + Inactiva + @endif + + + + + + + +
+ + + + + @if (auth()->user()->rol->nombre != 'editor') + + @endif +
+ + + @if (!empty($cuenta->observaciones)) +
+ + + +
+ @else +
+ + + + + - -
- - @endif - - -
\ No newline at end of file + + +
+ @endif + + + diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php index 6cb4450..61e66f4 100644 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/layouts/navigation.blade.php @@ -98,8 +98,9 @@ x-data="{ menuG:false}"
  • Admin

    -

    +

    Gestión Planes + Gestión Pendientes Importar cuentas @if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador") Gestión Promociones diff --git a/resources/views/livewire/bell.blade.php b/resources/views/livewire/bell.blade.php index 682273e..a2cd1e3 100644 --- a/resources/views/livewire/bell.blade.php +++ b/resources/views/livewire/bell.blade.php @@ -21,7 +21,7 @@

    {{ $item->descripcion }}

    - @if (!$item->todos) + @if (!$item->todos || Auth::user()->rol->nombre == 'administrador') x diff --git a/resources/views/livewire/show-configuracion.blade.php b/resources/views/livewire/show-configuracion.blade.php index c1f5b9c..ccb810c 100644 --- a/resources/views/livewire/show-configuracion.blade.php +++ b/resources/views/livewire/show-configuracion.blade.php @@ -1,5 +1,6 @@
    -
    > +
    @@ -8,14 +9,14 @@
    - +
    + xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0" viewBox="0 0 24 24" + style="enable-background:new 0 0 512 512" xml:space="preserve">
    - +
    @@ -100,7 +101,7 @@
    {{-- Slider --}} -
    +
    @@ -108,7 +109,8 @@
    Gestión de Slider
    @@ -117,15 +119,15 @@
    @if ($slider) - - @else -
    - + + @else +
    + +
    + @endif
    - - @endif -
    - +
    +
    {{-- distribuidor --}}
    - - + +

    Distribuidor

    {{-- img distribuidor --}} -
    +
    @if ($photo_top) - + @else -
    - -
    - +
    + +
    @endif
    - +
    - + class=" cursor-pointer justify-center rounded-md border border-transparent px-2 py-1 mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Subir + img +
    @@ -202,203 +206,215 @@
    -
    - @if ($imgP1) - - @else - - - - @endif -
    - +
    + @if ($imgP1) + + @else + + @endif +
    - + + + 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">
    @if ($imgP2) - + @else - - - + @endif
    - - + + + 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">
    @if ($imgP3) - + @else - - - + @endif
    - - + + -
    - + 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"> +
    +
    -
    - @if ($imgP4) - - @else - - - - @endif -
    - +
    + @if ($imgP4) + + @else + + @endif +
    - + + + 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">
    @if ($imgP5) - + @else - - - + @endif
    - - + + + 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">
    @if ($imgP6) - + @else - - - + @endif
    - - + + -
    - + 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"> +
    +
    -
    - @if ($imgP7) - - @else - - - - @endif -
    - +
    + @if ($imgP7) + + @else + + @endif +
    - + + + 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">
    @if ($imgP8) - + @else - - - + @endif
    - - + + + 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">
    @if ($imgP9) - + @else - - - + @endif
    - - + + -
    - + 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"> +
    +
    -
    - @if ($imgP10) - - @else - - - - @endif -
    - +
    + @if ($imgP10) + + @else + + @endif +
    - + + + 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">
    - - + +
    - {{-- mensaje --}} + {{-- mensaje --}}
    - - + +
    @@ -407,23 +423,25 @@ 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">Actualizar - +
    - {{-- Msj de compra--}} -
    + {{-- Msj de compra --}} +
    + -
    -

    Mensaje de compra html

    +

    Mensaje de compra html

    - {{-- mensaje --}} + {{-- mensaje --}}
    - - + +
    @@ -432,12 +450,14 @@ {{-- mensaje --}} -
    - - +
    + + +
    -
    - +
    @@ -445,128 +465,181 @@ 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">Actualizar - +
    - +
    -

    Claves perfil netflix

    +

    Claves perfil netflix

    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - - -
    - - -
    - - - - - - - -
    -
    - - -
    -
    -

    URL IPTV

    -
    - - + +
    - +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + +
    + +
    - - + + + + + + +
    - - - +
    +
    +
    +

    URL IPTV

    +
    + + +
    +
    +
    -
    + + + +
    -
    +
    +
    +
    +

    Notificaciones globales

    +
    + + +
    +
    + + +
    - -
    -
    +
    + + +
    +
    +
    + + + + + +
    + +
    + + +
    +

    Área critica

    - - - - + + + + +
    + +
    - - + + +
    - +
    -
    -
    - - -
    +
    - - -
    + + +
    - - - + + + - -
    + +
    -
    +
    + +
    -
    - - + 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 + cache + - -
    - @include('layouts.footer') -
    + +
    + @include('layouts.footer') +
    diff --git a/resources/views/livewire/show-pendientes.blade.php b/resources/views/livewire/show-pendientes.blade.php new file mode 100644 index 0000000..14c3374 --- /dev/null +++ b/resources/views/livewire/show-pendientes.blade.php @@ -0,0 +1,99 @@ +
    + + + + + + + + id + Servicio + Cantidad + Estado + Fecha + + + + + @foreach ($consulta as $item) + + {{-- --}} + + {{ $item->id ?? '' }} + {{ $item->servicio->nombre ?? '' }} + {{ $item->cantidad ?? '' }} + {{ $item->estado ?? '' }} + + {{ carbon\Carbon::parse($item->created_at)->format('d M Y') ?? '' }} + + {{-- + + +
    + + + + + @if (auth()->user()->rol->nombre != 'editor') + + @endif +
    + + + @if (!empty($item->observaciones)) +
    + + + +
    + @else +
    + + + + + + + + +
    + @endif + --}} + + @endforeach +
    + + {{ $consulta->links() }} + +
    +
    diff --git a/resources/views/menu/pendientes.blade.php b/resources/views/menu/pendientes.blade.php new file mode 100644 index 0000000..2f86b3c --- /dev/null +++ b/resources/views/menu/pendientes.blade.php @@ -0,0 +1,7 @@ + +
    + +
    + + @include('layouts.footer') +
    \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 3299e91..0ac97ae 100644 --- a/routes/web.php +++ b/routes/web.php @@ -67,6 +67,7 @@ Route::middleware(["auth", "solo_usuario_administrador"])->group(function () { Route::get('/admin',[MenuController::class,'showadmin' ])->middleware(['auth'])->name('admin'); Route::any('/usuarios',[MenuController::class,'showusuarios' ])->name('usuarios'); Route::any('/planes',[MenuController::class,'showplanes' ])->name('planes'); + Route::any('/pendientes',[MenuController::class,'showpendientes' ])->name('pendientes'); Route::get('/servicio',[MenuController::class,'showservicio' ])->name('servicio'); Route::get('/configuracion',[MenuController::class,'showconfiguracion' ])->name('configuracion'); Route::get('/categoria',[MenuController::class,'showcategoria' ])->name('categoria'); diff --git a/storage/app/livewire-tmp/B2stqk1KNxCheqNKvE65ddTXFynnbS-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/B2stqk1KNxCheqNKvE65ddTXFynnbS-metaQ1VFTlRBUy54bHN4-.xlsx new file mode 100644 index 0000000..cbc11c5 Binary files /dev/null and b/storage/app/livewire-tmp/B2stqk1KNxCheqNKvE65ddTXFynnbS-metaQ1VFTlRBUy54bHN4-.xlsx differ diff --git a/storage/app/livewire-tmp/D56GDnMlUkOhR0jC0cqVcem5NLoVI9-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/D56GDnMlUkOhR0jC0cqVcem5NLoVI9-metaQ1VFTlRBUy54bHN4-.xlsx deleted file mode 100644 index 9186513..0000000 Binary files a/storage/app/livewire-tmp/D56GDnMlUkOhR0jC0cqVcem5NLoVI9-metaQ1VFTlRBUy54bHN4-.xlsx and /dev/null differ diff --git a/storage/app/livewire-tmp/EkOQcR8NtQt5haKn73VNQQNs4aksv2-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/EkOQcR8NtQt5haKn73VNQQNs4aksv2-metaQ1VFTlRBUy54bHN4-.xlsx new file mode 100644 index 0000000..cbc11c5 Binary files /dev/null and b/storage/app/livewire-tmp/EkOQcR8NtQt5haKn73VNQQNs4aksv2-metaQ1VFTlRBUy54bHN4-.xlsx differ diff --git a/storage/app/livewire-tmp/RkRt0q1psBeEaNUsIFpeSue75RPdLN-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/RkRt0q1psBeEaNUsIFpeSue75RPdLN-metaQ1VFTlRBUy54bHN4-.xlsx new file mode 100644 index 0000000..cbc11c5 Binary files /dev/null and b/storage/app/livewire-tmp/RkRt0q1psBeEaNUsIFpeSue75RPdLN-metaQ1VFTlRBUy54bHN4-.xlsx differ diff --git a/storage/app/livewire-tmp/Ry9Rmb4VmjGuvsT2FnGcQHVbsqyaLS-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/Ry9Rmb4VmjGuvsT2FnGcQHVbsqyaLS-metaQ1VFTlRBUy54bHN4-.xlsx deleted file mode 100644 index 9186513..0000000 Binary files a/storage/app/livewire-tmp/Ry9Rmb4VmjGuvsT2FnGcQHVbsqyaLS-metaQ1VFTlRBUy54bHN4-.xlsx and /dev/null differ diff --git a/storage/app/livewire-tmp/TKzit0ihbTnQsi1rksOENQ8jCQPkjZ-metaQ1VFTlRBUy54bHN4-.xlsx b/storage/app/livewire-tmp/TKzit0ihbTnQsi1rksOENQ8jCQPkjZ-metaQ1VFTlRBUy54bHN4-.xlsx deleted file mode 100644 index 2c1b0e5..0000000 Binary files a/storage/app/livewire-tmp/TKzit0ihbTnQsi1rksOENQ8jCQPkjZ-metaQ1VFTlRBUy54bHN4-.xlsx and /dev/null differ