Предварительное заполнение полей автоматическиPhp

Кемеровские программисты php общаются здесь
Anonymous
Предварительное заполнение полей автоматически

Сообщение Anonymous »


I have a "Produits" table

public function up() { Schema::create('produits', function (Blueprint $table) { $table->id(); $table->string('reference')->nullable(); $table->string('libelle')->nullable(); $table->string('entrepot_id')->nullable(); $table->string('tva')->nullable(); $table->string('etat_vente')->nullable(); $table->string('etat_achat')->nullable(); $table->string('description')->nullable(); $table->string('limit_stock_alerte')->nullable(); $table->string('stock_optimal')->nullable(); $table->string('prix_vente')->nullable(); $table->string('prix_vente_min')->nullable(); $table->string('prix_revient')->nullable(); $table->string('poids')->nullable(); $table->string('user_created_id')->nullable(); $table->string('user_updated_id')->nullable(); $table->timestamps(); }); } My controller which allows me to retrieve the list of "Produits"

public function show($id) { $propositions = PropoCom::where('id','=',$id)->first(); $produits = Produit::where('etat_vente', 1)->get(); return view('layouts.commerce.details-propo-brouillon', compact('propositions', 'produits')); } My form:

@foreach ($produits as $produit) Produits prédéfinis en vente ... {{$produit->reference}} - {{$produit->libelle}} - @if ($produit->stocks->isNotEmpty()) {{ $produit->stocks->sortByDesc('created_at')->first()->nbr_piece }} @else @endif - {{ number_format($produit->prix_vente, 0, ',', ' ') }} FCFA @endforeach TVA ... 0% 18% PRIX DE VENTE QUANTITE REDUCTION PRIX DE REVIENT AJOUTER I would like when the user selects a product in the drop-down menu "

@foreach ($produits as $produit) Produits prédéfinis en vente ... {{$produit->reference}} - {{$produit->libelle}} - @if ($produit->stocks->isNotEmpty()) {{ $produit->stocks->sortByDesc('created_at')->first()->nbr_piece }} @else @endif - {{ number_format($produit->prix_vente, 0, ',', ' ') }} FCFA @endforeach " Other fields such as:

TVA ... 0% 18% and:

PRIX DE VENTE And:

PRIX DE REVIENT Automatically pre-populate with product information when the product is selected. Any ideas how I can handle this?


Источник: https://stackoverflow.com/questions/780 ... omatically

Вернуться в «Php»