public function creerdevis() { // $actif = 'gescom'; $societes[''] = ''; $societes[0] = 'Tous les contacts'; $contacts[''] = ''; $modules[''] = ''; $gescom = Gescom::first(); $societe = Societe::select('id', 'nom_clt')->where('etat', 1)->get(); $contact = Contact::select('id', 'nom_contact', 'prenoms_contact')->where('etat', 1)->get(); $module = Module::where('etat_module', 1)->orderBy('nom_module', 'asc')->get(); $produits = Produit::where('etat_produit', 1)->get(); // Remplissage du tableau des modules foreach ($produits as $value) { $modules[$value->id] = 'Licence ' . $value->nom_produit . ' Version ' . $value->vers_produit; } foreach ($module as $key => $value) { foreach ($value->produits as $pkey => $pvalue) { if ($value->type_module != 'Base') { $modules[$value->id . '.' . $pvalue->id] = $value->nom_module . ' (' . $pvalue->nom_produit . ')'; } } } // Remplissage du tableau des sociétés foreach ($societe as $key => $value) { $societes[$value->id] = $value->nom_clt; } // Remplissage du tableau des contacts foreach ($contact as $key => $value) { $contacts[$value->id] = $value->nom_contact . ' ' . $value->prenoms_contact; } return view('gescom.creer-devis', compact('actif', 'societes', 'contacts', 'modules', 'gescom')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $actif = 'gescom'; $produit = Produit::where('etat_produit', 1)->orderBy('nom_produit', 'desc')->get(); return view('gescom.liste-produit', compact('actif', 'produit')); }
public function getAllByTypeProduit($idTypeProd) { return Produit::where('ID_TYPE', '=', $idTypeProd)->get(); }