|
|
|
|
|
|
|
|
use kartik\mpdf\Pdf; |
|
|
use kartik\mpdf\Pdf; |
|
|
use common\models\Etablissement; |
|
|
use common\models\Etablissement; |
|
|
use common\models\Commande ; |
|
|
use common\models\Commande ; |
|
|
|
|
|
use common\models\CommandeAuto ; |
|
|
use common\models\Production ; |
|
|
use common\models\Production ; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$u->save(); |
|
|
$u->save(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$commandes = Commande::find() |
|
|
|
|
|
->where('username IS NOT NULL') |
|
|
|
|
|
->all() ; |
|
|
|
|
|
|
|
|
|
|
|
foreach($commandes as $c) |
|
|
|
|
|
{ |
|
|
|
|
|
do { |
|
|
|
|
|
$i_nom = rand(0, count($arr_noms)-1) ; |
|
|
|
|
|
$i_prenom = rand(0, count($arr_prenoms)-1) ; |
|
|
|
|
|
} while(isset($arr_noms_checked[$i_nom]) || isset($arr_prenoms_checked[$i_prenom])) ; |
|
|
|
|
|
|
|
|
|
|
|
$arr_noms_checked[$i_nom] = true ; |
|
|
|
|
|
$arr_prenoms_checked[$i_prenom] = true ; |
|
|
|
|
|
|
|
|
|
|
|
$nom = $arr_noms[$i_nom] ; |
|
|
|
|
|
$prenom = $arr_prenoms[$i_prenom] ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$c->username = $prenom.' '.$nom ; |
|
|
|
|
|
|
|
|
|
|
|
$c->save() ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$commandes_auto = CommandeAuto::find() |
|
|
|
|
|
->where('username IS NOT NULL') |
|
|
|
|
|
->all() ; |
|
|
|
|
|
|
|
|
|
|
|
foreach($commandes_auto as $c) |
|
|
|
|
|
{ |
|
|
|
|
|
do { |
|
|
|
|
|
$i_nom = rand(0, count($arr_noms)-1) ; |
|
|
|
|
|
$i_prenom = rand(0, count($arr_prenoms)-1) ; |
|
|
|
|
|
} while(isset($arr_noms_checked[$i_nom]) || isset($arr_prenoms_checked[$i_prenom])) ; |
|
|
|
|
|
|
|
|
|
|
|
$arr_noms_checked[$i_nom] = true ; |
|
|
|
|
|
$arr_prenoms_checked[$i_prenom] = true ; |
|
|
|
|
|
|
|
|
|
|
|
$nom = $arr_noms[$i_nom] ; |
|
|
|
|
|
$prenom = $arr_prenoms[$i_prenom] ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$c->username = $prenom.' '.$nom ; |
|
|
|
|
|
|
|
|
|
|
|
$c->save() ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|