text: -- phpMyAdmin SQL Dump
  -- version 4.7.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1:3306
  -- Generation Time: Feb 13, 2018 at 02:07 PM
  -- Server version: 5.7.19
  -- PHP Version: 5.6.31
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  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 utf8mb4 */;
  
  --
  -- Database: `habaka-fablab`
  --
  CREATE DATABASE IF NOT EXISTS `habaka-fablab` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
  USE `habaka-fablab`;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `cotisation`
  --
  
  DROP TABLE IF EXISTS `cotisation`;
  CREATE TABLE IF NOT EXISTS `cotisation` (
    `id_cotisation` int(11) NOT NULL AUTO_INCREMENT,
    `id_membre` int(4) NOT NULL,
    `date_paiement` date NOT NULL,
    `date_expiration` int(11) NOT NULL,
    `nbr_semestre` int(11) NOT NULL,
    PRIMARY KEY (`id_cotisation`),
    KEY `id_membre` (`id_membre`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `groups`
  --
  
  DROP TABLE IF EXISTS `groups`;
  CREATE TABLE IF NOT EXISTS `groups` (
    `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` varchar(20) NOT NULL,
    `description` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `groups`
  --
  
  INSERT INTO `groups` (`id`, `name`, `description`) VALUES
  (1, 'admin', 'Administrateur'),
  (2, 'members', 'Personnel');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `login_attempts`
  --
  
  DROP TABLE IF EXISTS `login_attempts`;
  CREATE TABLE IF NOT EXISTS `login_attempts` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(45) NOT NULL,
    `login` varchar(100) NOT NULL,
    `time` int(11) UNSIGNED DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `materiel`
  --
  
  DROP TABLE IF EXISTS `materiel`;
  CREATE TABLE IF NOT EXISTS `materiel` (
    `id_material` int(11) NOT NULL AUTO_INCREMENT,
    `nom_materiel` varchar(50) NOT NULL,
    `description` text,
    PRIMARY KEY (`id_material`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `membre`
  --
  
  DROP TABLE IF EXISTS `membre`;
  CREATE TABLE IF NOT EXISTS `membre` (
    `id_membre` int(4) NOT NULL AUTO_INCREMENT,
    `nom_membre` varchar(50) NOT NULL,
    `prenom_membre` varchar(50) NOT NULL,
    `sexe` varchar(15) DEFAULT NULL,
    `statut` varchar(15) DEFAULT NULL,
    `cin` int(12) DEFAULT NULL,
    `date_naissance` date NOT NULL,
    `adresse` varchar(100) NOT NULL,
    `tel_telma` varchar(13) DEFAULT NULL,
    `tel_orange` varchar(13) DEFAULT NULL,
    `tel_airtel` varchar(13) DEFAULT NULL,
    `email` varchar(50) DEFAULT NULL,
    `facebook` varchar(50) DEFAULT NULL,
    `photo` varchar(500) DEFAULT NULL,
    `remarque` text,
    `adhesion` date DEFAULT NULL,
    `recu_par` varchar(50) NOT NULL,
    PRIMARY KEY (`id_membre`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `membre`
  --
  
  INSERT INTO `membre` (`id_membre`, `nom_membre`, `prenom_membre`, `sexe`, `statut`, `cin`, `date_naissance`, `adresse`, `tel_telma`, `tel_orange`, `tel_airtel`, `email`, `facebook`, `photo`, `remarque`, `adhesion`, `recu_par`) VALUES
  (1, 'ANDRIAMALALA', 'Rahamefy Solofohanitra', 'M', 'Etudiant', 2147483647, '1997-06-01', 'Lot IVL 36 Dialambo', '348063580', '329834445', '', 'soloforahamefy@gmail.com', 'Solofo Andriamalala', NULL, '', '2017-08-03', 'Hirina');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `reservation`
  --
  
  DROP TABLE IF EXISTS `reservation`;
  CREATE TABLE IF NOT EXISTS `reservation` (
    `id_reservation` int(11) NOT NULL AUTO_INCREMENT,
    `objet_reservation` varchar(50) NOT NULL,
    `client_reservation` varchar(50) NOT NULL,
    `date_reservation` date NOT NULL,
    `heure_reservation` time NOT NULL,
    `etat_reservation` varchar(15) NOT NULL,
    PRIMARY KEY (`id_reservation`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE IF NOT EXISTS `users` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(45) NOT NULL,
    `username` varchar(100) DEFAULT NULL,
    `password` varchar(255) NOT NULL,
    `salt` varchar(255) DEFAULT NULL,
    `email` varchar(254) NOT NULL,
    `activation_code` varchar(40) DEFAULT NULL,
    `forgotten_password_code` varchar(40) DEFAULT NULL,
    `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL,
    `remember_code` varchar(40) DEFAULT NULL,
    `created_on` int(11) UNSIGNED NOT NULL,
    `last_login` int(11) UNSIGNED DEFAULT NULL,
    `active` tinyint(1) UNSIGNED DEFAULT NULL,
    `first_name` varchar(50) DEFAULT NULL,
    `last_name` varchar(50) DEFAULT NULL,
    `company` varchar(100) DEFAULT NULL,
    `phone` varchar(20) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES
  (1, '127.0.0.1', 'administrator', '$2a$07$SeBknntpZror9uyftVopmu61qg0ms8Qv1yV6FG.kQOSM.9QhmTo36', '', 'admin@admin.com', '', NULL, NULL, 'halfvdlAoycCzB8g.ilYv.', 1268889823, 1518459737, 1, 'Admin', 'istrator', 'ADMIN', '0');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users_groups`
  --
  
  DROP TABLE IF EXISTS `users_groups`;
  CREATE TABLE IF NOT EXISTS `users_groups` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `user_id` int(11) UNSIGNED NOT NULL,
    `group_id` mediumint(8) UNSIGNED NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
    KEY `fk_users_groups_users1_idx` (`user_id`),
    KEY `fk_users_groups_groups1_idx` (`group_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `users_groups`
  --
  
  INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES
  (1, 1, 1),
  (2, 1, 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `visite`
  --
  
  DROP TABLE IF EXISTS `visite`;
  CREATE TABLE IF NOT EXISTS `visite` (
    `id_visite` int(11) NOT NULL AUTO_INCREMENT,
    `date_visite` date NOT NULL,
    `id_membre` int(4) NOT NULL,
    `heure_entre` time NOT NULL,
    `heure_sortie` time DEFAULT NULL,
    PRIMARY KEY (`id_visite`),
    KEY `effectuer_visite` (`id_membre`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `visite`
  --
  
  INSERT INTO `visite` (`id_visite`, `date_visite`, `id_membre`, `heure_entre`, `heure_sortie`) VALUES
  (1, '2018-02-05', 1, '15:23:24', NULL),
  (2, '2018-02-09', 1, '21:05:24', NULL),
  (3, '2018-02-10', 1, '14:32:05', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `visiteur`
  --
  
  DROP TABLE IF EXISTS `visiteur`;
  CREATE TABLE IF NOT EXISTS `visiteur` (
    `id_visiteur` int(11) NOT NULL AUTO_INCREMENT,
    `nom_prenom_visiteur` varchar(100) NOT NULL,
    `date_visite` date NOT NULL,
    `heure_entre` time NOT NULL,
    `heure_sortie` time DEFAULT NULL,
    PRIMARY KEY (`id_visiteur`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `cotisation`
  --
  ALTER TABLE `cotisation`
    ADD CONSTRAINT `payer` FOREIGN KEY (`id_membre`) REFERENCES `membre` (`id_membre`);
  
  --
  -- Constraints for table `users_groups`
  --
  ALTER TABLE `users_groups`
    ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
    ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  
  --
  -- Constraints for table `visite`
  --
  ALTER TABLE `visite`
    ADD CONSTRAINT `effectuer_visite` FOREIGN KEY (`id_membre`) REFERENCES `membre` (`id_membre`);
  COMMIT;
  
  /*!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 */;
  