Précédent   Forum des professionnels en informatique > PHP > PHP & SGBD > PHP & MySQL
PHP & MySQL Forum d'entraide sur les fonctions MySQL avec PHP. Avant de poster -> FAQ MySQL, Cours MySQL et Sources MySQL. Pour les questions concernant le moteur MySQL plutôt que les fonctions PHP, merci d'utiliser le forum MySQL.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 30/06/2011, 23h37   #1
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
Par défaut Problème avec liste déroulante

salut
j'ai un problem avec ma liste deroulante

quand je enregistrer les valeurs du formulaire tous marche bien sauf le problem si par exemple je choisi dans ma liste deroulante famille article= consommable

il affiche sauf si n'éte pas déja enregistrer déja , c'est si comme il evite la repetition d'article dans la base

ce que je cherche : je veut que la liste deroulante accepte la selection meme si elle a ete déja choisi déja dans un autre article

exemple liste deroulante famille d'article : l'article toner et l'article papier peut etre deux article different mais la meme famille c'est a dire famille consommable

merci d'avance


premier script :
fichart.php

Code :
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
 
 
<form method="post" action="traitart.php" enctype='multipart/form-data'>
<fieldset>
<legend><big><b>Fiche article</b></big></legend></br></br>
 
<label> Code d'article : </label><input type="text" name="id_art" maxlength="10" size="14"/>
<label> famille d'article : </label>
<select name="li_art" style="width : 240px;">
<option selected="selected"></option>
 
<?php
mysql_connect("localhost","root", "");
mysql_select_db("bdd");
$requette = mysql_query("SELECT * FROM famillearticle ORDER BY li_art ASC")or die(mysql_error());
mysql_close();
While ($ligne = mysql_fetch_array($requette) AND $test==false)
{
  $li_art = $ligne['li_art'];
  ?>
  <option value="<?php echo $li_art ;?>"><?php echo $li_art;?>
 
  </option>
 
 
  <?php
 
} 
?>
</select><br/><br/>
<label> Désignation d'article : </label><input type="text" name="n_art" maxlength="16" size="25"/>
<label> Prix.U d'article :  </label><input type="text" name="p_u_art" maxlength="20" size="25"/><br/><br/>
<input type="submit" value="Ajouter"/><input type="reset" value="Annuler"></td>
 
</fieldset>
</form>
traitart.php

Code :
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
 
 
<?php
if (isset($_POST['id_art']) AND isset($_POST['li_art']) AND isset($_POST['n_art']) AND isset($_POST['p_u_art']))
{
 
  $id_art=$_POST['id_art'];
  $li_art=$_POST['li_art'];
  $n_art=$_POST['n_art'];
  $p_u_art=$_POST['p_u_art'];
 
  mysql_connect("localhost", "root", "");
  mysql_select_db("bdd");
  mysql_query("INSERT INTO article VALUES ('$id_art',$li_art', '$n_art', '$p_u_art') ");
 
 
  echo"Enregistrement inséré";
 
  include("art.php");
}
 
else
{
  include("art.php");
}
mysql_close();
?>
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/07/2011, 08h33   #2
Membre confirmé
 
Avatar de Retrokiller069
 
Homme Bertrand
Étudiant
Inscription : octobre 2010
Messages : 216
Détails du profil
Informations personnelles :
Nom : Homme Bertrand
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 216
Points : 268
Points : 268
Bonjour,

pourrais tu nous détaillés ta table famillearticle pour mieux voir comment elle marche stp?
__________________
Ce n'est pas ce que nous voulons faire qui est impossible mais ce sont les moyens à sa mise en oeuvre qui peuvent le paraître

Ps: N'oubliez pas SVP
Retrokiller069 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/07/2011, 20h44   #3
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
salut
voila mon frere la table famillearticle
et si ta compris ce que je veut faire essai s'il te plait de me donner un autre exemple simple a comprendre
merci

