-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 14, 2018 at 03:27 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.8

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!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 */;

--
-- Database: `gestionpersonnel`
--

-- --------------------------------------------------------

--
-- Table structure for table `bilan`
--

CREATE TABLE IF NOT EXISTS `bilan` (
  `idBilan` int(5) NOT NULL,
  `periode` varchar(45) NOT NULL,
  `annee` int(4) NOT NULL,
  `production` varchar(255) NOT NULL,
  `idProjet` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `employe`
--

CREATE TABLE IF NOT EXISTS `employe` (
  `idEmploye` int(5) NOT NULL,
  `nom` varchar(45) NOT NULL,
  `prenom` varchar(45) NOT NULL,
  `age` int(4) NOT NULL,
  `adresse` text NOT NULL,
  `service` varchar(45) DEFAULT NULL,
  `direction` varchar(45) DEFAULT NULL,
  `typeEmploye` varchar(45) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `employe`
--

INSERT INTO `employe` (`idEmploye`, `nom`, `prenom`, `age`, `adresse`, `service`, `direction`, `typeEmploye`) VALUES
(1, 'ben ali', 'karim', 25, 'Bejaia', NULL, NULL, 'Employé Simple'),
(2, 'hassaoui', 'ali', 35, 'Alger', 'Personnel', NULL, 'Chef Service'),
(3, 'Touahria', 'Toufik', 43, 'Bejaia', NULL, NULL, 'Employé Simple'),
(4, 'Benharoun', 'Samir', 39, 'Akbou', 'Paie', NULL, 'Chef Service'),
(5, 'bouchaker', 'salah', 55, 'boukhiama', NULL, NULL, 'Employé Simple'),
(6, 'Taguelmimt', 'reda', 23, 'Lqouds', 'Paie', NULL, 'Chef Service');

-- --------------------------------------------------------

--
-- Table structure for table `participe`
--

CREATE TABLE IF NOT EXISTS `participe` (
  `idEmploye` int(5) NOT NULL,
  `idProjet` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `projet`
--

CREATE TABLE IF NOT EXISTS `projet` (
  `idProjet` int(5) NOT NULL,
  `intitule` varchar(255) NOT NULL,
  `code` varchar(20) NOT NULL,
  `description` text NOT NULL,
  `duree` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bilan`
--
ALTER TABLE `bilan`
  ADD PRIMARY KEY (`idBilan`), ADD KEY `idProjet` (`idProjet`);

--
-- Indexes for table `employe`
--
ALTER TABLE `employe`
  ADD PRIMARY KEY (`idEmploye`);

--
-- Indexes for table `participe`
--
ALTER TABLE `participe`
  ADD PRIMARY KEY (`idEmploye`,`idProjet`), ADD KEY `fk_participe_projet` (`idProjet`);

--
-- Indexes for table `projet`
--
ALTER TABLE `projet`
  ADD PRIMARY KEY (`idProjet`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bilan`
--
ALTER TABLE `bilan`
  MODIFY `idBilan` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `employe`
--
ALTER TABLE `employe`
  MODIFY `idEmploye` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `projet`
--
ALTER TABLE `projet`
  MODIFY `idProjet` int(5) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `bilan`
--
ALTER TABLE `bilan`
ADD CONSTRAINT `fk_bilan_projet` FOREIGN KEY (`idProjet`) REFERENCES `projet` (`idProjet`);

--
-- Constraints for table `participe`
--
ALTER TABLE `participe`
ADD CONSTRAINT `fk_participe_employe` FOREIGN KEY (`idEmploye`) REFERENCES `employe` (`idEmploye`),
ADD CONSTRAINT `fk_participe_projet` FOREIGN KEY (`idProjet`) REFERENCES `projet` (`idProjet`);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
