ajout_desc($this->nom, $this->titre, $this->chapo, $this->description); } public function init(){ $cnx = new Cnx(); $resultat = mysql_query("CREATE TABLE IF NOT EXISTS ".$this->table." ( cap_id int(11) NOT NULL auto_increment, cap_libelle char(1) NOT NULL, cap_image varchar(50) NOT NULL, PRIMARY KEY (cap_id)) ENGINE=MyISAM; ",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'a','img1.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'b','img2.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'c','img3.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'d','img4.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'e','img5.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'f','img6.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'g','img7.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'h','img8.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'i','img9.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'j','img10.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'k','img11.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'l','img12.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'m','img13.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'n','img14.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'o','img15.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'p','img16.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'q','img17.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'r','img18.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'s','img19.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'t','img20.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'u','img21.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'v','img22.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'w','img23.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'x','img24.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'y','img25.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'z','img26.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'0','img27.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'1','img28.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'2','img29.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'3','img30.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'4','img31.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'5','img32.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'6','img33.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'7','img34.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'8','img35.png')",$cnx->link); $resultat = mysql_query("INSERT INTO ".$this->table." (cap_id, cap_libelle,cap_image) VALUES(null,'9','img36.png')",$cnx->link); } public function destroy(){ $cnx = new Cnx(); $arr = mysql_fetch_array(mysql_query("SHOW TABLES LIKE '".$this->table."'",$cnx->link)); if ($arr[0] == $this->table) $resultat = mysql_query("DROP TABLE ".$this->table." ",$cnx->link); } public function ajout_desc($nom, $titre, $chapo, $description, $lang=1, $devise=""){ $modulesdesc = new Modulesdesc(); $res = $modulesdesc->verif($nom, $lang); $modulesdesc->plugin = $nom; $modulesdesc->titre = $titre; $modulesdesc->chapo = $chapo; $modulesdesc->description = $description; $modulesdesc->lang = $lang; $modulesdesc->devise = $devise; if($res) $modulesdesc->maj(); else $modulesdesc->add(); } public function crypte($nb_caratere=5){ $tableau = array(); $captcha = new Captcha(); $query="select * from ".$this->table." "; if($resultat = mysql_query($query,$captcha->link)){ $compteur = mysql_num_rows($resultat); if($compteur>0){ while ($row = mysql_fetch_object($resultat)){ $tableau[] = array($row->cap_libelle,$row->cap_image); } } mysql_free_result($resultat); } shuffle($tableau); for($j=0;$j<$nb_caratere;$j++){ $mot .= $tableau[$j][0]; $images[] = $tableau[$j][1]; } $_SESSION["crypto"] = $mot; $resultat = ''; for($i=0;$i'; } $resultat .= ''; return $resultat; } public function captcha_img(){ $captcha = new Captcha(); $img = $captcha->crypte(5); return $img; } } ?>