Code :
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
 
-- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- 
Serveur: localhost
-- Généré le : Ven 01 Juillet 2011 à 20:32
-- 
Version du serveur: 5.1.33
-- 
Version de PHP: 5.2.9-2
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
--
-- Base de données: `bdd`
--
 
-- --------------------------------------------------------
 
--
-- 
 
 
Structure de la table `famillearticle`
 
--
 
CREATE TABLE IF NOT EXISTS `famillearticle` (
  `id_fart` varchar(2) NOT NULL,
  `li_art` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `famillearticle`
--
 
INSERT INTO `famillearticle` (`id_fart`, `li_art`) VALUES
('Cx', 'Cosommable xerox'),
('Cd', 'Cosommable duplo');
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/07/2011, 21h04   #4
Membre chevronné
 
Avatar de micetf
 
Homme Fred
Professeur des Ecoles
Inscription : mai 2009
Messages : 503
Détails du profil
Informations personnelles :
Nom : Homme Fred
Localisation : France, Rhône (Rhône Alpes)

Informations professionnelles :
Activité : Professeur des Ecoles
Secteur : Enseignement

Informations forums :
Inscription : mai 2009
Messages : 503
Points : 701
Points : 701
Ne serait-ce pas plutôt la structure de la table article qui pose problème ?
micetf est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/07/2011, 21h47   #5
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
oui tu peut modifer ma table famille article
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/07/2011, 11h33   #6
Membre chevronné
 
Avatar de micetf
 
Homme Fred
Professeur des Ecoles
Inscription : mai 2009
Messages : 503
Détails du profil
Informations personnelles :
Nom : Homme Fred
Localisation : France, Rhône (Rhône Alpes)

Informations professionnelles :
Activité : Professeur des Ecoles
Secteur : Enseignement

Informations forums :
Inscription : mai 2009
Messages : 503
Points : 701
Points : 701
Citation:
Oui tu peux modifier ma table famillearticle
Je parlais de la table "article".
Je me demandais quelle était la clé primaire de cette table.
micetf est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/07/2011, 12h21   #7
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
Par défaut voila la table article svp la solution

la table article

Code :
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
 
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 03 Juillet 2011 à 09:05
-- Version du serveur: 5.1.36
-- Version de PHP: 5.3.0
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
--
-- Base de données: `bdd`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `article`
--
 
CREATE TABLE IF NOT EXISTS `article` (
  `id_art` varchar(10) NOT NULL,
  `li_art` varchar(20) NOT NULL,
  `n_art` varchar(16) NOT NULL,
  `p_u_art` double(10,2) NOT NULL,
  PRIMARY KEY (`id_art`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `article`
--
 
INSERT INTO `article` (`id_art`, `li_art`, `n_art`, `p_u_art`) VALUES
('', '0', '', 0.00),
('TRRR', 'FDGFD', 'DFGFD', 455.00);
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/07/2011, 13h25   #8
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
la cle primaire de la table article c id_art
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/07/2011, 13h55   #9
Rédacteur
 
Avatar de jreaux62
 
Homme Jérôme Réaux
Webdesigner
Inscription : août 2008
Messages : 2 993
Détails du profil
Informations personnelles :
Nom : Homme Jérôme Réaux
Âge : 45
Localisation : France, Pas de Calais (Nord Pas de Calais)

Informations professionnelles :
Activité : Webdesigner
Secteur : Arts - Culture

Informations forums :
Inscription : août 2008
Messages : 2 993
Points : 5 786
Points : 5 786
Envoyer un message via Skype™ à jreaux62
Bonjour,
afin de rendre le problème plus clair pour tous :
- table "famillearticle" => liste des familles (categories)
- table "article" => liste des articles
liaison :
- chaque article est lié à une famille
- une famille peut comporte plusieurs articles

Je te propose de MODIFIER tes tables :
Code :
1
2
3
4
5
6
CREATE TABLE IF NOT EXISTS `famillearticle` (
  `id_fam` int(10) NOT NULL AUTO_INCREMENT,
  `code_fart` varchar(2) NOT NULL,
  `li_art` varchar(20) NOT NULL
  PRIMARY KEY (`id_fam`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- id_fam => id de la famille : AUTO-INCREMENT = donc UNIQUE !
- code_fart => (ce que tu avais appelé id_fart !) : c'est juste un "code famille" (Cx, Cd, ....)
Code :
1
2
3
4
5
6
7
CREATE TABLE IF NOT EXISTS `article` (
  `id_art` int(10) NOT NULL AUTO_INCREMENT,
  `id_fam` int(10) NOT NULL,
  `n_art` varchar(16) NOT NULL,
  `p_u_art` double(10,2) NOT NULL,
  PRIMARY KEY (`id_art`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- id_art => id de l'article : AUTO-INCREMENT = donc UNIQUE !
- id_fam => id de la famille : PERMET DE LIER L'ARTICLE A UNE FAMILLE
Au lieu d'enregistrer le NOM de la famille (li_art), on enregistre son id_fam (id UNIQUE)

ENSUITE dans fichart.php :
la valeur transmise est id_fam
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
// connexion a la BD
// [........]
?>
<form method="post" action="traitart.php" enctype='multipart/form-data'>
[........]
	<label> famille d'article : </label>
	<select name="id_fam" style="width : 240px;">
		<option value="" selected="selected">...</option>
<?php	// liste deroulante des familles d'articles (categories)
	$requete = mysql_query("SELECT id_fam, li_art FROM famillearticle ORDER BY li_art ASC;")or die(mysql_error());
	While ($ligne = mysql_fetch_array($requete))
	{
?>
		<option value="<?php echo $ligne['id_fam'] ;?>"><?php echo $ligne['li_art'];?></option>
<?php	} ?>
	</select>
[........]
PUIS traitart.php :
on récupère id_fam
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
// connexion a la BD
// [........]
?>
<?php
if (isset($_POST['id_art']) AND isset($_POST['id_fam']) AND isset($_POST['n_art']) AND isset($_POST['p_u_art']))
{
	// recuperation des champs du formulaire
	$id_art		= 0;	// NOUVEL enregistrement
	$id_fam		= $_POST['id_fam'];
	$n_art		= $_POST['n_art'];
	$p_u_art	= $_POST['p_u_art'];
	// -----------------------
	// PROTECTION DES DONNEES avant insertion (!!! TRES IMPORTANT !!!)
	$id_art		= mysql_real_escape_string($id_art);
	$id_fam		= mysql_real_escape_string($id_fam);
	$n_art		= mysql_real_escape_string($n_art);
	$p_u_art	= mysql_real_escape_string($p_u_art);
	// -----------------------
	// Nouvel enregistrement : INSERTION EN BD
	mysql_query("INSERT INTO article (id_art, id_fam, n_art, p_u_art) VALUES ('".$id_art."', '"$id_fam."', '".$n_art."', '".$p_u_art."') ");
}
?>
$id_art = 0; // NOUVEL enregistrement
// -----------------------
// PROTECTION DES DONNEES avant insertion (!!! TRES IMPORTANT !!!)
voir : mysql_real_escape_string()

ENFIN pour AFFICHER les données de chaque article :
-> on effectue une requete de tables LIEES :
En effet, les tables "article" et "famillearticle" sont liées par id_fam !
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
// connexion a la BD
// [........]
?>
<?php	// listing des articles
	$req 	= "SELECT * FROM article ART ".
		" INNER JOIN famillearticle FAM ".
		" ON FAM.id_fam = ART.id_fam ".
		" ORDER BY ART.n_art ASC;";
	$requete = mysql_query($req)or die(mysql_error());
	While ($ligne = mysql_fetch_array($requete))
	{
 
		$id_art		=$ligne['id_art'];
		$li_art		=$ligne['li_art'];	// récupéré dans la table "famillearticle" grace a la jointure
		$n_art		=$ligne['n_art'];
		$p_u_art	=$ligne['p_u_art'];
?>
[........]
<?php
	}
?>
__________________
"Ce qui se conçoit bien s'énonce clairement - Et les mots pour le dire arrivent aisément."
Nicolas Boileau-Despréaux, Homme de lettres français (1636-1711), principal théoricien de l'esthétique classique.
Site perso Mes tutos DVP : Gestion-Affichage de Nouvelles - Affichage en tableau HTML - Fonctions de redimensionnement d'images
jreaux62 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/07/2011, 16h27   #10
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
JE VAIS ESSAI ET VOIR

je te rend la reponse demain matin parceque on se moment je me trouve au boulo
merci pour le detail tu me facilite la tache
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 04/07/2011, 16h53   #11
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
merci infiniment mon frere jreaux62 c fait trois mois je cherche la solution et voila un génie je ne sais quoi dire fréro franchement tu ma aidé tu sais je doit finir mon projet ce mois et je suis en 20%
parceque mon projet c facturation en php et c vraiment défficile pour moi

merci encore

j'ai une autre question si tu peut me répondre ca serai génial

tu sais maintenant dans mon projet je doit partir bosser sur la partie facture et pour ce la j'ai envisager de faire ca
date du jour ---- code client --
-------------------------------
code article ----- designation article-----qte à livree--- prix unit---tva--p.u. en ht --------montant

ce je cherche : je veut bien savoir comment faire pour cordonner le code d'article en liste deroulante avec désignation de 'article et ca je veut bien savoir comment lier le code d'article avec la designation d'article en liste deroulante
je t'envoie les table parceque je croie que je croie que j'ai un problem dans les table svp si ta une bon solution n'esite pas les fichier les meme

les tables
Code :
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
 
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Lun 04 Juillet 2011 à 11:51
-- Version du serveur: 5.1.36
-- Version de PHP: 5.3.0
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
--
-- Base de données: `bdd`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `appartient1`
--
 
CREATE TABLE IF NOT EXISTS `appartient1` (
  `ID_TREC` int(11) NOT NULL,
  `ID_REC` int(11) NOT NULL,
  PRIMARY KEY (`ID_TREC`,`ID_REC`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `appartient1`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `appartient3`
--
 
CREATE TABLE IF NOT EXISTS `appartient3` (
  `ID_UNM` int(11) NOT NULL,
  `ID_ART` int(11) NOT NULL,
  PRIMARY KEY (`ID_UNM`,`ID_ART`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `appartient3`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `article`
--
 
CREATE TABLE IF NOT EXISTS `article` (
  `id_art` int(10) NOT NULL AUTO_INCREMENT,
  `id_fam` int(10) NOT NULL,
  `n_art` varchar(16) NOT NULL,
  `p_u_art` double(10,2) NOT NULL,
  PRIMARY KEY (`id_art`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
 
--
-- Contenu de la table `article`
--
 
INSERT INTO `article` (`id_art`, `id_fam`, `n_art`, `p_u_art`) VALUES
(1, 1, 'HGFHGF', 67.00),
(2, 1, 'HGFHGF', 67.00),
(3, 1, 'HGFHGF', 67.00),
(4, 1, 'HGFHGF', 67.00);
 
-- --------------------------------------------------------
 
--
-- Structure de la table `bonlivraison`
--
 
CREATE TABLE IF NOT EXISTS `bonlivraison` (
  `ID_BL` int(11) NOT NULL AUTO_INCREMENT,
  `T_BL` varchar(25) NOT NULL,
  `SN_BL` int(11) NOT NULL,
  `D_BL` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `N_BL` time NOT NULL,
  `Q_BL` int(11) NOT NULL,
  PRIMARY KEY (`ID_BL`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `bonlivraison`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `bonreception`
--
 
CREATE TABLE IF NOT EXISTS `bonreception` (
  `ID_REC` int(11) NOT NULL AUTO_INCREMENT,
  `ID_FOR` int(11) NOT NULL,
  `ID_ART` int(11) NOT NULL,
  `D_REC` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `H_REC` time NOT NULL,
  `Q_REC` int(11) NOT NULL,
  PRIMARY KEY (`ID_REC`),
  UNIQUE KEY `ID_FOR` (`ID_FOR`,`ID_ART`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `bonreception`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `client`
--
 
CREATE TABLE IF NOT EXISTS `client` (
  `ID_client` int(11) NOT NULL AUTO_INCREMENT,
  `c_cli` varchar(2) NOT NULL,
  `n_cli` varchar(25) NOT NULL,
  `ad_cli` char(1) NOT NULL,
  `t_cli` int(11) NOT NULL,
  `fa_cli` int(11) NOT NULL,
  `E_cli` varchar(25) NOT NULL,
  `S_cli` varchar(25) NOT NULL,
  `N_rec` varchar(25) NOT NULL,
  `N_cafi` varchar(25) NOT NULL,
  `N_CH` varchar(25) NOT NULL,
  PRIMARY KEY (`ID_client`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
 
--
-- Contenu de la table `client`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `facture`
--
 
CREATE TABLE IF NOT EXISTS `facture` (
  `ID_fa` int(11) NOT NULL AUTO_INCREMENT,
  `id_reg` int(11) NOT NULL,
  `id_bl` int(11) NOT NULL,
  `id_cli` int(11) NOT NULL,
  `id_tv` int(11) NOT NULL,
  `id_tfa` int(11) NOT NULL,
  `t_fa` varchar(25) NOT NULL,
  `d_fa` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `h_fa` time NOT NULL,
  `q_fa` int(11) NOT NULL,
  `ht_fa` decimal(10,0) NOT NULL,
  `TVA_fa` decimal(10,0) NOT NULL,
  `ttc_fa` decimal(10,0) NOT NULL,
  `ti_fa` decimal(10,0) NOT NULL,
  PRIMARY KEY (`ID_fa`),
  UNIQUE KEY `id_reg` (`id_reg`,`id_bl`,`id_cli`,`id_tv`,`id_tfa`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `facture`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `famillearticle`
--
 
CREATE TABLE IF NOT EXISTS `famillearticle` (
  `id_fam` int(10) NOT NULL AUTO_INCREMENT,
  `code_fart` varchar(2) COLLATE latin1_bin NOT NULL,
  `li_art` varchar(20) COLLATE latin1_bin NOT NULL,
  PRIMARY KEY (`id_fam`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_bin AUTO_INCREMENT=2 ;
 
--
-- Contenu de la table `famillearticle`
--
 
INSERT INTO `famillearticle` (`id_fam`, `code_fart`, `li_art`) VALUES
(1, '', 'trtrghghhg');
 
-- --------------------------------------------------------
 
--
-- Structure de la table `fournisseur`
--
 
CREATE TABLE IF NOT EXISTS `fournisseur` (
  `id_for` int(11) NOT NULL,
  `n_for` varchar(25) NOT NULL,
  `ad_for` varchar(25) NOT NULL,
  `t_for` varchar(25) NOT NULL,
  `fa_for` varchar(25) NOT NULL,
  `e_for` varchar(25) NOT NULL,
  `s_for` varchar(25) NOT NULL,
  PRIMARY KEY (`id_for`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `fournisseur`
--
 
INSERT INTO `fournisseur` (`id_for`, `n_for`, `ad_for`, `t_for`, `fa_for`, `e_for`, `s_for`) VALUES
(54545, 'GFDG', 'CXCXC4', '333', '444444', 'CVCC', 'XCXCX');
 
-- --------------------------------------------------------
 
--
-- Structure de la table `magasin`
--
 
CREATE TABLE IF NOT EXISTS `magasin` (
  `id_ma` varchar(2) NOT NULL,
  `li_ma` varchar(25) NOT NULL,
  PRIMARY KEY (`id_ma`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `magasin`
--
 
INSERT INTO `magasin` (`id_ma`, `li_ma`) VALUES
('54', 'JGHJ'),
('fd', 'dfd'),
('MC', 'MAGASIN CENTRALE');
 
-- --------------------------------------------------------
 
--
-- Structure de la table `reglement`
--
 
CREATE TABLE IF NOT EXISTS `reglement` (
  `id_reg` int(11) NOT NULL AUTO_INCREMENT,
  `ty_reg` varchar(25) NOT NULL,
  PRIMARY KEY (`id_reg`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `reglement`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `stocker`
--
 
CREATE TABLE IF NOT EXISTS `stocker` (
  `li_art` varchar(20) NOT NULL,
  `id_art` int(10) NOT NULL,
  `n_art` varchar(16) NOT NULL,
  `p_u_art` decimal(10,2) NOT NULL,
  `ry` int(2) NOT NULL,
  `col` int(2) NOT NULL,
  `et` int(2) NOT NULL,
  `ca` int(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `stocker`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `taxe`
--
 
CREATE TABLE IF NOT EXISTS `taxe` (
  `ID_tv` int(11) NOT NULL AUTO_INCREMENT,
  `t_tv` decimal(2,0) NOT NULL,
  PRIMARY KEY (`ID_tv`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `taxe`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `typebonlivr`
--
 
CREATE TABLE IF NOT EXISTS `typebonlivr` (
  `ID_tbl` int(11) NOT NULL AUTO_INCREMENT,
  `id_rec` int(11) NOT NULL,
  `n_tbl` varchar(25) NOT NULL,
  PRIMARY KEY (`ID_tbl`),
  UNIQUE KEY `id_rec` (`id_rec`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `typebonlivr`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `typefacture`
--
 
CREATE TABLE IF NOT EXISTS `typefacture` (
  `ID_tfa` int(11) NOT NULL AUTO_INCREMENT,
  `n_tfa` varchar(25) NOT NULL,
  PRIMARY KEY (`ID_tfa`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `typefacture`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `typereception`
--
 
CREATE TABLE IF NOT EXISTS `typereception` (
  `id_trec` int(11) NOT NULL AUTO_INCREMENT,
  `n_rec` varchar(25) NOT NULL,
  PRIMARY KEY (`id_trec`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `typereception`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `uniteregion`
--
 
CREATE TABLE IF NOT EXISTS `uniteregion` (
  `ID_un` int(11) NOT NULL AUTO_INCREMENT,
  `id_rec` int(11) NOT NULL,
  `n_un` varchar(25) NOT NULL,
  PRIMARY KEY (`ID_un`),
  UNIQUE KEY `id_rec` (`id_rec`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `uniteregion`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `unitmesure`
--
 
CREATE TABLE IF NOT EXISTS `unitmesure` (
  `ID_unm` int(11) NOT NULL AUTO_INCREMENT,
  `n_unm` varchar(25) NOT NULL,
  PRIMARY KEY (`ID_unm`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
--
-- Contenu de la table `unitmesure`
--
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/07/2011, 17h00   #12
 
mahfoud beloufa
Inscription : juin 2010
Messages : 19
Détails du profil
Informations personnelles :
Nom : mahfoud beloufa

Informations forums :
Inscription : juin 2010
Messages : 19
Points : -6
Points : -6
un exemplaire de facture pour voir claire
attacher
Fichiers attachés
Type de fichier : rar photo facture.rar (135,2 Ko, 1 affichages)
beloufa26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 03h54.


 
 
 
 
Partenaires

Hébergement Web