-
Notifications
You must be signed in to change notification settings - Fork 1
/
addrandomdecor.php
66 lines (46 loc) · 1.14 KB
/
addrandomdecor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require 'config.php';
dol_include_once('/quentin/class/film.class.php');
$PDOdb=new TPDOdb;
llxHeader();
dol_fiche_head();
/*$sql="SELECT rowid
FROM ".MAIN_DB_PREFIX."film
";
$monfichier=fopen('films.txt','r');
while($nom = fgets($monfichier)){
$sql= "INSERT INTO `".MAIN_DB_PREFIX."film` (
`rowid` ,
`date_cre` ,
`date_maj` ,
`title` ,
`description` ,
`fk_c_categoryfilm` ,
`code_c_categoryfilm`
)
VALUES (
'8', '1000-01-01 00:00:00', '1000-01-01 00:00:00', $nom, NULL , '0', NULL
);";
$PDOdb->Execute($sql);
}
fclose($monfichier);*/
$TLegume = file('fruitslegumes.txt');
$TCouleur = file('couleurs.txt');
$TAction = file('action.txt');
$TAnimal = file('animal.txt');
$TDecor = file('decor.txt');
$TIDFilm =array_keys( Tfilm::getAll($PDOdb) );
//var_dump($filelegume, $filecouleur);exit;
for($i=0; $i<200; $i++) {
shuffle($TCouleur);
shuffle($TDecor);
shuffle($TIDFilm);
$decor = new TDecor();
$decor->label=trim($TDecor[0]).' '.trim($TCouleur[0]);
$decor->fk_film=$TIDFilm[0];
$decor->surface=rand(0,100);
$decor->save($PDOdb);
}
dol_fiche_end();
llxFooter();
?>