Subversion Repositories Applications.annuaire

Rev

Rev 162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 162 Rev 167
Line 22... Line 22...
22
		
22
		
23
		if(!$bdd || !$nom_table) {
23
		if(!$bdd || !$nom_table) {
24
			return false;
24
			return false;
Line 25... Line 25...
25
		}
25
		}
-
 
26
		
Line 26... Line 27...
26
		
27
		$requete_presence_table = 'SELECT * FROM information_schema.tables
Line 27... Line 28...
27
		$requete = 'DESCRIBE '.$bdd.'.'.$nom_table;
28
		WHERE TABLE_SCHEMA = '.$this->proteger($bdd).' AND TABLE_NAME = '.$this->proteger($nom_table);
28
		
29
		
Line 29... Line 30...
29
		$resultat = $this->requeteUn($requete);
30
		$presence_table = $this->requeteUn($requete_presence_table);
Line 30... Line 31...
30
		
31
		
Line 115... Line 116...
115
		
116
		
116
		return $id_annuaire;
117
		return $id_annuaire;
Line 117... Line 118...
117
	}
118
	}
-
 
119
	
-
 
120
	public function creerTableAnnuaire($informations_table, $informations_champs) {
-
 
121
				
-
 
122
		$nom_bdd = $informations_table['aa_bdd'];
-
 
123
		$nom_table = $informations_table['aa_table'];
-
 
124
		
-
 
125
		$champ_id = $informations_champs['aa_champ_id'];
-
 
126
		$champ_nom = $informations_champs['aa_champ_nom'];
Line 118... Line -...
118
	
-
 
119
	public function creerTableAnnuaire($informations_table, $informations_champs) {
-
 
120
		
-
 
121
		$nom_bdd = $this->proteger($informations_table['nom_bdd']);
-
 
122
		$nom_table = $this->proteger($informations_table['nom_table']);
-
 
123
		
-
 
124
		$champ_id = $this->proteger($informations_champs['champ_id']);
-
 
125
		$champ_nom = $this->proteger($informations_champs['champ_id']);
-
 
126
		$champ_mail = $this->proteger($informations_champs['champ_id']);
127
		$champ_mail = $informations_champs['aa_champ_mail'];
127
		$champ_mot_de_passe = $this->proteger($informations_champs['champ_id']);
128
		$champ_mot_de_passe = $informations_champs['aa_champ_pass'];
128
		
129
		
129
		$requete_creation_table = 'CREATE TABLE '.$bdd.'.'.$nom_table.' '.
130
		$requete_creation_table = 'CREATE TABLE '.$nom_bdd.'.'.$nom_table.' '.
130
									'('.$champ_id.' INT NOT NULL AUTO_INCREMENT PRIMARY KEY,'. 
131
									'('.$champ_id.' INT NOT NULL AUTO_INCREMENT PRIMARY KEY,'. 
131
									$champ_nom.' TEXT NOT NULL,'. 
-
 
132
									$champ_mail.' TEXT NOT NULL)'. 
-
 
133
									$champ_mot_de_passe.' TEXT NOT NULL)';
-
 
134
									//'ENGINE = MyISAM' ;
-
 
Line 135... Line 132...
135
									
132
									$champ_nom.' VARCHAR(255) NOT NULL, '. 
Line 136... Line 133...
136
		echo $requete_creation_table;
133
									$champ_mail.' VARCHAR(255) NOT NULL, '.