-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Mar 24 Décembre 2013 à 18:44
-- Version du serveur: 5.6.12-log
-- Version de PHP: 5.4.16

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

--
-- Base de données: `grh`
--
CREATE DATABASE IF NOT EXISTS `grh` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `grh`;

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

--
-- Structure de la table `contacts`
--

CREATE TABLE IF NOT EXISTS `contacts` (
  `id_contact` int(11) NOT NULL,
  `nom` varchar(20) NOT NULL,
  `prenom` varchar(20) NOT NULL,
  `departement` varchar(20) NOT NULL,
  `email` text NOT NULL,
  `object` varchar(20) NOT NULL,
  `message` varchar(40) NOT NULL,
  PRIMARY KEY (`id_contact`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `demandes`
--

CREATE TABLE IF NOT EXISTS `demandes` (
  `id_demande` int(11) NOT NULL,
  `nom` varchar(20) NOT NULL,
  `prenom` varchar(20) NOT NULL,
  `departement` varchar(20) NOT NULL,
  `cause` varchar(20) NOT NULL,
  `datedebut` date NOT NULL,
  `datefin` date NOT NULL,
  `nbrejours` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `statut` text NOT NULL,
  PRIMARY KEY (`id_demande`),
  UNIQUE KEY `nom` (`nom`),
  KEY `id_demande` (`id_demande`),
  KEY `nom_2` (`nom`),
  KEY `prenom` (`prenom`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='stocke les demandes des congés et d’absences ';

--
-- Contenu de la table `demandes`
--

INSERT INTO `demandes` (`id_demande`, `nom`, `prenom`, `departement`, `cause`, `datedebut`, `datefin`, `nbrejours`, `type`, `statut`) VALUES
(1, 'maamouri', 'syrine', 'info', 'malade', '0000-00-00', '0000-00-00', 4, 'absence', '');

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

--
-- Structure de la table `employees`
--

CREATE TABLE IF NOT EXISTS `employees` (
  `id_employe` int(11) NOT NULL,
  `nom` varchar(20) NOT NULL,
  `prenom` varchar(20) NOT NULL,
  `CIN` int(10) NOT NULL,
  `tel` int(10) NOT NULL,
  `etatcivil` varchar(20) NOT NULL,
  `dateN` date NOT NULL,
  `sexe` varchar(20) NOT NULL,
  `situation` varchar(20) NOT NULL,
  `nbreenfants` int(5) NOT NULL,
  `adresse` varchar(20) NOT NULL,
  `ville` varchar(20) NOT NULL,
  `email` varchar(20) NOT NULL,
  PRIMARY KEY (`id_employe`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `employees`
--

INSERT INTO `employees` (`id_employe`, `nom`, `prenom`, `CIN`, `tel`, `etatcivil`, `dateN`, `sexe`, `situation`, `nbreenfants`, `adresse`, `ville`, `email`) VALUES
(1, 'maamouri', 'syrine', 7457896, 22546789, 'dfdg', '2013-12-03', 'femme', 'célibataire', 0, 'tunisie', 'tunisie', 'dfjhjfhjer@gmail.com'),
(2, 'maamouri', 'amine', 56654655, 54878787, 'dsfds', '0000-00-00', 'homme', 'marié', 5, '1 rue gazella', 'tunisie', 'maamouri.ameni@gmail');

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

--
-- Structure de la table `fiche_paie`
--

CREATE TABLE IF NOT EXISTS `fiche_paie` (
  `id_paie` int(20) NOT NULL,
  `avances` int(20) NOT NULL,
  `prime presence` int(20) NOT NULL,
  `salaire brut` int(20) NOT NULL,
  `CNSS` int(20) NOT NULL,
  `impot revenu` int(20) NOT NULL,
  `indem_transport` int(20) NOT NULL,
  `indem_complementaire` int(20) NOT NULL,
  `autres_indem` int(20) NOT NULL,
  PRIMARY KEY (`id_paie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `fiche_statique`
--

CREATE TABLE IF NOT EXISTS `fiche_statique` (
  `N_statique` int(20) NOT NULL,
  `nbre_conge_demd` int(10) NOT NULL,
  `nbre_absence` int(10) NOT NULL,
  `nbre_H_supp` int(20) NOT NULL,
  `nbre_formations` int(20) NOT NULL,
  PRIMARY KEY (`N_statique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `fiche_statique`
--

INSERT INTO `fiche_statique` (`N_statique`, `nbre_conge_demd`, `nbre_absence`, `nbre_H_supp`, `nbre_formations`) VALUES
(1, 2, 15, 5, 3);

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

--
-- Structure de la table `formations`
--

CREATE TABLE IF NOT EXISTS `formations` (
  `id_formations` int(11) NOT NULL,
  `date_debut_f` date NOT NULL,
  `date_fin_f` date NOT NULL,
  `sujet_formations` varchar(30) NOT NULL,
  `lieu_formations` varchar(40) NOT NULL,
  PRIMARY KEY (`id_formations`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `formations`
--

INSERT INTO `formations` (`id_formations`, `date_debut_f`, `date_fin_f`, `sujet_formations`, `lieu_formations`) VALUES
(1, '2013-12-03', '2014-01-31', 'fomation web', 'CIFOD COM');

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

--
-- Structure de la table `horaires_hebdomataires`
--

CREATE TABLE IF NOT EXISTS `horaires_hebdomataires` (
  `id_heures` int(11) NOT NULL,
  `date_debut_h` date NOT NULL,
  `date_fin_h` date NOT NULL,
  `type_jour` varchar(20) NOT NULL,
  `nbre_jour_h_supp` int(11) NOT NULL,
  `cout_h_supp` int(11) NOT NULL,
  PRIMARY KEY (`id_heures`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `horaires_hebdomataires`
--

INSERT INTO `horaires_hebdomataires` (`id_heures`, `date_debut_h`, `date_fin_h`, `type_jour`, `nbre_jour_h_supp`, `cout_h_supp`) VALUES
(1, '2013-12-02', '2014-01-29', 'Repos', 12, 400);

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

--
-- Structure de la table `login`
--

CREATE TABLE IF NOT EXISTS `login` (
  `id_login` int(11) NOT NULL,
  `login` text NOT NULL,
  `password` text NOT NULL,
  `groupe` varchar(20) NOT NULL,
  PRIMARY KEY (`id_login`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `login`
--

INSERT INTO `login` (`id_login`, `login`, `password`, `groupe`) VALUES
(1, 'syrine', '123', 'admin'),
(2, 'amine', '1230', 'employe');

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

--
-- Structure de la table `situation_personnel`
--

CREATE TABLE IF NOT EXISTS `situation_personnel` (
  `id_situation` int(11) NOT NULL,
  `date_embauche` date NOT NULL,
  `diplome` varchar(20) NOT NULL,
  `departement` varchar(20) NOT NULL,
  `fonction` varchar(20) NOT NULL,
  PRIMARY KEY (`id_situation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `situation_personnel`
--

INSERT INTO `situation_personnel` (`id_situation`, `date_embauche`, `diplome`, `departement`, `fonction`) VALUES
(1, '2014-02-01', 'dev web', 'informatique', 'informatique'),
(2, '2013-12-03', 'informatique', 'infor', 'développeur');

--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `fiche_paie`
--
ALTER TABLE `fiche_paie`
  ADD CONSTRAINT `paie_employee` FOREIGN KEY (`id_paie`) REFERENCES `employees` (`id_employe`) ON DELETE CASCADE;

--
-- Contraintes pour la table `fiche_statique`
--
ALTER TABLE `fiche_statique`
  ADD CONSTRAINT `statique_employe` FOREIGN KEY (`N_statique`) REFERENCES `employees` (`id_employe`);

--
-- Contraintes pour la table `formations`
--
ALTER TABLE `formations`
  ADD CONSTRAINT `fprmations_emp` FOREIGN KEY (`id_formations`) REFERENCES `employees` (`id_employe`) ON DELETE CASCADE;

--
-- Contraintes pour la table `horaires_hebdomataires`
--
ALTER TABLE `horaires_hebdomataires`
  ADD CONSTRAINT `heures_emp` FOREIGN KEY (`id_heures`) REFERENCES `employees` (`id_employe`) ON DELETE CASCADE;

--
-- Contraintes pour la table `situation_personnel`
--
ALTER TABLE `situation_personnel`
  ADD CONSTRAINT `situation_emp` FOREIGN KEY (`id_situation`) REFERENCES `employees` (`id_employe`) ON DELETE CASCADE;

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