· 9 years ago · Jan 31, 2017, 10:34 AM
1-- phpMyAdmin SQL Dump
2-- version 3.3.9
3-- http://www.phpmyadmin.net
4--
5-- Serveur: localhost
6-- Généré le : Lun 04 Juillet 2011 à 14:08
7-- Version du serveur: 5.5.8
8-- Version de PHP: 5.3.5
9
10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
12/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
13/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
14/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
15/*!40101 SET NAMES utf8 */;
16
17--
18-- Base de données: `gsb_frais`
19--
20
21-- --------------------------------------------------------
22
23--
24-- Structure de la table `FraisForfait`
25--
26
27CREATE TABLE IF NOT EXISTS `fraisforfait` (
28 `id` char(3) NOT NULL,
29 `libelle` char(20) DEFAULT NULL,
30 `montant` decimal(5,2) DEFAULT NULL,
31 PRIMARY KEY (`id`)
32) ENGINE=InnoDB;
33
34
35-- --------------------------------------------------------
36
37--
38-- Structure de la table `Etat`
39--
40
41CREATE TABLE IF NOT EXISTS `etat` (
42 `id` char(2) NOT NULL,
43 `libelle` varchar(30) DEFAULT NULL,
44 PRIMARY KEY (`id`)
45) ENGINE=InnoDB;
46
47-- --------------------------------------------------------
48
49--
50-- Structure de la table `Visiteur`
51--
52
53CREATE TABLE IF NOT EXISTS `visiteur` (
54 `id` char(4) NOT NULL,
55 `nom` char(30) DEFAULT NULL,
56 `prenom` char(30) DEFAULT NULL,
57 `login` char(20) DEFAULT NULL,
58 `mdp` char(20) DEFAULT NULL,
59 `adresse` char(30) DEFAULT NULL,
60 `cp` char(5) DEFAULT NULL,
61 `ville` char(30) DEFAULT NULL,
62 `dateEmbauche` date DEFAULT NULL,
63 PRIMARY KEY (`id`)
64) ENGINE=InnoDB;
65
66
67-- --------------------------------------------------------
68
69--
70-- Structure de la table `FicheFrais`
71--
72
73CREATE TABLE IF NOT EXISTS `fichefrais` (
74 `idvisiteur` char(4) NOT NULL,
75 `mois` char(6) NOT NULL,
76 `nbjustificatifs` int(11) DEFAULT NULL,
77 `montantvalide` decimal(10,2) DEFAULT NULL,
78 `datemodif` date DEFAULT NULL,
79 `idetat` char(2) DEFAULT 'CR',
80 PRIMARY KEY (`idvisiteur`,`mois`),
81 FOREIGN KEY (`idetat`) REFERENCES etat(`id`),
82 FOREIGN KEY (`idvisiteur`) REFERENCES visiteur(`id`)
83) ENGINE=InnoDB;
84
85
86-- --------------------------------------------------------
87
88--
89-- Structure de la table `LigneFraisForfait`
90--
91
92CREATE TABLE IF NOT EXISTS `lignefraisforfait` (
93 `idvisiteur` char(4) NOT NULL,
94 `mois` char(6) NOT NULL,
95 `idfraisforfait` char(3) NOT NULL,
96 `quantite` int(11) DEFAULT NULL,
97 PRIMARY KEY (`idvisiteur`,`mois`,`idfraisforfait`),
98 FOREIGN KEY (`idvisiteur`, `mois`) REFERENCES fichefrais(`idvisiteur`, `mois`),
99 FOREIGN KEY (`idfraisforfait`) REFERENCES fraisforfait(`id`)
100) ENGINE=InnoDB;
101
102-- --------------------------------------------------------
103
104--
105-- Structure de la table `LigneFraisHorsForfait`
106--
107
108CREATE TABLE IF NOT EXISTS `lignefraishorsforfait` (
109 `id` int(11) NOT NULL auto_increment,
110 `idvisiteur` char(4) NOT NULL,
111 `mois` char(6) NOT NULL,
112 `libelle` varchar(100) DEFAULT NULL,
113 `date` date DEFAULT NULL,
114 `montant` decimal(10,2) DEFAULT NULL,
115 PRIMARY KEY (id),
116 FOREIGN KEY (`idvisiteur`, `mois`) REFERENCES fichefrais(`idvisiteur`, `mois`)
117) ENGINE=InnoDB;