From 1cc308507dea7b4f88397ce0dc7a309d9b6d1770 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 14 Sep 2003 12:05:09 +0000 Subject: [PATCH] Ajout produits --- htdocs/admin/system/gendata.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/system/gendata.php b/htdocs/admin/system/gendata.php index e9eb5a3e15e..9d6cbc0d89b 100644 --- a/htdocs/admin/system/gendata.php +++ b/htdocs/admin/system/gendata.php @@ -59,8 +59,15 @@ if ($action == 'facture') $facture->note = ''; $facture->cond_reglement = 1; $facture->remise_percent = rand(0,50); - - $facture->add_product($productsid[rand(1, sizeof($productsid)-1)],rand(1,11)); + + $prand = rand(1,20); + for ($p = 0 ; $p < $prand ; $p++) + { + $pidrand = rand(1, sizeof($productsid)-1); + $facture->add_product($productsid[rand(1, sizeof($productsid)-1)],rand(1,11)); + print "Ajout produit ".$productsid[$pidrand]."
"; + + } $id = $facture->create($user); if ($id) @@ -105,13 +112,7 @@ else $contact->nom = "Nom aléa ".time(); if ( $contact->create($user) ) { - $prand = rand(1,20); - print "-- génère $prand contact
"; - for ($p = 0 ; $p < $rand ; $p++) - { - $pidrand = rand(1, sizeof($productsid)-1); - print "Ajout produit ".$productsid[$pidrand]."
"; - } + } } }