valor de compra

This commit is contained in:
Felipe
2023-10-09 10:29:05 -05:00
parent eaa4d812c6
commit c262916aae
3 changed files with 946 additions and 753 deletions
+3
View File
@@ -47,6 +47,7 @@ class ShowPromociones extends Component
public $nombre_promocion; public $nombre_promocion;
public $descripcion_promocion; public $descripcion_promocion;
public $valor_promocion; public $valor_promocion;
public $valor_compra_promocion;
public $estado_promocion; public $estado_promocion;
public $fecha_limite_promocion; public $fecha_limite_promocion;
public $categoria_id_promocion; public $categoria_id_promocion;
@@ -447,6 +448,7 @@ class ShowPromociones extends Component
$this->validate([ $this->validate([
'nombre_promocion' => 'required', 'nombre_promocion' => 'required',
'descripcion_promocion' => 'required', 'descripcion_promocion' => 'required',
'valor_compra_promocion' => 'required',
'valor_promocion' => 'required', 'valor_promocion' => 'required',
'estado_promocion' => 'required', 'estado_promocion' => 'required',
'fecha_limite_promocion' => 'required', 'fecha_limite_promocion' => 'required',
@@ -476,6 +478,7 @@ class ShowPromociones extends Component
$nueva_promocion->nombre = $this->nombre_promocion; $nueva_promocion->nombre = $this->nombre_promocion;
$nueva_promocion->descripcion = $this->descripcion_promocion; $nueva_promocion->descripcion = $this->descripcion_promocion;
$nueva_promocion->precio = $this->valor_promocion; $nueva_promocion->precio = $this->valor_promocion;
$nueva_promocion->precio_compra = $this->valor_compra_promocion;
$nueva_promocion->visible = $this->estado_promocion; $nueva_promocion->visible = $this->estado_promocion;
$nueva_promocion->fecha_limite = $this->fecha_limite_promocion; $nueva_promocion->fecha_limite = $this->fecha_limite_promocion;
$nueva_promocion->categoria_id = $this->categoria_id_promocion; $nueva_promocion->categoria_id = $this->categoria_id_promocion;
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('promociones', function (Blueprint $table) {
$table->string('precio_compra')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('promociones', function (Blueprint $table) {
//
});
}
};
@@ -10,7 +10,8 @@
copiar: '' copiar: ''
}" class="h-full w-full md:my-2"> }" class="h-full w-full md:my-2">
<div class=" fixed backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading wire:target="add_tarifa_list2,del_item_list2,photo,verPromocion,comprarPromo,editarPromo,editarPromoUpdate,comprar,pagar,create_newCategoria,add_tarifa,del_item,guardar,eliminar"> <div class=" fixed backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading
wire:target="add_tarifa_list2,del_item_list2,photo,verPromocion,comprarPromo,editarPromo,editarPromoUpdate,comprar,pagar,create_newCategoria,add_tarifa,del_item,guardar,eliminar">
<div class="grid h-full place-items-center "> <div class="grid h-full place-items-center ">
<div class="max-w-xs"> <div class="max-w-xs">
<img src="./img/loading.gif" alt="" class="w-full text-center"> <img src="./img/loading.gif" alt="" class="w-full text-center">
@@ -35,12 +36,12 @@
</svg> </svg>
Promociones Promociones
</div> </div>
@if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador") @if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
<a x-on:click="newPromocion=true" <a x-on:click="newPromocion=true"
class="flex text-sm sm:text-base px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] leading-tight">Nueva class="flex text-sm sm:text-base px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] leading-tight">Nueva
promoción promoción
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512"
style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2"> style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2">
<path <path
d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z" d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z"
@@ -58,7 +59,7 @@
@endforeach @endforeach
</select> </select>
<div> <div>
@if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador") @if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
<button x-on:click="newCategoria=true" x-transition.duration.300ms <button x-on:click="newCategoria=true" x-transition.duration.300ms
class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none"> class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block"> <svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block">
@@ -74,7 +75,8 @@
</div> --}} </div> --}}
</div> </div>
<div class="x-auto bg-white grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 shadow-md xl:mx-10 mb-8 "> <div
class="x-auto bg-white grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 shadow-md xl:mx-10 mb-8 ">
<div class="mb-2"> <div class="mb-2">
<h2>Seleccione una categoria:</h2> <h2>Seleccione una categoria:</h2>
</div> </div>
@@ -119,7 +121,9 @@
</g> </g>
</svg></button> </svg></button>
</div> </div>
<button x-on:click="verPro=true" class="my-2 mx max-w-sm ml-auto rounded-lg border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green sm-text-sm sm-leading-5">Ver todos</button> <button x-on:click="verPro=true"
class="my-2 mx max-w-sm ml-auto rounded-lg border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green sm-text-sm sm-leading-5">Ver
todos</button>
</div> </div>
<div> <div>
@@ -133,32 +137,37 @@
@foreach ($categorias->where('nombre', $categorian)->first()->promociones as $promocion) @foreach ($categorias->where('nombre', $categorian)->first()->promociones as $promocion)
@if ($promocion->visible == 'true') @if ($promocion->visible == 'true')
@if (empty($usuario=$promocion->usuario_promos->where('usuario_id', Auth::user()->id)->first())) @if (empty(($usuario = $promocion->usuario_promos->where('usuario_id', Auth::user()->id)->first())))
<div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover " <div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover "
x-data="{ openOption: false }"> x-data="{ openOption: false }">
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg" fill="none" <svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 absolute right-2 cursor-pointer"> class="w-6 h-6 absolute right-2 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" class="text-white shadow" <path stroke-linecap="round" stroke-linejoin="round"
class="text-white shadow"
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" /> d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg> </svg>
<div wire:click="verPromocion({{ $promocion->id }})" class=""> <div wire:click="verPromocion({{ $promocion->id }})" class="">
<img src="{{ asset($promocion->img_publicidad) }}" alt="" class="w-full m-auto rounded-lg object-cover h-24 sm:h-36 object-center shadow"> <img src="{{ asset($promocion->img_publicidad) }}" alt=""
class="w-full m-auto rounded-lg object-cover h-24 sm:h-36 object-center shadow">
</div> </div>
<div x-cloak x-show="openOption" <div x-cloak x-show="openOption"
class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg"> class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
@if ( auth()->user()->rol->nombre != "editor") @if (auth()->user()->rol->nombre != 'editor')
<button x-on:click="openOption=!openOption,ver=true" wire:click="comprarPromo({{ $promocion->id }})" <button x-on:click="openOption=!openOption,ver=true"
wire:click="comprarPromo({{ $promocion->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button> class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button>
@endif @endif
@if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador") @if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
<button wire:click="editarPromo({{ $promocion->id }})" x-on:click="openOption=!openOption" <button wire:click="editarPromo({{ $promocion->id }})"
x-on:click="openOption=!openOption"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Modificar</button> class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Modificar</button>
<button x-on:click="openOption=!openOption" wire:click="eliminar({{ $promocion->id }})" <button x-on:click="openOption=!openOption"
wire:click="eliminar({{ $promocion->id }})"
class="text-white w-full py-1 bg-[#ff5050] rounded-b-[1rem] hover:bg-[#fd2828] hover:rounded-b-[1rem]">Eliminar</button> class="text-white w-full py-1 bg-[#ff5050] rounded-b-[1rem] hover:bg-[#fd2828] hover:rounded-b-[1rem]">Eliminar</button>
@endif @endif
</div> </div>
@@ -166,34 +175,38 @@
</div> </div>
@else @else
@if ($usuario->visible == 'true') @if ($usuario->visible == 'true')
<div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover " <div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover "
x-data="{ openOption: false }"> x-data="{ openOption: false }">
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg" fill="none" <svg x-on:click="openOption=!openOption"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 absolute right-2 cursor-pointer"> class="w-6 h-6 absolute right-2 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" class="text-white shadow" <path stroke-linecap="round" stroke-linejoin="round"
class="text-white shadow"
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" /> d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg> </svg>
<div wire:click="verPromocion({{ $promocion->id }})" class=""> <div wire:click="verPromocion({{ $promocion->id }})" class="">
<img src="{{ asset($promocion->img_publicidad) }}" alt="" class="w-full m-auto rounded-lg object-cover h-24 sm:h-44 object-center shadow"> <img src="{{ asset($promocion->img_publicidad) }}" alt=""
class="w-full m-auto rounded-lg object-cover h-24 sm:h-44 object-center shadow">
</div> </div>
<div x-cloak x-show="openOption" <div x-cloak x-show="openOption"
class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg"> class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
@if ( auth()->user()->rol->nombre != "editor") @if (auth()->user()->rol->nombre != 'editor')
<button x-on:click="openOption=!openOption,ver=true" wire:click="comprarPromo({{ $promocion->id }})" <button x-on:click="openOption=!openOption,ver=true"
wire:click="comprarPromo({{ $promocion->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button> class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button>
@endif @endif
@if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador") @if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador')
<button wire:click="editarPromo({{ $promocion->id }})" x-on:click="openOption=!openOption" <button wire:click="editarPromo({{ $promocion->id }})"
x-on:click="openOption=!openOption"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Modificar</button> class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Modificar</button>
<button x-on:click="openOption=!openOption" wire:click="eliminar({{ $promocion->id }})" <button x-on:click="openOption=!openOption"
wire:click="eliminar({{ $promocion->id }})"
class="text-white w-full py-1 bg-[#ff5050] rounded-b-[1rem] hover:bg-[#fd2828] hover:rounded-b-[1rem]">Eliminar</button> class="text-white w-full py-1 bg-[#ff5050] rounded-b-[1rem] hover:bg-[#fd2828] hover:rounded-b-[1rem]">Eliminar</button>
@endif @endif
</div> </div>
@@ -201,10 +214,7 @@
</div> </div>
@endif @endif
@endif @endif
@endif @endif
@endforeach @endforeach
@@ -233,20 +243,27 @@
@if ($photo) @if ($photo)
<img src="{{ $photo->temporaryUrl() }}" alt="" <img src="{{ $photo->temporaryUrl() }}" alt=""
class="object-cover rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20"> class="object-cover rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20">
@error('photo') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('photo')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
@else @else
<img src="" alt="" <img src="" alt=""
class="rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20"> class="rounded-xl border-2 border-neutral-200 shadow-md w-28 h-20">
@error('photo') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('photo')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
@endif @endif
</div> </div>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="nombre_promocion" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label> <label for="nombre_promocion"
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre_promocion" wire:model="nombre_promocion" <input type="text" id="nombre_promocion" wire:model="nombre_promocion"
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"> 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">
@error('nombre_promocion') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('nombre_promocion')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
</div> </div>
<div class="mb-4"> <div class="mb-4">
@@ -254,17 +271,22 @@
class="block text-gray-700 text-sm font-bold mb-2">Descripción:</label> class="block text-gray-700 text-sm font-bold mb-2">Descripción:</label>
<textarea type="text" id="descripcion_promocion" wire:model="descripcion_promocion" <textarea type="text" id="descripcion_promocion" wire:model="descripcion_promocion"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
@error('descripcion_promocion') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('descripcion_promocion')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="mensaje_servicio" class="block text-gray-700 text-sm font-bold mb-2">Mensaje:</label> <label for="mensaje_servicio"
<textarea type="text" id="mensaje_servicio" wire:model.defer="mensaje_servicio" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea> class="block text-gray-700 text-sm font-bold mb-2">Mensaje:</label>
<textarea type="text" id="mensaje_servicio" wire:model.defer="mensaje_servicio"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
</div> </div>
<div class="flex items-center gap-2 mb-4"> <div class="flex items-center gap-2 mb-4">
<div> <div>
<label for="valor_promocion" class="block text-gray-700 text-sm font-bold mb-2">Valor:</label> <label for="valor_promocion"
class="block text-gray-700 text-sm font-bold mb-2">Valor:</label>
<input name="valor_promocion" wire:model="valor_promocion" type="number" min="0" <input name="valor_promocion" wire:model="valor_promocion" type="number" min="0"
placeholder="$0" placeholder="$0"
class="w-[10rem] border-2 border-neutral-200 shadow 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-0 block datepicker-input"> class="w-[10rem] border-2 border-neutral-200 shadow 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-0 block datepicker-input">
@@ -280,13 +302,26 @@
</div> </div>
</div> </div>
<div class="mb-4">
<label for="valor_compra_promocion"
class="block text-gray-700 text-sm font-bold mb-2">Valor de compra:</label>
<input name="valor_compra_promocion" wire:model="valor_compra_promocion" type="number" min="0"
placeholder="$0"
class="w-full border-2 border-neutral-200 shadow 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-0 block datepicker-input">
</div>
<div class="flex items-center gap-2 mb-4"> <div class="flex items-center gap-2 mb-4">
<div class="relative"> <div class="relative">
<label for="fecha_limite_promocion" class="block text-gray-700 text-sm font-bold mb-2">Fecha <label for="fecha_limite_promocion"
class="block text-gray-700 text-sm font-bold mb-2">Fecha
limite:</label> limite:</label>
<input name="fecha_limite_promocion" wire:model.defer="fecha_limite_promocion" type="date" <input name="fecha_limite_promocion" wire:model.defer="fecha_limite_promocion"
type="date"
class="border-2 border-neutral-200 shadow 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-0 block w-full datepicker-input"> class="border-2 border-neutral-200 shadow 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-0 block w-full datepicker-input">
@error('fecha_limite_promocion') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('fecha_limite_promocion')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
</div> </div>
<div> <div>
@@ -302,7 +337,8 @@
<button x-on:click.prevent="newCategoria=true" x-transition.duration.300ms <button x-on:click.prevent="newCategoria=true" x-transition.duration.300ms
class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none"> class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block"> <svg viewBox="0 0 20 20" enable-background="new 0 0 20 20"
class="w-6 h-6 inline-block">
<path fill="#FFFFFF" <path fill="#FFFFFF"
d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601 d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399 C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
@@ -334,7 +370,9 @@
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</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</button>
</div> </div>
</div> </div>
@error('list') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('list')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
<div class="mb-4 h-16 overflow-y-auto flex sm:justify-evenly gap-5"> <div class="mb-4 h-16 overflow-y-auto flex sm:justify-evenly gap-5">
<table class="w-full text-center"> <table class="w-full text-center">
<thead> <thead>
@@ -461,7 +499,8 @@
<div class="grid h-full place-items-center"> <div class="grid h-full place-items-center">
<div class="bg-white rounded-lg shadow-md sm:1/2 md:1/3 lg:1/3 xl:w-1/4"> <div class="bg-white rounded-lg shadow-md sm:1/2 md:1/3 lg:1/3 xl:w-1/4">
{{-- PHOTO --}} {{-- PHOTO --}}
<div class="w-full text-left text-white px-4 bg-cover py-2 rounded-lg h-64 bg-[url({{asset($this->imagen)}})] "> <div
class="w-full text-left text-white px-4 bg-cover py-2 rounded-lg h-64 bg-[url({{ asset($this->imagen) }})] ">
</div> </div>
@@ -473,7 +512,9 @@
<h1 class="text-left font-bold text-lg">{{ $nombrePromo }}</h1> <h1 class="text-left font-bold text-lg">{{ $nombrePromo }}</h1>
</div> </div>
<div class="justify-self-end"> <div class="justify-self-end">
<h1 class="flex gap-2 items-center font-bold"> <p> ${{number_format($precioAhora)}}</p></h1> <h1 class="flex gap-2 items-center font-bold">
<p> ${{ number_format($precioAhora) }}</p>
</h1>
</div> </div>
</div> </div>
<div class="text-sm text-gray-500"> <div class="text-sm text-gray-500">
@@ -481,12 +522,16 @@
</div> </div>
</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-2 mb-3"> <div
class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-2 mb-3">
<span> <span>
<button x-on:click ="modalComprarPromo=true,verPromo=false" wire:loading.attr="disabled" 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 sm-text-sm sm-leading-5">Comprar</button> <button x-on:click="modalComprarPromo=true,verPromo=false" wire:loading.attr="disabled"
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 sm-text-sm sm-leading-5">Comprar</button>
</span> </span>
<span> <span>
<button x-on:click="verPromo=false" 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 sm-text-sm sm-leading-5">Cerrar</button> <button x-on:click="verPromo=false" 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 sm-text-sm sm-leading-5">Cerrar</button>
</span> </span>
</div> </div>
</div> </div>
@@ -525,7 +570,8 @@
<div> <div>
<div class="mb-4"> <div class="mb-4">
<label for="nombre_editarPromo" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label> <label for="nombre_editarPromo"
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre_editarPromo" wire:model="nombre_editarPromo" <input type="text" id="nombre_editarPromo" wire:model="nombre_editarPromo"
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"> 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>
@@ -537,20 +583,24 @@
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="mensaje_servicio" class="block text-gray-700 text-sm font-bold mb-2">Mensaje:</label> <label for="mensaje_servicio"
<textarea type="text" id="mensaje_servicio" wire:model.defer="mensaje_servicio" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea> class="block text-gray-700 text-sm font-bold mb-2">Mensaje:</label>
<textarea type="text" id="mensaje_servicio" wire:model.defer="mensaje_servicio"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
</div> </div>
<div class="flex items-center gap-2 mb-4"> <div class="flex items-center gap-2 mb-4">
<div> <div>
<label for="valor_editarPromo" class="block text-gray-700 text-sm font-bold mb-2">Valor:</label> <label for="valor_editarPromo"
<input name="valor_editarPromo" wire:model="valor_editarPromo" type="number" min="0" class="block text-gray-700 text-sm font-bold mb-2">Valor:</label>
placeholder="$0" <input name="valor_editarPromo" wire:model="valor_editarPromo" type="number"
min="0" placeholder="$0"
class="w-[10rem] border-2 border-neutral-200 shadow 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-0 block datepicker-input"> class="w-[10rem] border-2 border-neutral-200 shadow 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-0 block datepicker-input">
</div> </div>
<div> <div>
<label class="block select-none text-white text-sm font-bold mb-2">Estado:</label> <label class="block select-none text-white text-sm font-bold mb-2">Estado:</label>
<select name="estado_promocion" id="estado_promocion" wire:model="estado_editarPromo" <select name="estado_promocion" id="estado_promocion"
wire:model="estado_editarPromo"
class="w-[10rem] 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"> class="w-[10rem] 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">
<option value="true" selected>Estado</option> <option value="true" selected>Estado</option>
<option value="true">Activo</option> <option value="true">Activo</option>
@@ -561,9 +611,11 @@
<div class="flex items-center gap-2 mb-4"> <div class="flex items-center gap-2 mb-4">
<div class="relative"> <div class="relative">
<label for="fecha_limite_promocion" class="block text-gray-700 text-sm font-bold mb-2">Fecha <label for="fecha_limite_promocion"
class="block text-gray-700 text-sm font-bold mb-2">Fecha
limite:</label> limite:</label>
<input name="fecha_limite_promocion" wire:model.defer="fecha_editarPromo" type="date" <input name="fecha_limite_promocion" wire:model.defer="fecha_editarPromo"
type="date"
class="border-2 border-neutral-200 shadow 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-0 block w-full datepicker-input"> class="border-2 border-neutral-200 shadow 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-0 block w-full datepicker-input">
<div hidden class="text-sm text-gray-400"> <div hidden class="text-sm text-gray-400">
{{ $fecha_editarPromo }} {{ $fecha_editarPromo }}
@@ -572,18 +624,21 @@
</div> </div>
<div> <div>
<label class="block select-none text-white text-sm font-bold mb-2">Categoria:</label> <label
class="block select-none text-white text-sm font-bold mb-2">Categoria:</label>
<select name="categoria_id_promocion" id="categoria_id_promocion" <select name="categoria_id_promocion" id="categoria_id_promocion"
wire:model.debounce.500ms="categoria_id_editarPromo" wire:model.debounce.500ms="categoria_id_editarPromo"
class="w-[8rem] 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"> class="w-[8rem] 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">
<option value="" selected>Categoria</option> <option value="" selected>Categoria</option>
@foreach ($categorias as $categoria) @foreach ($categorias as $categoria)
<option value="{{ $categoria->id }}">{{ $categoria->nombre ?? '' }}</option> <option value="{{ $categoria->id }}">{{ $categoria->nombre ?? '' }}
</option>
@endforeach @endforeach
</select> </select>
<button x-on:click.prevent="newCategoria=true" x-transition.duration.300ms <button x-on:click.prevent="newCategoria=true" x-transition.duration.300ms
class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none"> class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block"> <svg viewBox="0 0 20 20" enable-background="new 0 0 20 20"
class="w-6 h-6 inline-block">
<path fill="#FFFFFF" <path fill="#FFFFFF"
d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601 d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399 C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
@@ -599,13 +654,16 @@
class="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"> class="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">
<option value="" selected>Tarifas</option> <option value="" selected>Tarifas</option>
@foreach ($tarifas as $tarifa) @foreach ($tarifas as $tarifa)
<option value="{{ $tarifa->id }}">{{ $tarifa->servicio->nombre ?? '' }} : <option value="{{ $tarifa->id }}">{{ $tarifa->servicio->nombre ?? '' }}
:
@if (!empty($tarifa->servicio->por_tiempo)) @if (!empty($tarifa->servicio->por_tiempo))
{{ $tarifa->dias ?? '' }} {{ $tarifa->dias == 1 ? 'día' : 'días' }} {{ $tarifa->dias ?? '' }}
{{ $tarifa->dias == 1 ? 'día' : 'días' }}
@else @else
{{ $tarifa->pantallas ?? '' }} {{ $tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} - {{ $tarifa->dias ?? '' }} {{ $tarifa->dias == 1 ? 'día' : 'días' }} {{ $tarifa->pantallas ?? '' }}
{{ $tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} -
{{ $tarifa->dias ?? '' }}
{{ $tarifa->dias == 1 ? 'día' : 'días' }}
@endif @endif
</option> </option>
@endforeach @endforeach
@@ -615,7 +673,9 @@
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</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</button>
</div> </div>
</div> </div>
@error('list') <span class="text-red-400 text-sm">Obligatorio*</span> @enderror @error('list')
<span class="text-red-400 text-sm">Obligatorio*</span>
@enderror
<div class="mb-4 overflow-y-auto flex sm:justify-evenly gap-5"> <div class="mb-4 overflow-y-auto flex sm:justify-evenly gap-5">
<table class="w-full text-center"> <table class="w-full text-center">
<thead> <thead>
@@ -630,19 +690,24 @@
$n = 0; $n = 0;
@endphp @endphp
@foreach ($list2 as $lista) @foreach ($list2 as $lista)
<tr class="text-left mt-2 w-full border-white border-b-gray-300 border "> <tr
class="text-left mt-2 w-full border-white border-b-gray-300 border ">
<td class="pl-[1rem] w-1/4 whitespace-nowrap "> <td class="pl-[1rem] w-1/4 whitespace-nowrap ">
{{ $lista['nombre'] ?? '' }} - {{ $lista['cantidad'] ?? '' }} P. - {{ $lista['dias'] ?? '' }} D. {{ $lista['nombre'] ?? '' }} -
{{ $lista['cantidad'] ?? '' }} P. -
{{ $lista['dias'] ?? '' }} D.
</td> </td>
<td class="pl-[1rem] w-1/4 whitespace-nowrap"> <td class="pl-[1rem] w-1/4 whitespace-nowrap">
<button wire:click="del_item_list2({{$lista['identificador']}},'{{ $n }}')" <button
wire:click="del_item_list2({{ $lista['identificador'] }},'{{ $n }}')"
x-transition.duration.300ms x-transition.duration.300ms
class=" text-center text-white w-7 h-7 float-right bg-red-500 rounded-full hover:bg-red-600 active:shadow-lg mouse shadow transition ease-in duration-200 focus:outline-none"> class=" text-center text-white w-7 h-7 float-right bg-red-500 rounded-full hover:bg-red-600 active:shadow-lg mouse shadow transition ease-in duration-200 focus:outline-none">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" <svg xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"
class="w-4 inline-block"> stroke="currentColor" class="w-4 inline-block">
<path stroke-linecap="round" stroke-linejoin="round" <path stroke-linecap="round"
stroke-linejoin="round"
d="M6 18L18 6M6 6l12 12" /> d="M6 18L18 6M6 6l12 12" />
</svg> </svg>
</button> </button>
@@ -663,10 +728,12 @@
</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"> <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> <span>
<button wire:click="editarPromoUpdate" 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="editarPromoUpdate" 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>
<span> <span>
<button x-on:click="editarPromo=false" 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] ease-in-out sm-text-sm sm-leading-5">Cerrar</button> <button x-on:click="editarPromo=false" 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] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span> </span>
</div> </div>
</div> </div>
@@ -681,7 +748,8 @@
class=" backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full fixed z-20"> class=" backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full fixed z-20">
<div class="grid h-full place-items-center"> <div class="grid h-full place-items-center">
<div class="bg-white rounded-lg shadow-md sm:1/2 md:1/2 lg:1/3 xl:w-1/4"> <div class="bg-white rounded-lg shadow-md sm:1/2 md:1/2 lg:1/3 xl:w-1/4">
<div class="w-full Text-left text-white px-4 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 py-2 rounded-lg"> <div
class="w-full Text-left text-white px-4 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 py-2 rounded-lg">
<p class="font-bold text-lg mb-2"> <p class="font-bold text-lg mb-2">
{{ $nombrePromo }} {{ $nombrePromo }}
</p> </p>
@@ -707,28 +775,45 @@
<div class="flex justify-between text-left gap-2"> <div class="flex justify-between text-left gap-2">
<div class="mb-4"> <div class="mb-4">
<label for="nombre_comprarPromo" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label> <label for="nombre_comprarPromo"
<input type="text" id="nombre_comprarPromo" wire:model="nombre_comprarPromo" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
@error('nombre_comprarPromo') <span class="text-red-400 text-sm ">Requerido*</span> @enderror <input type="text" id="nombre_comprarPromo" wire:model="nombre_comprarPromo"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('nombre_comprarPromo')
<span class="text-red-400 text-sm ">Requerido*</span>
@enderror
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="celular_comprarPromo" class="block text-gray-700 text-sm font-bold mb-2">Celular:</label> <label for="celular_comprarPromo"
<input type="text" id="celular_comprarPromo" wire:model="celular_comprarPromo" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="block text-gray-700 text-sm font-bold mb-2">Celular:</label>
@error('celular_comprarPromo') <span class="text-red-400 text-sm ">Requerido*</span> @enderror <input type="text" id="celular_comprarPromo" wire:model="celular_comprarPromo"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('celular_comprarPromo')
<span class="text-red-400 text-sm ">Requerido*</span>
@enderror
</div> </div>
</div> </div>
<div class="flex justify-between text-left gap-2"> <div class="flex justify-between text-left gap-2">
<div class="mb-4"> <div class="mb-4">
<label for="email_comprarPromo" class="block text-gray-700 text-sm font-bold mb-2">E-mail:</label> <label for="email_comprarPromo"
<input type="email" id="email_comprarPromo" wire:model="email_comprarPromo" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="block text-gray-700 text-sm font-bold mb-2">E-mail:</label>
@error('email_comprarPromo') <span class="text-red-400 text-sm ">Requerido*</span> @enderror <input type="email" id="email_comprarPromo" wire:model="email_comprarPromo"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-full py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('email_comprarPromo')
<span class="text-red-400 text-sm ">Requerido*</span>
@enderror
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="cantidad_comprarPromo" class="block text-gray-700 text-sm font-bold mb-2">Cantidad:</label> <label for="cantidad_comprarPromo"
<input type="number" id="cantidad_comprarPromo" min="1" wire:model="cantidad_comprarPromo" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-1/2 py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="block text-gray-700 text-sm font-bold mb-2">Cantidad:</label>
@error('cantidad_comprarPromo') <span class="text-red-400 text-sm ">Requerido*</span> @enderror <input type="number" id="cantidad_comprarPromo" min="1"
wire:model="cantidad_comprarPromo"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 w-1/2 py-2 px-3 focus:ring-0 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('cantidad_comprarPromo')
<span class="text-red-400 text-sm ">Requerido*</span>
@enderror
</div> </div>
</div> </div>
<div class="mb-4"> <div class="mb-4">
@@ -737,22 +822,44 @@
</p> </p>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<div class="border-2 flex text-gray-400 text-xs text-center justify-center gap-2 py-3 rounded-lg md:mx-3 2xl:mx-6"> <div
El valor de ${{number_format($total=((int)$precioAhora*(int)$cantidad_comprarPromo))}} será descontado de su saldo. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve"><g><path d="M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z" fill="#9f9f9f" data-original="#000000"></path><path d="M12,5a1,1,0,0,0-1,1v8a1,1,0,0,0,2,0V6A1,1,0,0,0,12,5Z" fill="#9f9f9f" data-original="#000000"></path><rect x="11" y="17" width="2" height="2" rx="1" fill="#9f9f9f" data-original="#000000"></rect></g></svg> class="border-2 flex text-gray-400 text-xs text-center justify-center gap-2 py-3 rounded-lg md:mx-3 2xl:mx-6">
El valor de
${{ number_format($total = (int) $precioAhora * (int) $cantidad_comprarPromo) }} será
descontado de su saldo. <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"
class="w-4" x="0" y="0" viewBox="0 0 24 24"
style="enable-background:new 0 0 512 512" xml:space="preserve">
<g>
<path
d="M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"
fill="#9f9f9f" data-original="#000000"></path>
<path d="M12,5a1,1,0,0,0-1,1v8a1,1,0,0,0,2,0V6A1,1,0,0,0,12,5Z" fill="#9f9f9f"
data-original="#000000"></path>
<rect x="11" y="17" width="2" height="2"
rx="1" fill="#9f9f9f" data-original="#000000"></rect>
</g>
</svg>
</div> </div>
@if ($total > auth()->user()->saldo->valor) @if ($total > auth()->user()->saldo->valor)
<div class=" flex text-red-400 text-xs text-center justify-center gap-2 py-2 rounded-lg md:mx-2 2xl:mx-6"> <div
<p class=""> No tiene fondo suficientes para esta compra, recargue su cuenta.</p> <a href="{{route('recarga')}}"><button class="bg-green-600 text-white rounded px-2 py-1">Recargar</button></a> class=" flex text-red-400 text-xs text-center justify-center gap-2 py-2 rounded-lg md:mx-2 2xl:mx-6">
<p class=""> No tiene fondo suficientes para esta compra, recargue su cuenta.
</p> <a href="{{ route('recarga') }}"><button
class="bg-green-600 text-white rounded px-2 py-1">Recargar</button></a>
</div> </div>
@endif @endif
</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"> <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> <span>
<button wire:click="pagar" type="button" @if ( $total <= auth()->user()->saldo->valor) 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 sm-text-sm sm-leading-5" @else disabled class="cursor-no-drop inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-gray-200 hover:bg-gray-200 focus:shadow-outline-green sm-text-sm sm-leading-5" @endif >Comprar</button> <button wire:click="pagar" type="button"
@if ($total <= auth()->user()->saldo->valor) 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 sm-text-sm sm-leading-5" @else disabled class="cursor-no-drop inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-gray-200 hover:bg-gray-200 focus:shadow-outline-green sm-text-sm sm-leading-5" @endif>Comprar</button>
</span> </span>
<span> <span>
<button x-on:click="modalComprarPromo=false" 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 sm-text-sm sm-leading-5">Cerrar</button> <button x-on:click="modalComprarPromo=false" 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 sm-text-sm sm-leading-5">Cerrar</button>
</span> </span>
</div> </div>
@@ -763,13 +870,11 @@
{{-- Modal credenciales --}} {{-- Modal credenciales --}}
<div x-cloak x-show="credenciales" <div x-cloak x-show="credenciales" x-transition:enter="transition duration-350"
x-transition:enter="transition duration-350" x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:enter-start="opacity-0 scale-100" x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
x-transition:enter-end="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-100"
x-transition:leave="transition duration-350" class=" backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full fixed z-20">
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100" class=" backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full fixed z-20">
<div class="grid h-full place-items-center overflow-y-auto"> <div class="grid h-full place-items-center overflow-y-auto">
<div class="bg-white rounded-lg shadow-md sm:1/2 md:1/2 lg:1/3 xl:w-1/4"> <div class="bg-white rounded-lg shadow-md sm:1/2 md:1/2 lg:1/3 xl:w-1/4">
<div class="w-full Text-left text-white px-4 py-2 rounded-lg" <div class="w-full Text-left text-white px-4 py-2 rounded-lg"
@@ -814,64 +919,83 @@
<div class="shadow-md rounded-lg py-3 px-6 mx-8 flex "> <div class="shadow-md rounded-lg py-3 px-6 mx-8 flex ">
<div> <div>
<h1 class="mt-4"> <h1 class="mt-4">
<div class="font-semibold text-gray-700">{{ $cuenta->servicio->nombre }} :</div> <div class="font-semibold text-gray-700">
{{ $cuenta->servicio->nombre }} :</div>
@if (!empty($cuenta->servicio->ver_url)) @if (!empty($cuenta->servicio->ver_url))
- URL: <span class="font-semibold text-gray-600">{{ $cuenta->servicio->url}}</span> - URL: <span
class="font-semibold text-gray-600">{{ $cuenta->servicio->url }}</span>
@else @else
@foreach ($cuenta->perfil as $perfil) @foreach ($cuenta->perfil as $perfil)
@if ($cuentas->id == $perfil->historial_id) @if ($cuentas->id == $perfil->historial_id)
- Perfil <span class="font-semibold text-gray-600">{{ $perfil->perfil }}</span> - Perfil <span
class="font-semibold text-gray-600">{{ $perfil->perfil }}</span>
@if (!empty($cuenta->servicio->perfiles)) @if (!empty($cuenta->servicio->perfiles))
@switch($perfil->perfil) @switch($perfil->perfil)
@case(1) @case(1)
: <span class="font-semibold text-gray-600">{{ $msj->clave_1 }}</span> : <span
class="font-semibold text-gray-600">{{ $msj->clave_1 }}</span>
@break @break
@case(2)
: <span class="font-semibold text-gray-600">{{ $msj->clave_2 }}</span>
@break
@case(3)
: <span class="font-semibold text-gray-600">{{ $msj->clave_3 }}</span>
@break
@case(4)
: <span class="font-semibold text-gray-600">{{ $msj->clave_4 }}</span>
@break
@case(5)
: <span class="font-semibold text-gray-600">{{ $msj->clave_5 }}</span>
@break
@case(6)
: <span class="font-semibold text-gray-600">{{ $msj->clave_6 }}</span>
@break
@default
@case(2)
: <span
class="font-semibold text-gray-600">{{ $msj->clave_2 }}</span>
@break
@case(3)
: <span
class="font-semibold text-gray-600">{{ $msj->clave_3 }}</span>
@break
@case(4)
: <span
class="font-semibold text-gray-600">{{ $msj->clave_4 }}</span>
@break
@case(5)
: <span
class="font-semibold text-gray-600">{{ $msj->clave_5 }}</span>
@break
@case(6)
: <span
class="font-semibold text-gray-600">{{ $msj->clave_6 }}</span>
@break
@default
@endswitch @endswitch
@endif @endif
@endif @endif
@endforeach @endforeach
@endif @endif
</h1> </h1>
<h1 class="mt-4"> <h1 class="mt-4">
Usuario: <p class="font-semibold text-gray-600">{{ $cuenta->correo }}</p> Usuario: <p class="font-semibold text-gray-600">
{{ $cuenta->correo }}</p>
</h1> </h1>
<h1 class="mt-4"> <h1 class="mt-4">
Contraseña: <p class="font-semibold text-gray-600">{{ $cuenta->password }} Contraseña: <p class="font-semibold text-gray-600">
{{ $cuenta->password }}
</p> </p>
</h1> </h1>
</div> </div>
<div class="text-center"> <div class="text-center">
<button class="" onclick="copiarAlPortapapeles2({{$n}})"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <button class=""
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" /> onclick="copiarAlPortapapeles2({{ $n }})"><svg
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" />
</svg> </svg>
</button> </button>
</div> </div>
<p class="hidden" id="{{$n}}">{{ $cuenta->servicio->nombre }} - email: {{ $cuenta->correo }} - Pass: {{ $cuenta->password }}</p> <p class="hidden" id="{{ $n }}">
{{ $cuenta->servicio->nombre }} - email: {{ $cuenta->correo }} - Pass:
{{ $cuenta->password }}</p>
</div> </div>
@endforeach @endforeach
<textarea id="d" class="hidden"> <textarea id="d" class="hidden">
@@ -879,24 +1003,60 @@
{{ $msj->msj_wp }} {{ $msj->msj_wp }}
@foreach ($cuentas->cuentas->unique() as $cuenta) @foreach ($cuentas->cuentas->unique() as $cuenta)
@if (!empty($cuenta->servicio->ver_url)) @if (!empty($cuenta->servicio->ver_url))
*URL:* {{ $cuenta->servicio->url }} @else *URL:* {{ $cuenta->servicio->url }}
*Servicio:* {{$cuenta->servicio->nombre}} @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) @case(1) : {{ $msj->clave_1 }} @break @case(2) : {{ $msj->clave_2 }} @break @case(3) : {{ $msj->clave_3 }} @break @case(4) : {{ $msj->clave_4 }} @break @case(5) : {{ $msj->clave_5 }} @break @case(6) :{{ $msj->clave_6 }} @break @default @endswitch @endif @endif @endforeach @else
*Usuario:* {{ $cuenta->correo }} *Servicio:* {{ $cuenta->servicio->nombre }} @foreach ($cuenta->perfil as $perfil)
*Contraseña:* {{ $cuenta->password }} @endif @if ($cuentas->id == $perfil->historial_id && $cuenta->estado == 'activo')
- Perfil {{ $perfil->perfil }} @if (!empty($cuenta->servicio->perfiles))
@switch($perfil->perfil)
@case(1)
: {{ $msj->clave_1 }}
@break
@case(2)
: {{ $msj->clave_2 }}
@break
@case(3)
: {{ $msj->clave_3 }}
@break
@case(4)
: {{ $msj->clave_4 }}
@break
@case(5)
: {{ $msj->clave_5 }}
@break
@case(6)
:{{ $msj->clave_6 }}
@break
@default
@endswitch
@endif
@endif
@endforeach
*Usuario:* {{ $cuenta->correo }}
*Contraseña:* {{ $cuenta->password }}
@endif
@endforeach @endforeach
</textarea> </textarea>
<div class="w-full text-center"> <div class="w-full text-center">
<button class="text-center text-sm text-green-500 font-semibold border px-3 py-2 hover:bg-green-400 hover:text-white border-green-500 rounded mx-auto my-2" onclick="copyToClipboard2()">Copiar todo <button
class="text-center text-sm text-green-500 font-semibold border px-3 py-2 hover:bg-green-400 hover:text-white border-green-500 rounded mx-auto my-2"
onclick="copyToClipboard2()">Copiar todo
</button> </button>
</div> </div>
<h1 class="flex mt-4 gap-1"> <h1 class="flex mt-4 gap-1">
Este servicio vencerá el <p class="font-semibold text-gray-600"> Este servicio vencerá el <p class="font-semibold text-gray-600">
{{ Carbon\Carbon::parse($cuentas->fecha_final)->format('Y/m/d') ?? ''}}</p> {{ Carbon\Carbon::parse($cuentas->fecha_final)->format('Y/m/d') ?? '' }}
</p>
</h1> </h1>
@endif @endif
@@ -910,10 +1070,12 @@
</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"> <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> <span>
<button x-on:click="credenciales=false" 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 sm-text-sm sm-leading-5">Cerrar</button> <button x-on:click="credenciales=false" 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 sm-text-sm sm-leading-5">Cerrar</button>
</span> </span>
</div> </div>
@@ -935,7 +1097,6 @@
@foreach ($categorias as $categoria1) @foreach ($categorias as $categoria1)
<div class="cursor-pointer transition hover:scale-[1.05] w-[250px] h-[250px] sm:w-[350px] sm:h-[350px] mx-4 my-2 mx-auto" <div class="cursor-pointer transition hover:scale-[1.05] w-[250px] h-[250px] sm:w-[350px] sm:h-[350px] mx-4 my-2 mx-auto"
x-on:click="categorian='{{ $categoria1->nombre }}',verPro=false"> x-on:click="categorian='{{ $categoria1->nombre }}',verPro=false">
<a href="#promo"> <a href="#promo">
@@ -945,7 +1106,6 @@
</a> </a>
</div> </div>
@endforeach @endforeach
<span class="absolute z-40 top-0 right-0 md:right-[48%]"> <span class="absolute z-40 top-0 right-0 md:right-[48%]">
@@ -957,7 +1117,6 @@
</div> </div>
<script> <script>
function copiarAlPortapapeles2(id_elemento) { function copiarAlPortapapeles2(id_elemento) {
var aux = document.createElement("input"); var aux = document.createElement("input");
aux.setAttribute("value", document.getElementById(id_elemento).innerHTML); aux.setAttribute("value", document.getElementById(id_elemento).innerHTML);
@@ -989,7 +1148,6 @@ function copiarAlPortapapeles2(id_elemento) {
//alert("Copied to clipboard"); //alert("Copied to clipboard");
}); });
} }
</script> </script>
</div> </div>