-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le :  lun. 14 mai 2018 à 16:56
-- Version du serveur :  5.7.19
-- Version de PHP :  7.1.9

START TRANSACTION;



--
-- Base de données :  `meeting`
--

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

--
-- Structure de la table `action_lieu`
--

CREATE TABLE IF NOT EXISTS `action_lieu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `action_lieu_region`
--

CREATE TABLE IF NOT EXISTS `action_lieu_region` (
  `action_lieu_id` int(11) NOT NULL,
  `region_id` int(11) NOT NULL,
  PRIMARY KEY (`action_lieu_id`,`region_id`),
  KEY `IDX_FE1081F9B0109B2D` (`action_lieu_id`),
  KEY `IDX_FE1081F998260155` (`region_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `action_type`
--

CREATE TABLE IF NOT EXISTS `action_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `action_type`
--

INSERT INTO `action_type` (`id`, `nom`) VALUES
(3, 'Table Ronde');

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

--
-- Structure de la table `affectation`
--

CREATE TABLE IF NOT EXISTS `affectation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `compte_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_F4DD61D3F2C56620` (`compte_id`),
  KEY `IDX_F4DD61D3B7BB80FF` (`superviseur_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `affectation_acheteur`
--

CREATE TABLE IF NOT EXISTS `affectation_acheteur` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demandeur_id` int(11) DEFAULT NULL,
  `acheteur_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6B565EAE95A6EE59` (`demandeur_id`),
  KEY `IDX_6B565EAE96A7BB5F` (`acheteur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `affectation_acheteur`
--

INSERT INTO `affectation_acheteur` (`id`, `demandeur_id`, `acheteur_id`) VALUES
(2, 32, 35),
(3, 43, 35);

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

--
-- Structure de la table `affectation_demande`
--

CREATE TABLE IF NOT EXISTS `affectation_demande` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demande_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E49BF91A80E95E18` (`demande_id`),
  KEY `IDX_E49BF91AB7BB80FF` (`superviseur_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `affectation_demandeur`
--

CREATE TABLE IF NOT EXISTS `affectation_demandeur` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demandeur_id` int(11) DEFAULT NULL,
  `representant_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D9D6DBA495A6EE59` (`demandeur_id`),
  KEY `IDX_D9D6DBA46C4A52F0` (`representant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `affectation_demandeur`
--

INSERT INTO `affectation_demandeur` (`id`, `demandeur_id`, `representant_id`) VALUES
(1, 32, 34),
(3, 32, 41),
(7, 43, 34),
(8, 43, 41);

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

--
-- Structure de la table `article`
--

CREATE TABLE IF NOT EXISTS `article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `designation1` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `designation2` tinytext COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `article`
--

INSERT INTO `article` (`id`, `designation1`, `designation2`) VALUES
(1, 'Article 1', 'Description 1'),
(2, 'Article 2', 'Description 2'),
(3, 'Article 3', 'Description 3'),
(4, 'Article 4', 'Description 4'),
(5, 'Article 5', 'Description 5'),
(6, 'Article 6', 'hdfthtfththfhfht');

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

--
-- Structure de la table `articles_compte`
--

CREATE TABLE IF NOT EXISTS `articles_compte` (
  `compte_id` int(11) NOT NULL,
  `article_id` int(11) NOT NULL,
  PRIMARY KEY (`compte_id`,`article_id`),
  KEY `IDX_75CE864DF2C56620` (`compte_id`),
  KEY `IDX_75CE864D7294869C` (`article_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `articles_compte`
--

INSERT INTO `articles_compte` (`compte_id`, `article_id`) VALUES
(1, 3),
(1, 5),
(1, 6);

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

--
-- Structure de la table `bon_commande`
--

CREATE TABLE IF NOT EXISTS `bon_commande` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demande_id` int(11) DEFAULT NULL,
  `status_commande` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `numero_commande` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date_commande` date NOT NULL,
  `date_create` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_159D957680E95E18` (`demande_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `bon_commande`
--

INSERT INTO `bon_commande` (`id`, `demande_id`, `status_commande`, `numero_commande`, `date_commande`, `date_create`) VALUES
(1, 1, '2', '5832875', '2018-02-28', '2018-02-28 10:42:33'),
(2, 1, '1', '52385', '2018-03-01', '2018-02-28 10:44:03'),
(3, 4, '2', '444', '2018-03-14', '2018-03-07 10:32:15'),
(4, 5, '1', '55632', '2018-03-28', '2018-03-07 10:32:42'),
(5, 4, '1', '52542', '2018-03-20', '2018-03-07 10:33:23'),
(6, 4, '1', '525', '2018-03-21', '2018-03-07 10:43:22'),
(7, 12, '2', 'ddd', '2018-03-21', '2018-03-07 14:28:37'),
(8, 12, '1', 'dd', '2018-03-21', '2018-03-07 14:29:05'),
(9, 8, '1', '582', '2018-03-28', '2018-03-07 14:34:44'),
(10, 13, '1', '5858', '2018-03-21', '2018-03-07 14:39:30');

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

--
-- Structure de la table `categorie`
--

CREATE TABLE IF NOT EXISTS `categorie` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `categorie`
--

INSERT INTO `categorie` (`id`, `nom`) VALUES
(1, 'Hôtel'),
(2, 'Restaurant');

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

--
-- Structure de la table `chat`
--

CREATE TABLE IF NOT EXISTS `chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sender_id` int(11) DEFAULT NULL,
  `demande_id` int(11) DEFAULT NULL,
  `dateCreation` datetime NOT NULL,
  `message` longtext COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_659DF2AAF624B39D` (`sender_id`),
  KEY `IDX_659DF2AA80E95E18` (`demande_id`)
) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `chat`
--

INSERT INTO `chat` (`id`, `sender_id`, `demande_id`, `dateCreation`, `message`) VALUES
(1, 17, 14, '2018-05-02 13:11:53', 'messag 1'),
(2, 17, 14, '2018-05-02 13:13:25', 'message 2'),
(3, 1, 14, '2018-05-02 13:20:12', 'message 3'),
(4, 17, 14, '2018-05-02 14:41:44', 'message 4'),
(5, 17, 14, '2018-05-02 14:42:05', 'message message message message'),
(6, 17, 14, '2018-05-02 14:42:52', 'mesahe'),
(7, 17, 14, '2018-05-02 14:43:03', 'message message message message'),
(8, 17, 14, '2018-05-02 14:44:11', 'ddffdf efreererer ererer'),
(9, 25, 14, '2018-05-02 14:50:09', 'dfddfdf'),
(10, 17, 14, '2018-05-02 14:50:20', 'dfdfdfdffdfd'),
(11, 25, 14, '2018-05-02 14:53:33', 'sdsdsdsdsdsdsd'),
(12, 17, 14, '2018-05-02 14:54:19', 'deededed'),
(13, 17, 14, '2018-05-02 14:54:57', 'sdsdsdsd'),
(14, 25, 14, '2018-05-02 14:57:02', 'ffffff'),
(15, 17, 14, '2018-05-03 16:40:34', 'ddsdsd'),
(16, 17, 14, '2018-05-03 16:40:44', 'dsdsd'),
(17, 17, 14, '2018-05-03 16:41:27', 'zaineb'),
(18, 17, 14, '2018-05-04 08:23:38', 'fddfdfdf'),
(19, 17, 14, '2018-05-04 08:25:54', 'eded'),
(20, 17, 14, '2018-05-04 08:39:34', 'r'),
(21, 17, 14, '2018-05-04 08:40:24', 'a'),
(22, 17, 14, '2018-05-04 08:40:35', 'b'),
(23, 17, 14, '2018-05-04 08:43:42', 'xccxxc cxcxxc xcxccx cxcx'),
(24, 17, 14, '2018-05-04 08:46:40', 'sdsdsdsdsdsdsddsdsdsdsd'),
(25, 17, 14, '2018-05-04 08:46:52', 'x'),
(26, 17, 14, '2018-05-04 11:35:11', 'sqsqqssqssq'),
(27, 17, 14, '2018-05-04 11:38:26', 'gdgdd'),
(28, 17, 14, '2018-05-04 11:39:44', 'sfeefsef'),
(29, 25, 14, '2018-05-04 13:33:51', 'dssdsdsd'),
(30, 25, 14, '2018-05-04 13:35:29', 'slaut tt monde'),
(31, 17, 14, '2018-05-04 13:44:08', 'dffdff'),
(32, 17, 12, '2018-05-04 14:24:47', 'jghjg'),
(33, 17, NULL, '2018-05-04 14:50:54', 'dsdssd'),
(34, 17, NULL, '2018-05-04 14:50:57', 'sdsdsd'),
(35, 17, NULL, '2018-05-04 14:57:49', 'xssxsx'),
(36, 17, NULL, '2018-05-04 14:59:17', 'dfdfddffd'),
(37, 17, NULL, '2018-05-04 14:59:49', 'merci'),
(38, 17, NULL, '2018-05-04 15:00:12', 'mercic'),
(39, 17, NULL, '2018-05-04 15:00:27', 'ffggffg'),
(40, 17, NULL, '2018-05-04 15:09:33', 'merci'),
(41, 17, NULL, '2018-05-04 15:12:08', 'merci'),
(42, 17, 12, '2018-05-04 15:15:54', 'qsqqs'),
(43, 17, 13, '2018-05-04 15:16:14', 'merci'),
(44, 17, 1, '2018-05-04 15:16:43', 'vcvcvc'),
(45, 17, 1, '2018-05-04 15:16:47', 'vcvcvc'),
(46, 17, 1, '2018-05-04 15:16:56', 'merci pour votre reponse'),
(47, 17, 1, '2018-05-04 15:17:04', 'n'),
(48, 25, 7, '2018-05-04 15:45:12', 'demande 5'),
(49, 25, 14, '2018-05-04 15:45:52', 'meci'),
(50, 25, 14, '2018-05-04 15:46:10', 'fgfgffg'),
(51, 25, 14, '2018-05-04 15:47:58', 'demande 114'),
(52, 25, 7, '2018-05-04 15:48:18', 'demande 0107'),
(53, 25, 9, '2018-05-04 15:54:24', 'merci'),
(54, 25, 9, '2018-05-04 15:54:26', 'ddsdd'),
(55, 25, 8, '2018-05-04 15:54:35', 'sddsdss'),
(56, 25, 5, '2018-05-04 15:54:53', 'dedeed'),
(57, 25, 5, '2018-05-04 15:54:56', 'edededed'),
(58, 17, 12, '2018-05-07 08:01:35', 'ssdsddsd'),
(59, 17, 12, '2018-05-07 08:01:41', 'sdsdsdsdsd'),
(60, 17, 5, '2018-05-07 08:02:10', 'sdsd'),
(61, 17, 12, '2018-05-07 08:06:01', 'bienvenue demande 10'),
(62, 17, 5, '2018-05-07 08:06:12', 'bienvenue demande 3'),
(63, 17, 5, '2018-05-07 08:07:09', 'bienvenue demande 3'),
(64, 17, 13, '2018-05-07 08:07:26', 'bienvenue demande 10'),
(65, 17, 13, '2018-05-07 08:08:21', 'bienvenue demande 3'),
(66, 17, 5, '2018-05-07 08:41:27', 'bonjour'),
(67, 17, 13, '2018-05-07 08:41:41', 'tu es la ?'),
(68, 17, 1, '2018-05-07 08:41:53', 'ok'),
(69, 17, 5, '2018-05-07 08:45:48', 'ssqs'),
(70, 17, 13, '2018-05-07 08:45:55', 'dfdfdffd'),
(71, 17, NULL, '2018-05-07 10:27:49', 'xsxss'),
(72, 17, NULL, '2018-05-07 10:27:53', 'xsxss'),
(73, 17, NULL, '2018-05-07 10:28:30', 'xwwxw'),
(74, 17, NULL, '2018-05-07 10:28:36', 'xwwxwwxwxwx'),
(75, 17, NULL, '2018-05-07 10:29:02', 'xdvvdvxdv'),
(76, 17, NULL, '2018-05-07 10:29:09', 'dvdxvvdxxd'),
(77, 17, 12, '2018-05-07 10:30:25', 'qdsqdsqsdqdss'),
(78, 17, 12, '2018-05-07 10:30:27', 'sqddsqqsdds'),
(79, 17, 12, '2018-05-07 10:30:29', 'qdsdsqsqd'),
(80, 17, 13, '2018-05-07 10:31:31', 'swvxvxxwvwv'),
(81, 17, 12, '2018-05-07 10:34:47', 'qsqsqsqs'),
(82, 17, 12, '2018-05-07 10:34:56', 'sqqsqsqs'),
(83, 17, 12, '2018-05-07 10:35:21', 'xq<<qx<qx<qx'),
(84, 17, 13, '2018-05-07 10:35:34', 'seffefefefs'),
(85, 17, 12, '2018-05-07 11:48:32', 'qdzqzd'),
(86, 17, 12, '2018-05-07 11:48:37', 'qdzqzqdz'),
(87, 17, 12, '2018-05-07 11:51:41', 'qzdqzqzz'),
(88, 17, 13, '2018-05-07 11:51:48', 'qdqzzq'),
(89, 17, 1, '2018-05-07 11:51:55', 'dqzzdzqzd'),
(90, 17, 12, '2018-05-07 11:54:48', 'ddfdffdf'),
(91, 17, 14, '2018-05-07 11:58:33', 'cxxcxxcxc'),
(92, 25, 14, '2018-05-07 12:08:33', 'cxxcxcxxxccx'),
(93, 25, 7, '2018-05-07 12:09:48', 'xwwxxwwxwx'),
(94, 25, 12, '2018-05-07 12:12:00', 'xccxcxcx'),
(95, 25, 5, '2018-05-07 12:12:07', 'xcxcxccxxc'),
(96, 25, 9, '2018-05-07 12:12:12', 'xccxxcxc'),
(97, 25, 6, '2018-05-07 12:12:49', 'xccxxcxc'),
(98, 25, 11, '2018-05-07 12:13:03', 'xcxcx'),
(99, 25, 12, '2018-05-07 12:13:09', 'xccxxc'),
(100, 25, 5, '2018-05-07 12:13:25', 'dffddf'),
(101, 25, 1, '2018-05-07 12:13:33', 'dfdfdf'),
(102, 25, 8, '2018-05-07 12:13:43', 'dfdfdf'),
(103, 25, 10, '2018-05-07 12:13:49', 'dffddf'),
(104, 25, 11, '2018-05-07 12:13:54', 'fdfddfdf'),
(105, 25, 12, '2018-05-07 12:13:59', 'fddfdff'),
(106, 25, 12, '2018-05-07 12:14:09', 'fddfdf'),
(107, 25, 10, '2018-05-07 12:14:59', 'dfdfd'),
(108, 25, 14, '2018-05-07 12:15:13', 'sdsd'),
(109, 32, 14, '2018-05-07 12:21:53', 'wcwswsccwscw'),
(110, 32, 2, '2018-05-07 12:23:06', 'dffddffd'),
(111, 32, 7, '2018-05-07 12:23:11', 'dfdfdf'),
(112, 32, 2, '2018-05-07 12:23:19', 'dssdsd'),
(113, 32, 2, '2018-05-07 12:23:28', 'sdsdsd'),
(114, 32, 7, '2018-05-07 12:23:33', 'sdsdssd'),
(115, 32, 7, '2018-05-07 12:23:38', 'sdsdsd'),
(116, 32, 12, '2018-05-07 12:25:28', 'sddsdsd'),
(117, 32, 12, '2018-05-07 12:25:35', 'dssdsd'),
(118, 32, 4, '2018-05-07 12:25:44', 'sdsddsd'),
(119, 34, 14, '2018-05-07 12:27:44', 'wxwxwx'),
(120, 34, 2, '2018-05-07 12:28:49', 'cxxcxcxc'),
(121, 34, 12, '2018-05-07 12:30:32', 'xwwxwxwxx'),
(122, 34, 3, '2018-05-07 12:30:38', 'xwwxxwx'),
(123, 34, 5, '2018-05-07 12:30:44', 'wxwxwxx'),
(124, 34, 5, '2018-05-07 12:30:46', 'wxxwwx'),
(125, 35, 14, '2018-05-07 12:32:52', 'cxcxcxcx'),
(126, 35, 2, '2018-05-07 12:33:26', 'fddfdfdf'),
(127, 35, 7, '2018-05-07 12:33:32', 'fddffdfddf'),
(128, 35, 12, '2018-05-07 12:34:28', 'sdsdsdsd'),
(129, 35, 3, '2018-05-07 12:34:38', 'annuler'),
(130, 35, 13, '2018-05-07 12:39:28', 'dssdsdsd'),
(131, 35, 13, '2018-05-07 12:39:42', 'sddssd'),
(132, 35, 13, '2018-05-07 12:39:48', 'dsdssd'),
(133, 35, 5, '2018-05-07 12:40:56', 'sdsdsdsd'),
(134, 35, 3, '2018-05-07 12:41:11', 'sdsdsd'),
(135, 35, 3, '2018-05-07 12:41:15', 'dssdsd'),
(136, 35, 3, '2018-05-07 12:41:22', 'qdqdqdsqsd'),
(137, 35, 3, '2018-05-07 12:44:14', 'sefesfsef'),
(138, 35, 3, '2018-05-07 12:44:19', 'sfesefsef'),
(139, 35, 3, '2018-05-07 12:44:27', 'ffffffff'),
(140, 35, 3, '2018-05-07 12:44:38', 'esfefssse'),
(141, 35, 12, '2018-05-07 12:46:40', 'dfdfdfdff'),
(142, 35, 4, '2018-05-07 12:47:14', 'xcxcxccx'),
(143, 35, 4, '2018-05-07 12:47:26', 'cxcxxc'),
(144, 35, 4, '2018-05-07 12:47:47', 'sdsdsd'),
(145, 35, 4, '2018-05-07 12:47:54', 'sdssds'),
(146, 17, 14, '2018-05-07 13:37:04', 'sxsxsxs'),
(147, 17, 14, '2018-05-08 15:46:17', ' cvddgddggd'),
(148, 17, 14, '2018-05-08 16:35:21', 'thhtht'),
(149, 17, 14, '2018-05-09 10:14:16', 'dssdsd'),
(150, 22, 14, '2018-05-11 10:05:26', 'sdsdsdsd'),
(151, 22, 14, '2018-05-11 10:06:02', 'sdsdsdsd'),
(152, 22, 14, '2018-05-11 10:09:38', 'sdsdsdsd'),
(153, 22, 14, '2018-05-11 10:38:18', 'fddffddfdfdffd'),
(154, 22, 14, '2018-05-11 10:41:11', 'vcvccvcv'),
(155, 22, 14, '2018-05-11 10:48:18', 'cxxcxcxc'),
(156, 22, 14, '2018-05-11 10:49:47', 'sddsdsds'),
(157, 17, 14, '2018-05-11 10:54:24', 'xwwxwxwx'),
(158, 22, 14, '2018-05-11 11:00:10', 'trtrrttrtr'),
(159, 22, 14, '2018-05-11 11:10:10', 'dssdds'),
(160, 22, 14, '2018-05-11 11:10:20', 'dsdsds'),
(161, 17, 14, '2018-05-11 11:17:05', 'dsdsssddssdsdfsf'),
(162, 22, 14, '2018-05-11 11:19:22', 'cxxcxccx'),
(163, 22, 14, '2018-05-11 11:19:28', 'ccxc'),
(164, 22, 14, '2018-05-11 11:20:05', 'cxcxcxcxxc'),
(165, 22, 14, '2018-05-11 11:21:53', 'sqqsqs'),
(166, 22, 14, '2018-05-11 11:22:18', 'dssdsd'),
(167, 22, 14, '2018-05-11 11:24:13', 'dssds'),
(168, 22, 14, '2018-05-11 11:25:04', 'dssdsd'),
(169, 22, 14, '2018-05-11 12:50:14', 'dsdssdsdds'),
(170, 22, 14, '2018-05-11 12:54:37', 'sdsdsd'),
(171, 22, 14, '2018-05-11 12:55:16', 'dsdssd'),
(172, 22, 14, '2018-05-11 12:55:23', 'sddssdsd'),
(173, 22, 14, '2018-05-11 12:55:53', 'dssdsdsd'),
(174, 22, 14, '2018-05-11 12:56:22', 'sqsqqsqssq'),
(175, 22, 12, '2018-05-11 13:01:28', 'qzdqzdqzdqzd'),
(176, 22, 12, '2018-05-11 13:01:33', 'dzdzd'),
(177, 22, 1, '2018-05-11 13:02:33', 'hghghg'),
(178, 22, 13, '2018-05-11 13:03:13', 'hghgh'),
(179, 22, 12, '2018-05-11 13:03:34', 'salut'),
(180, 22, 5, '2018-05-11 13:06:36', 'ggggg'),
(181, 22, 12, '2018-05-11 13:11:01', 'ddfdffdffddf'),
(182, 22, 12, '2018-05-11 13:12:13', 's'),
(183, 22, 12, '2018-05-11 13:12:34', 'a'),
(184, 22, 12, '2018-05-11 13:13:37', 'qdzqz'),
(185, 22, 12, '2018-05-11 13:14:04', 'd'),
(186, 22, 12, '2018-05-11 13:14:30', 'd'),
(187, 22, 12, '2018-05-11 13:14:36', 'dddddd'),
(188, 22, 1, '2018-05-11 13:15:41', 'dssddss'),
(189, 22, 1, '2018-05-11 13:16:06', 'ezezzzeze'),
(190, 22, 12, '2018-05-11 13:16:44', 'yyyy'),
(191, 22, 5, '2018-05-11 13:17:22', 'grrgrgrggr'),
(192, 22, 5, '2018-05-11 13:18:49', 'rrre'),
(193, 22, 12, '2018-05-11 13:19:22', 'rrrr'),
(194, 22, 12, '2018-05-11 13:20:58', 'outlook'),
(195, 22, 12, '2018-05-11 13:29:48', 'dsdsd'),
(196, 22, 1, '2018-05-11 13:30:32', 'feefef'),
(197, 22, 12, '2018-05-11 13:31:55', 'dvvdvdvdvd'),
(198, 17, 12, '2018-05-11 14:12:46', 'undefined'),
(199, 17, 12, '2018-05-11 14:12:57', 'undefined'),
(200, 17, 12, '2018-05-11 14:15:10', '[object Object]'),
(201, 17, 12, '2018-05-11 14:15:25', '[object Object]'),
(202, 17, 12, '2018-05-11 14:15:38', '[object Object]'),
(203, 17, 12, '2018-05-11 14:25:17', 'undefined'),
(204, 17, 12, '2018-05-11 14:25:27', 'undefined'),
(205, 17, 12, '2018-05-11 14:42:19', 'qqQQ'),
(206, 17, 12, '2018-05-11 14:43:03', 'mrekfjdfsldjfshsmlkfjh'),
(207, 22, 12, '2018-05-11 14:43:32', 'ddsdsdsddssd'),
(208, 22, 14, '2018-05-11 14:46:31', 'ssdsdsdsd'),
(209, 22, 2, '2018-05-11 14:47:39', 'dssdsdsd'),
(210, 32, 14, '2018-05-11 14:52:15', 'vcvccvcv'),
(211, 32, 7, '2018-05-11 14:54:15', 'eerererer'),
(212, 32, 12, '2018-05-11 15:01:41', 'fgfgfff');

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

--
-- Structure de la table `compte`
--

CREATE TABLE IF NOT EXISTS `compte` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `charge_compte_id` int(11) DEFAULT NULL,
  `chef_projet_id` int(11) DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fax` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `siteWeb` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CFF652609B654C62` (`charge_compte_id`),
  KEY `IDX_CFF65260D3B0D67C` (`chef_projet_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `compte`
--

INSERT INTO `compte` (`id`, `charge_compte_id`, `chef_projet_id`, `name`, `ref`, `tel`, `fax`, `email`, `siteWeb`, `address`, `logo`, `status`) VALUES
(1, 17, NULL, 'Sanofi', 'MF-256325', '31 388 200', '79 108 420', 'Tunisie.Pharmacovigilance@sanofi.com', 'http://tn.sanofi.com/l/tn/fr/index.jsp', 'Avenue de Paris, Megrine', NULL, 1),
(2, 17, 22, 'Adwya', 'MF-256486', '31 388 400', '79 108 496', 'laboratoire@adwya.com', 'http://tn.adwya.com', 'Tunisie', NULL, 2),
(3, NULL, NULL, 'Compte', 'MF-869523', '72153698', '79153698', 'test@gamil.com', 'https://www.google.tn/', 'Nabeul', NULL, 0);

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

--
-- Structure de la table `compte_facturation`
--

CREATE TABLE IF NOT EXISTS `compte_facturation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `compte_facturation`
--

INSERT INTO `compte_facturation` (`id`, `name`, `ref`) VALUES
(1, 'Compte Facturation 3', 'MF-256987'),
(2, 'Compte Facturation 1', 'MF-963258'),
(3, 'Compte Facturation 2', 'MF-912458'),
(4, 'Compte Facturation 4', 'MF-256989'),
(5, 'Compte Fact 1', 'MF-759632'),
(6, 'Compte Fact 2', 'MF-759856');

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

--
-- Structure de la table `compte_user`
--

CREATE TABLE IF NOT EXISTS `compte_user` (
  `compte_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`compte_id`,`user_id`),
  KEY `IDX_D5ABD2D5F2C56620` (`compte_id`),
  KEY `IDX_D5ABD2D5A76ED395` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `compte_user`
--

INSERT INTO `compte_user` (`compte_id`, `user_id`) VALUES
(1, 32),
(1, 34),
(1, 35),
(1, 41),
(1, 43),
(1, 44),
(3, 40);

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

--
-- Structure de la table `delegation_demande`
--

CREATE TABLE IF NOT EXISTS `delegation_demande` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demande_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_56FA16C080E95E18` (`demande_id`),
  KEY `IDX_56FA16C0B7BB80FF` (`superviseur_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `demande`
--

CREATE TABLE IF NOT EXISTS `demande` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `createur_id` int(11) DEFAULT NULL,
  `compte_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  `user_af_id` int(11) DEFAULT NULL,
  `user_del_id` int(11) DEFAULT NULL,
  `type_action_id` int(11) DEFAULT NULL,
  `type_prestataire_id` int(11) DEFAULT NULL,
  `region_id` int(11) DEFAULT NULL,
  `prestataire_id` int(11) DEFAULT NULL,
  `compte_facturation_id` int(11) DEFAULT NULL,
  `status` int(11) NOT NULL,
  `passation` int(11) DEFAULT NULL,
  `reference` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `nomAction` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_fin` date DEFAULT NULL,
  `nbre_Pax` int(11) NOT NULL,
  `heure_reunion` time DEFAULT NULL,
  `heure_reunion2` time DEFAULT NULL,
  `heure_reunion3` time DEFAULT NULL,
  `heure_reunion4` time DEFAULT NULL,
  `heure_reunion5` time DEFAULT NULL,
  `heure_dejeuner` time DEFAULT NULL,
  `heure_diner` time DEFAULT NULL,
  `heure_pause_1` time DEFAULT NULL,
  `heure_pause_2` time DEFAULT NULL,
  `heure_pause_3` time DEFAULT NULL,
  `commentaire` tinytext COLLATE utf8_unicode_ci,
  `date_create` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_2694D7A573A201E5` (`createur_id`),
  KEY `IDX_2694D7A5F2C56620` (`compte_id`),
  KEY `IDX_2694D7A5B7BB80FF` (`superviseur_id`),
  KEY `IDX_2694D7A57FFE645` (`user_af_id`),
  KEY `IDX_2694D7A5FED75B76` (`user_del_id`),
  KEY `IDX_2694D7A529F4B125` (`type_action_id`),
  KEY `IDX_2694D7A5E8FE9B23` (`type_prestataire_id`),
  KEY `IDX_2694D7A598260155` (`region_id`),
  KEY `IDX_2694D7A5BE3DB2B7` (`prestataire_id`),
  KEY `IDX_2694D7A51BAC24F7` (`compte_facturation_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `demande`
--

INSERT INTO `demande` (`id`, `createur_id`, `compte_id`, `superviseur_id`, `user_af_id`, `user_del_id`, `type_action_id`, `type_prestataire_id`, `region_id`, `prestataire_id`, `compte_facturation_id`, `status`, `passation`, `reference`, `nomAction`, `date_debut`, `date_fin`, `nbre_Pax`, `heure_reunion`, `heure_reunion2`, `heure_reunion3`, `heure_reunion4`, `heure_reunion5`, `heure_dejeuner`, `heure_diner`, `heure_pause_1`, `heure_pause_2`, `heure_pause_3`, `commentaire`, `date_create`) VALUES
(1, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 4, 7, 0, '0101', 'ddd', '2018-02-15 22:00:00', '2018-02-15', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'dddd', '2018-02-13 13:25:07'),
(2, 32, 1, 22, 22, NULL, 3, 1, 1, 1, 1, 4, 1, '0102', 'dd', '2018-03-02 20:00:00', '2018-03-02', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'dgfhjk', '2018-02-28 13:24:48'),
(3, 32, 1, 37, 37, NULL, 3, 1, 1, 1, 1, 6, 0, '0103', 'Demande 1', '2018-03-16 20:00:00', '2018-03-16', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ddddddddddd', '2018-03-06 14:18:25'),
(4, 32, 1, 37, 37, NULL, 3, 1, 1, 1, 1, 6, 0, '0104', 'Demande 2', '2018-03-16 20:00:00', '2018-03-16', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'rtylmùµ', '2018-03-06 14:19:05'),
(5, 32, 1, 22, 22, NULL, 3, 1, 1, 1, 1, 7, 0, '0105', 'Demande 3', '2018-03-16 20:00:00', '2018-03-16', 85, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'dfgyuj', '2018-03-06 14:22:09'),
(6, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 6, 0, '0106', 'Demande 4', '2018-03-16 20:00:00', '2018-03-16', 44, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'dtfyuio', '2018-03-06 14:22:43'),
(7, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 4, 1, '0107', 'Demande 5', '2018-03-16 20:00:00', '2018-03-16', 53, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ccc', '2018-03-06 14:24:05'),
(8, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 6, 0, '0108', 'Demande 6', '2018-03-16 20:00:00', '2018-03-16', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ddd', '2018-03-06 14:24:51'),
(9, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 6, 0, '0109', 'Demande 7', '2018-03-16 20:00:00', '2018-03-16', 22, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ccccccc', '2018-03-06 14:25:25'),
(10, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 6, 0, '0110', 'Demande 8', '2018-03-16 20:00:00', '2018-03-16', 44, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ww', '2018-03-06 14:26:22'),
(11, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 6, 0, '0111', 'Demande 9', '2018-03-16 20:00:00', '2018-03-16', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'www', '2018-03-06 14:27:05'),
(12, 32, 1, 25, 25, NULL, 3, 1, 1, 1, 1, 7, 0, '0112', 'Demande 10', '2018-03-29 20:00:00', '2018-03-29', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ww', '2018-03-06 14:27:38'),
(13, 32, 1, 22, 22, NULL, 3, 1, 1, 1, 1, 7, 0, '0113', 'Demande 12', '2018-03-16 20:00:00', '2018-03-16', 58, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'kkkkkkkkkk', '2018-03-07 14:36:48'),
(14, 32, 1, 22, 22, NULL, 3, 1, 1, 1, 1, 3, 1, '0114', 'jjjjjjjjjj', '2018-03-16 20:00:00', '2018-03-16', 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'kkkk', '2018-03-07 14:37:49');

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

--
-- Structure de la table `demande_representant`
--

CREATE TABLE IF NOT EXISTS `demande_representant` (
  `demande_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`demande_id`,`user_id`),
  KEY `IDX_D71C49B380E95E18` (`demande_id`),
  KEY `IDX_D71C49B3A76ED395` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `demande_representant`
--

INSERT INTO `demande_representant` (`demande_id`, `user_id`) VALUES
(1, 34),
(2, 34),
(2, 41),
(3, 34),
(3, 41),
(4, 34),
(4, 41),
(5, 34),
(5, 41),
(6, 41),
(8, 34),
(8, 41),
(9, 34),
(9, 41),
(10, 34),
(10, 41),
(11, 34),
(12, 34),
(13, 34),
(13, 41),
(14, 34),
(14, 41);

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

--
-- Structure de la table `demande_variante`
--

CREATE TABLE IF NOT EXISTS `demande_variante` (
  `demande_id` int(11) NOT NULL,
  `variante_id` int(11) NOT NULL,
  PRIMARY KEY (`demande_id`,`variante_id`),
  KEY `IDX_115AF7280E95E18` (`demande_id`),
  KEY `IDX_115AF72D45162B6` (`variante_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `demande_variante`
--

INSERT INTO `demande_variante` (`demande_id`, `variante_id`) VALUES
(1, 1),
(2, 1),
(2, 2),
(3, 1),
(3, 2),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(7, 2),
(8, 1),
(8, 2),
(9, 1),
(10, 2),
(11, 2),
(12, 1),
(13, 2);

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

--
-- Structure de la table `departement`
--

CREATE TABLE IF NOT EXISTS `departement` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `departement`
--

INSERT INTO `departement` (`id`, `nom`) VALUES
(1, 'Département Laboratoire'),
(2, 'Département 1'),
(3, 'Département 2'),
(4, 'Département Logistique'),
(5, 'Département Administratif'),
(7, 'Département Logistique'),
(8, 'Département Ressources Humaines'),
(9, 'Département Administratif');

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

--
-- Structure de la table `departement_compte`
--

CREATE TABLE IF NOT EXISTS `departement_compte` (
  `compte_id` int(11) NOT NULL,
  `departement_id` int(11) NOT NULL,
  PRIMARY KEY (`compte_id`,`departement_id`),
  KEY `IDX_52B187A3F2C56620` (`compte_id`),
  KEY `IDX_52B187A3CCF9E01E` (`departement_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `departement_compte`
--

INSERT INTO `departement_compte` (`compte_id`, `departement_id`) VALUES
(1, 1),
(1, 4),
(1, 5),
(2, 2),
(2, 3),
(3, 7),
(3, 8),
(3, 9);

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

--
-- Structure de la table `entreprise`
--

CREATE TABLE IF NOT EXISTS `entreprise` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `super_admin_id` int(11) DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fax` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `siteWeb` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_D19FA60BBF91D3B` (`super_admin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `entreprise`
--

INSERT INTO `entreprise` (`id`, `super_admin_id`, `name`, `ref`, `tel`, `fax`, `email`, `siteWeb`, `address`, `logo`) VALUES
(1, 1, 'Millesima', 'MF-256325', '71 256 352', '79 108 420', 'millesima-travel@gmail.com', 'http://www.millesima-travel.com', 'El Manzah5 Ariane, Tunis', '45957085a798487178860.87060378.png');

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

--
-- Structure de la table `facturation_compte`
--

CREATE TABLE IF NOT EXISTS `facturation_compte` (
  `compte_id` int(11) NOT NULL,
  `compte_facturation_id` int(11) NOT NULL,
  PRIMARY KEY (`compte_id`,`compte_facturation_id`),
  KEY `IDX_6FCE0D45F2C56620` (`compte_id`),
  KEY `IDX_6FCE0D451BAC24F7` (`compte_facturation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `facturation_compte`
--

INSERT INTO `facturation_compte` (`compte_id`, `compte_facturation_id`) VALUES
(1, 1),
(1, 4),
(2, 2),
(2, 3),
(3, 5),
(3, 6);

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

--
-- Structure de la table `fournisseur`
--

CREATE TABLE IF NOT EXISTS `fournisseur` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `categorie_id` int(11) DEFAULT NULL,
  `region_id` int(11) DEFAULT NULL,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `nbretoiles` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `tel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fax` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `siteWeb` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_369ECA32BCF5E72D` (`categorie_id`),
  KEY `IDX_369ECA3298260155` (`region_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `fournisseur`
--

INSERT INTO `fournisseur` (`id`, `categorie_id`, `region_id`, `nom`, `nbretoiles`, `tel`, `fax`, `siteWeb`, `email`) VALUES
(1, 1, 1, 'Regency', '5', '71524863', '7956283', 'http://www.regency.com/', 'residence@gmail.com'),
(2, 1, 2, 'Badira', '5', '71256389', '75214825', 'http://www.badira.com/', 'badira@gmail.com'),
(3, 1, 2, 'El Mouradi', '5', '7152634', '7145263', 'http://www.ElMouradi.com/', 'ElMouradi@gmail.com'),
(4, 1, 1, 'Marina Place', '3', '71258963', '79586241', 'http://www.MarinaPlace.com/', 'MarinaPlace@gmail.com'),
(5, 1, 1, 'The residence', '5', '71452369', '79856321', 'http://www.residencetunis.com/', 'residence@gmail.com');

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

--
-- Structure de la table `fournisseurs_compte`
--

CREATE TABLE IF NOT EXISTS `fournisseurs_compte` (
  `compte_id` int(11) NOT NULL,
  `fournisseur_id` int(11) NOT NULL,
  PRIMARY KEY (`compte_id`,`fournisseur_id`),
  KEY `IDX_4ADC8D57F2C56620` (`compte_id`),
  KEY `IDX_4ADC8D57670C757F` (`fournisseur_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `fournisseurs_compte`
--

INSERT INTO `fournisseurs_compte` (`compte_id`, `fournisseur_id`) VALUES
(1, 1),
(1, 2),
(1, 5);

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

--
-- Structure de la table `region`
--

CREATE TABLE IF NOT EXISTS `region` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `region`
--

INSERT INTO `region` (`id`, `nom`) VALUES
(1, 'Tunisie'),
(2, 'Hammamet'),
(3, 'Sousse'),
(4, 'Monastir'),
(5, 'Gammarth');

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

--
-- Structure de la table `timeline`
--

CREATE TABLE IF NOT EXISTS `timeline` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `demande_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date_create` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_46FEC66680E95E18` (`demande_id`),
  KEY `IDX_46FEC666B7BB80FF` (`superviseur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `timeline`
--

INSERT INTO `timeline` (`id`, `demande_id`, `superviseur_id`, `status`, `date_create`) VALUES
(1, 1, 32, 'Dossier Crpar ', '2018-02-13 13:25:07'),
(2, 1, 25, 'Dossier Affecé té à ', '2018-02-28 10:31:40'),
(3, 1, 1, 'Dossier Confirmé par ', '2018-02-28 10:35:16'),
(4, 1, 1, 'Dossier validé par ', '2018-02-28 10:42:33'),
(5, 1, 1, 'Dossier Confirmé par ', '2018-02-28 10:43:38'),
(6, 1, 1, 'Dossier validé par ', '2018-02-28 10:44:03'),
(7, 1, 1, 'Dossier Clôturé par ', '2018-02-28 10:44:13'),
(8, 2, 32, 'Dossier Crpar ', '2018-02-28 13:24:48'),
(9, 3, 32, 'Dossier Crpar ', '2018-03-06 14:18:25'),
(10, 4, 32, 'Dossier Crpar ', '2018-03-06 14:19:05'),
(11, 5, 32, 'Dossier Crpar ', '2018-03-06 14:22:09'),
(12, 6, 32, 'Dossier Crpar ', '2018-03-06 14:22:43'),
(13, 7, 32, 'Dossier Crpar ', '2018-03-06 14:24:05'),
(14, 8, 32, 'Dossier Crpar ', '2018-03-06 14:24:51'),
(15, 9, 32, 'Dossier Crpar ', '2018-03-06 14:25:25'),
(16, 10, 32, 'Dossier Crpar ', '2018-03-06 14:26:22'),
(17, 11, 32, 'Dossier Crpar ', '2018-03-06 14:27:05'),
(18, 12, 32, 'Dossier Crpar ', '2018-03-06 14:27:38'),
(19, 12, 25, 'Dossier Affecé té à ', '2018-03-07 10:06:13'),
(20, 2, 22, 'Dossier Affecé té à ', '2018-03-07 10:20:30'),
(21, 4, 37, 'Dossier Affecé té à ', '2018-03-07 10:20:44'),
(22, 5, 22, 'Dossier Affecé té à ', '2018-03-07 10:20:58'),
(23, 3, 37, 'Dossier Affecé té à ', '2018-03-07 10:21:22'),
(24, 6, 25, 'Dossier Affecé té à ', '2018-03-07 10:23:38'),
(25, 7, 25, 'Dossier Affecé té à ', '2018-03-07 10:23:48'),
(26, 8, 25, 'Dossier Affecé té à ', '2018-03-07 10:23:58'),
(27, 9, 25, 'Dossier Affecé té à ', '2018-03-07 10:24:08'),
(28, 10, 25, 'Dossier Affecé té à ', '2018-03-07 10:24:19'),
(29, 2, 1, 'Dossier Regreté par ', '2018-03-07 10:25:15'),
(30, 3, 1, 'Dossier Confirmé par ', '2018-03-07 10:30:46'),
(31, 4, 1, 'Dossier Confirmé par ', '2018-03-07 10:30:53'),
(32, 5, 1, 'Dossier Confirmé par ', '2018-03-07 10:30:59'),
(33, 12, 1, 'Dossier Confirmé par ', '2018-03-07 10:31:09'),
(34, 6, 1, 'Dossier Annulé par ', '2018-03-07 10:31:22'),
(35, 3, 1, 'Dossier Annulé par ', '2018-03-07 10:31:53'),
(36, 4, 1, 'Dossier validé par ', '2018-03-07 10:32:15'),
(37, 5, 1, 'Dossier validé par ', '2018-03-07 10:32:42'),
(38, 4, 1, 'Dossier Confirmé par ', '2018-03-07 10:33:00'),
(39, 4, 1, 'Dossier validé par ', '2018-03-07 10:33:23'),
(40, 4, 1, 'Dossier Confirmé par ', '2018-03-07 10:42:51'),
(41, 4, 1, 'Dossier validé par ', '2018-03-07 10:43:22'),
(42, 4, 1, 'Dossier Annulé par ', '2018-03-07 10:43:48'),
(43, 5, 1, 'Dossier Clôturé par ', '2018-03-07 10:43:54'),
(44, 11, 25, 'Dossier Affecé té à ', '2018-03-07 10:44:33'),
(45, 11, 25, 'Dossier Annulé par ', '2018-03-07 13:21:13'),
(46, 10, 25, 'Dossier Annulé par ', '2018-03-07 13:21:48'),
(47, 10, 25, 'Dossier Annulé par ', '2018-03-07 13:21:53'),
(48, 12, 25, 'Dossier validé par ', '2018-03-07 14:28:37'),
(49, 12, 25, 'Dossier Confirmé par ', '2018-03-07 14:28:48'),
(50, 12, 25, 'Dossier validé par ', '2018-03-07 14:29:05'),
(51, 12, 25, 'Dossier Confirmé par ', '2018-03-07 14:29:16'),
(52, 12, 25, 'Dossier validé par ', '2018-03-07 14:29:26'),
(53, 12, 25, 'Dossier Clôturé par ', '2018-03-07 14:29:35'),
(54, 7, 25, 'Dossier Regreté par ', '2018-03-07 14:33:34'),
(55, 8, 25, 'Dossier Confirmé par ', '2018-03-07 14:33:57'),
(56, 9, 25, 'Dossier Confirmé par ', '2018-03-07 14:34:05'),
(57, 8, 25, 'Dossier validé par ', '2018-03-07 14:34:44'),
(58, 9, 25, 'Dossier Annulé par ', '2018-03-07 14:34:50'),
(59, 8, 25, 'Dossier Annulé par ', '2018-03-07 14:35:31'),
(60, 13, 32, 'Dossier Crpar ', '2018-03-07 14:36:48'),
(61, 14, 32, 'Dossier Crpar ', '2018-03-07 14:37:49'),
(62, 13, 22, 'Dossier Affecé té à ', '2018-03-07 14:38:42'),
(63, 14, 22, 'Dossier Affecé té à ', '2018-03-07 14:38:51'),
(64, 13, 17, 'Dossier Confirmé par ', '2018-03-07 14:39:02'),
(65, 14, 17, 'Dossier Regreté par ', '2018-03-07 14:39:09'),
(66, 13, 17, 'Dossier validé par ', '2018-03-07 14:39:30'),
(67, 13, 17, 'Dossier Confirmé par ', '2018-03-07 14:39:39'),
(68, 13, 17, 'Dossier validé par ', '2018-03-07 14:39:51'),
(69, 13, 17, 'Dossier Clôturé par ', '2018-03-07 14:39:59'),
(73, 7, 32, 'Dossier Mis à jour par ', '2018-03-08 16:41:27'),
(74, 2, 32, 'Dossier Mis à jour par ', '2018-03-08 16:42:09'),
(75, 2, 32, 'Dossier Mis à jour par ', '2018-03-08 16:58:24'),
(76, 7, 17, 'Dossier Confirmé par ', '2018-04-25 11:09:34'),
(77, 2, 17, 'Dossier Confirmé par ', '2018-04-25 11:09:55');

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

--
-- Structure de la table `timeline_compte`
--

CREATE TABLE IF NOT EXISTS `timeline_compte` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `compte_id` int(11) DEFAULT NULL,
  `superviseur_id` int(11) DEFAULT NULL,
  `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date_create` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5069D848F2C56620` (`compte_id`),
  KEY `IDX_5069D848B7BB80FF` (`superviseur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `timeline_compte`
--

INSERT INTO `timeline_compte` (`id`, `compte_id`, `superviseur_id`, `status`, `date_create`) VALUES
(1, 1, 17, 'Compte Affecté à ', '2018-02-09 14:21:26'),
(2, 2, 24, 'Compte Affecté à ', '2018-02-09 14:21:40'),
(3, 2, 22, 'Compte Délégué à ', '2018-02-09 14:21:56'),
(4, 2, 17, 'Compte Affecté à ', '2018-02-09 14:39:29'),
(5, 2, 22, 'Compte Délégué à ', '2018-02-09 14:39:36');

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

--
-- Structure de la table `variante`
--

CREATE TABLE IF NOT EXISTS `variante` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fournisseur_id` int(11) DEFAULT NULL,
  `article_id` int(11) DEFAULT NULL,
  `compte_id` int(11) DEFAULT NULL,
  `prix` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_474CE6B0670C757F` (`fournisseur_id`),
  KEY `IDX_474CE6B07294869C` (`article_id`),
  KEY `IDX_474CE6B0F2C56620` (`compte_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `variante`
--

INSERT INTO `variante` (`id`, `fournisseur_id`, `article_id`, `compte_id`, `prix`) VALUES
(1, 1, 2, 1, 150),
(2, 1, 3, 1, 125.2),
(3, 2, 3, 1, 157.45);

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `action_lieu_region`
--
ALTER TABLE `action_lieu_region`
  ADD CONSTRAINT `FK_FE1081F998260155` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_FE1081F9B0109B2D` FOREIGN KEY (`action_lieu_id`) REFERENCES `action_lieu` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `affectation`
--
ALTER TABLE `affectation`
  ADD CONSTRAINT `FK_F4DD61D3B7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_F4DD61D3F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`);

--
-- Contraintes pour la table `affectation_acheteur`
--
ALTER TABLE `affectation_acheteur`
  ADD CONSTRAINT `FK_6B565EAE95A6EE59` FOREIGN KEY (`demandeur_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_6B565EAE96A7BB5F` FOREIGN KEY (`acheteur_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `affectation_demande`
--
ALTER TABLE `affectation_demande`
  ADD CONSTRAINT `FK_E49BF91A80E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`),
  ADD CONSTRAINT `FK_E49BF91AB7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `affectation_demandeur`
--
ALTER TABLE `affectation_demandeur`
  ADD CONSTRAINT `FK_D9D6DBA46C4A52F0` FOREIGN KEY (`representant_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_D9D6DBA495A6EE59` FOREIGN KEY (`demandeur_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `articles_compte`
--
ALTER TABLE `articles_compte`
  ADD CONSTRAINT `FK_75CE864D7294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_75CE864DF2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `bon_commande`
--
ALTER TABLE `bon_commande`
  ADD CONSTRAINT `FK_159D957680E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`);

--
-- Contraintes pour la table `chat`
--
ALTER TABLE `chat`
  ADD CONSTRAINT `FK_659DF2AA80E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`),
  ADD CONSTRAINT `FK_659DF2AAF624B39D` FOREIGN KEY (`sender_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `compte`
--
ALTER TABLE `compte`
  ADD CONSTRAINT `FK_CFF652609B654C62` FOREIGN KEY (`charge_compte_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_CFF65260D3B0D67C` FOREIGN KEY (`chef_projet_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `compte_user`
--
ALTER TABLE `compte_user`
  ADD CONSTRAINT `FK_D5ABD2D5A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_D5ABD2D5F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `delegation_demande`
--
ALTER TABLE `delegation_demande`
  ADD CONSTRAINT `FK_56FA16C080E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`),
  ADD CONSTRAINT `FK_56FA16C0B7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `demande`
--
ALTER TABLE `demande`
  ADD CONSTRAINT `FK_2694D7A51BAC24F7` FOREIGN KEY (`compte_facturation_id`) REFERENCES `compte_facturation` (`id`),
  ADD CONSTRAINT `FK_2694D7A529F4B125` FOREIGN KEY (`type_action_id`) REFERENCES `action_type` (`id`),
  ADD CONSTRAINT `FK_2694D7A573A201E5` FOREIGN KEY (`createur_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_2694D7A57FFE645` FOREIGN KEY (`user_af_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_2694D7A598260155` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`),
  ADD CONSTRAINT `FK_2694D7A5B7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_2694D7A5BE3DB2B7` FOREIGN KEY (`prestataire_id`) REFERENCES `fournisseur` (`id`),
  ADD CONSTRAINT `FK_2694D7A5E8FE9B23` FOREIGN KEY (`type_prestataire_id`) REFERENCES `categorie` (`id`),
  ADD CONSTRAINT `FK_2694D7A5F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`),
  ADD CONSTRAINT `FK_2694D7A5FED75B76` FOREIGN KEY (`user_del_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `demande_representant`
--
ALTER TABLE `demande_representant`
  ADD CONSTRAINT `FK_D71C49B380E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_D71C49B3A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `demande_variante`
--
ALTER TABLE `demande_variante`
  ADD CONSTRAINT `FK_115AF7280E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_115AF72D45162B6` FOREIGN KEY (`variante_id`) REFERENCES `variante` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `departement_compte`
--
ALTER TABLE `departement_compte`
  ADD CONSTRAINT `FK_52B187A3CCF9E01E` FOREIGN KEY (`departement_id`) REFERENCES `departement` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_52B187A3F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `entreprise`
--
ALTER TABLE `entreprise`
  ADD CONSTRAINT `FK_D19FA60BBF91D3B` FOREIGN KEY (`super_admin_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `facturation_compte`
--
ALTER TABLE `facturation_compte`
  ADD CONSTRAINT `FK_6FCE0D451BAC24F7` FOREIGN KEY (`compte_facturation_id`) REFERENCES `compte_facturation` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_6FCE0D45F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `fournisseur`
--
ALTER TABLE `fournisseur`
  ADD CONSTRAINT `FK_369ECA3298260155` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`),
  ADD CONSTRAINT `FK_369ECA32BCF5E72D` FOREIGN KEY (`categorie_id`) REFERENCES `categorie` (`id`);

--
-- Contraintes pour la table `fournisseurs_compte`
--
ALTER TABLE `fournisseurs_compte`
  ADD CONSTRAINT `FK_4ADC8D57670C757F` FOREIGN KEY (`fournisseur_id`) REFERENCES `fournisseur` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_4ADC8D57F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `timeline`
--
ALTER TABLE `timeline`
  ADD CONSTRAINT `FK_46FEC66680E95E18` FOREIGN KEY (`demande_id`) REFERENCES `demande` (`id`),
  ADD CONSTRAINT `FK_46FEC666B7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `timeline_compte`
--
ALTER TABLE `timeline_compte`
  ADD CONSTRAINT `FK_5069D848B7BB80FF` FOREIGN KEY (`superviseur_id`) REFERENCES `user` (`id`),
  ADD CONSTRAINT `FK_5069D848F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`);

--
-- Contraintes pour la table `variante`
--
ALTER TABLE `variante`
  ADD CONSTRAINT `FK_474CE6B0670C757F` FOREIGN KEY (`fournisseur_id`) REFERENCES `fournisseur` (`id`),
  ADD CONSTRAINT `FK_474CE6B07294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`),
  ADD CONSTRAINT `FK_474CE6B0F2C56620` FOREIGN KEY (`compte_id`) REFERENCES `compte` (`id`);
COMMIT;

