--
-- Host: localhost    Database: localhost
-- ------------------------------------------------------


--
-- Table structure for table `tassets`
--

CREATE TABLE `tassets` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `sn_internal` varchar(20) NOT NULL,
  `sn_manufacturer` varchar(40) NOT NULL,
  `sn_indent` varchar(40) NOT NULL,
  `ip` varchar(20) NOT NULL,
  `ip2` varchar(20) NOT NULL,
  `netbios` varchar(30) NOT NULL,
  `description` varchar(500) NOT NULL,
  `type` int(5) NOT NULL,
  `manufacturer` int(5) NOT NULL,
  `model` int(5) NOT NULL,
  `user` int(5) NOT NULL,
  `state` int(5) NOT NULL,
  `mac_lan` varchar(20) NOT NULL,
  `mac_wlan` varchar(20) NOT NULL,
  `department` int(5) NOT NULL,
  `date_install` date NOT NULL,
  `date_stock` date NOT NULL,
  `date_standbye` date NOT NULL,
  `date_recycle` date NOT NULL,
  `socket` varchar(10) NOT NULL,
  `technician` int(5) NOT NULL,
  `maintenance` int(10) NOT NULL,
  `disable` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets`
--

INSERT INTO `tassets` VALUES (1,'1','','','172.16.2.201','','','',1,1,1,7,2,'','',1,'2016-10-20','2013-06-03','0000-00-00','0000-00-00','',7,0,1);

--
-- Table structure for table `tassets_manufacturer`
--

CREATE TABLE `tassets_manufacturer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_manufacturer`
--

INSERT INTO `tassets_manufacturer` VALUES (1,'Dell'),(2,'HP'),(3,'Apple');

--
-- Table structure for table `tassets_model`
--

CREATE TABLE `tassets_model` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `type` int(5) NOT NULL,
  `manufacturer` int(5) NOT NULL,
  `image` varchar(30) NOT NULL,
  `name` varchar(50) NOT NULL,
  `ip` int(1) NOT NULL,
  `wifi` int(1) NOT NULL,
  `warranty` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_model`
--

INSERT INTO `tassets_model` VALUES (1,1,1,'3020.jpg','Optiplex 3020',1,0,3),(2,2,1,'overview_wireless_hero_enhance','MacBookPro',1,1,3);

--
-- Table structure for table `tassets_network`
--

CREATE TABLE `tassets_network` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `network` varchar(15) NOT NULL,
  `netmask` varchar(15) NOT NULL,
  `disable` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_network`
--

INSERT INTO `tassets_network` VALUES (1,'Dun ADM','172.16.3.0','/24',0),(2,'Dun SFT','172.16.3.0','/24',0),(3,'DHCP','','',0);

--
-- Table structure for table `tassets_state`
--

CREATE TABLE `tassets_state` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `order` int(3) NOT NULL,
  `name` varchar(20) NOT NULL,
  `description` varchar(50) NOT NULL,
  `disable` int(1) NOT NULL,
  `display` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_state`
--

INSERT INTO `tassets_state` VALUES (1,1,'Stock','Equipement en stock',0,'label label-sm label-info arrowed-in'),(2,2,'En production','Equipement installé en production',0,'label label-sm label-success arrowed arrowed-right arrowed-left'),(3,3,'Standbye','Equipement de coté',0,'label label-sm label-warning arrowed-in arrowed-right arrowed-in arrowed-left'),(5,5,'Equipement HS','Equipement hors service',0,''),(6,4,'En attente ...','En attente de réparation / reinstallation',0,''),(7,0,'Plus d\'utilité','Equipement obsolète ou non endommagé et non rempla',0,'');

--
-- Table structure for table `tassets_thread`
--

CREATE TABLE `tassets_thread` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `asset` int(10) NOT NULL,
  `text` varchar(5000) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_thread`
--


--
-- Table structure for table `tassets_type`
--

CREATE TABLE `tassets_type` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tassets_type`
--

INSERT INTO `tassets_type` VALUES (1,'PC'),(2,'Mac'),(3,'Téléphone fixe'),(4,'Imprimante'),(5,'Téléphone portable'),(6,'Box (accès internet)'),(7,'Ecran / Moniteur'),(8,'Vidéo projecteur');

--
-- Table structure for table `tavailability`
--

CREATE TABLE `tavailability` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `category` int(5) NOT NULL,
  `subcat` int(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tavailability`
--


--
-- Table structure for table `tavailability_dep`
--

CREATE TABLE `tavailability_dep` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `category` int(5) NOT NULL,
  `subcat` int(5) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tavailability_dep`
--


--
-- Table structure for table `tavailability_target`
--

CREATE TABLE `tavailability_target` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `subcat` int(5) NOT NULL,
  `target` float NOT NULL,
  `year` int(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tavailability_target`
--


--
-- Table structure for table `tcategory`
--

CREATE TABLE `tcategory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcategory`
--

INSERT INTO `tcategory` VALUES (1,'Logiciel'),(2,'Materiel'),(3,'Achat'),(4,'Internet'),(5,'Pour info');

--
-- Table structure for table `tcompany`
--

CREATE TABLE `tcompany` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `address` varchar(50) NOT NULL,
  `zip` varchar(10) NOT NULL,
  `city` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcompany`
--

INSERT INTO `tcompany` VALUES (1,'SFN Dunkerque','Avenue de la Gironde, ZI de Petite Synthe','59944','Dunkerque'),(2,'SFN Dieppe','Zone Industrielle Louis Delaporte, Zone marron (vo','76370','Rouxmesnil-Bouteilles'),(3,'SFN Bollène','Site du Sactar D243','84500','Bollène'),(4,'SFN Lagnieu','Rue de la gare','01150','Lagnieu'),(5,'SFN Blyes','Parc Industrielle de la Plaine de l\'Ain','01150','Blyes');

--
-- Table structure for table `tcriticality`
--

CREATE TABLE `tcriticality` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `number` int(2) NOT NULL,
  `name` varchar(50) NOT NULL,
  `color` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcriticality`
--

INSERT INTO `tcriticality` VALUES (1,0,'Critique','#d15b47'),(2,1,'Grave','#f89406'),(3,2,'Moyenne','#f8c806'),(4,3,'Basse','#82af6f');

--
-- Table structure for table `tevents`
--

CREATE TABLE `tevents` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `technician` int(10) NOT NULL,
  `incident` int(10) NOT NULL,
  `date_start` datetime NOT NULL,
  `date_end` datetime NOT NULL,
  `type` int(1) NOT NULL,
  `disable` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tevents`
--

INSERT INTO `tevents` VALUES (2,7,2,'2016-10-21 08:00:00','2016-10-21 10:00:00',2,0);

--
-- Table structure for table `tgroups`
--

CREATE TABLE `tgroups` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `type` int(1) NOT NULL,
  `disable` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tgroups`
--


--
-- Table structure for table `tgroups_assoc`
--

CREATE TABLE `tgroups_assoc` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `group` int(5) NOT NULL,
  `user` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tgroups_assoc`
--


--
-- Table structure for table `tincidents`
--

CREATE TABLE `tincidents` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `type` int(1) NOT NULL DEFAULT '0',
  `technician` int(5) NOT NULL,
  `t_group` int(5) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` mediumtext NOT NULL,
  `user` varchar(20) NOT NULL,
  `u_group` int(5) NOT NULL,
  `u_service` int(5) NOT NULL,
  `date_create` datetime NOT NULL,
  `date_hope` date NOT NULL,
  `date_res` datetime NOT NULL,
  `date_modif` datetime NOT NULL,
  `state` int(1) NOT NULL,
  `priority` int(2) NOT NULL,
  `criticality` int(2) NOT NULL,
  `img1` varchar(500) NOT NULL,
  `img2` varchar(500) NOT NULL,
  `img3` varchar(500) NOT NULL,
  `img4` varchar(500) NOT NULL,
  `img5` varchar(500) NOT NULL,
  `time` int(10) NOT NULL,
  `time_hope` int(10) NOT NULL,
  `creator` int(3) NOT NULL,
  `category` int(3) NOT NULL,
  `subcat` int(3) NOT NULL,
  `techread` int(1) NOT NULL DEFAULT '1',
  `template` int(1) NOT NULL,
  `disable` int(1) NOT NULL,
  `notify` int(1) NOT NULL,
  `place` int(5) NOT NULL DEFAULT '99999',
  `start_availability` datetime NOT NULL,
  `end_availability` datetime NOT NULL,
  `availability_planned` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tincidents`
--

INSERT INTO `tincidents` VALUES (14,1,0,0,'Baisse de connexion','\r\n												\r\n												','2',0,0,'2016-10-20 16:45:01','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',3,6,4,'','','','','',0,5,2,4,0,0,0,1,1,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(15,1,0,0,'Test Ticket','Test\r\n												\r\n												','2',0,0,'2016-10-20 16:47:06','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',3,6,4,'','','','','',0,5,2,4,0,0,0,1,1,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(16,1,7,0,'Euh ??','<br>Euh ??<br><br>\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												','7',0,0,'2016-10-20 16:49:40','2016-10-26','2016-10-21 08:50:16','0000-00-00 00:00:00',3,6,4,'','','','','',10,300,2,2,14,1,0,1,1,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(17,3,7,0,'Essai mail','<br>Essai mail<br><br>\r\n												\r\n												\r\n												\r\n												\r\n												','7',0,0,'2016-10-21 08:25:06','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,7,5,0,1,0,1,0,100000,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(18,1,7,0,'Essai mail','Essai mail\r\n												\r\n												\r\n												','7',0,0,'2016-10-21 08:28:14','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,7,5,0,1,0,1,0,100000,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(19,3,7,0,'Essai mail','Essai mail\r\n												\r\n												\r\n												\r\n												\r\n												','7',0,0,'2016-10-21 08:29:29','2016-10-22','0000-00-00 00:00:00','0000-00-00 00:00:00',3,6,4,'','','','','',1,5,7,1,0,1,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(20,1,0,0,'Test mail','<br>sdfsdfdsf<br><br>\r\n												\r\n												\r\n												','2',0,0,'2016-10-21 08:58:36','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',0,5,2,1,7,0,0,1,1,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(21,1,0,0,'qsdqsd','<br>sqdqsdqsd<br><br>\r\n												\r\n												\r\n												','2',0,0,'2016-10-21 08:58:58','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',0,5,2,2,4,0,0,1,1,100002,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(22,1,0,0,'qsdqsd','qsdqsd\r\n												\r\n												\r\n												\r\n												','2',0,0,'2016-10-21 08:59:11','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',0,5,2,1,7,0,0,1,0,100001,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(23,1,0,0,'dsfsdf','<br>dsfdsf<br><br>\r\n												\r\n												','2',0,0,'2016-10-21 09:10:21','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',0,5,2,1,0,0,0,1,1,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(24,3,7,0,'zeezr','<br><br>zerzer\r\n												\r\n												\r\n												\r\n												','2',0,0,'2016-10-21 09:21:53','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',0,5,2,1,8,0,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(25,3,7,0,'sdfsd','<br>fdsfsdf<br>dsfsdf\r\n												\r\n												\r\n												\r\n												','2',0,0,'2016-10-21 09:24:24','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',3,6,2,'','','','','',1,5,2,4,0,1,0,1,0,100001,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(26,2,7,0,'fsdsfdsdf','\r\n												dsqdsds<br>\r\n												\r\n												\r\n												','8',0,0,'2016-10-21 14:10:58','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,8,2,0,0,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(27,3,8,0,'Echange ticket','\r\n												Echange ticket<br>\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												\r\n												','7',0,0,'2016-10-21 14:12:26','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',2,6,4,'','','','','',1,5,8,1,8,0,0,1,0,100000,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(28,1,7,0,'Installation d\'un éditeur de PDF','Besoin d\'installer un éditeur de PDF','0',0,0,'2016-10-25 08:36:51','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,7,1,12,1,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(29,2,7,0,'sdfsdf','sdfsdf\r\n												','8',0,0,'2016-10-25 08:56:59','0000-00-00','2016-10-25 08:57:49','0000-00-00 00:00:00',3,6,4,'','','','','',1,5,7,1,7,1,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(30,2,7,0,'fghfg','hfghfgh','2',0,0,'2016-10-25 08:59:17','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',3,6,4,'','','','','',1,5,7,4,0,1,0,1,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(31,1,7,0,'Chargeur téléphone exemple','J\'ai besoin d\'un chargeur de téléphone\r\n												\r\n												\r\n												\r\n												\r\n												','2',0,0,'2016-10-25 11:33:57','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,2,3,10,1,0,0,0,100000,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(32,2,8,0,'Exemple d\'incident','Mon planning n\'est plus à jour<br>','7',0,0,'2016-10-26 08:24:35','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,8,1,8,1,0,0,0,100000,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),(33,1,8,0,'','\r\n												','0',0,0,'2016-10-26 08:54:58','0000-00-00','0000-00-00 00:00:00','0000-00-00 00:00:00',1,6,4,'','','','','',1,5,8,0,0,1,0,0,0,100003,'0000-00-00 00:00:00','0000-00-00 00:00:00',0);

--
-- Table structure for table `tmails`
--

CREATE TABLE `tmails` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `incident` int(10) NOT NULL,
  `open` int(1) NOT NULL,
  `close` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tmails`
--

INSERT INTO `tmails` VALUES (1,19,1,1),(2,16,1,1),(3,25,1,0),(4,26,1,0),(5,27,1,0),(6,28,1,0),(7,29,1,1),(8,30,1,0),(9,32,1,0),(10,33,1,0),(11,31,1,0);

--
-- Table structure for table `tplaces`
--

CREATE TABLE `tplaces` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100007 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tplaces`
--

INSERT INTO `tplaces` VALUES (100000,'Dunkerque'),(100001,'Bollène'),(100002,'Dieppe'),(100003,'Blyes'),(100004,'Lagnieu'),(100005,'Variable'),(100006,'L\'ensemble des sites');

--
-- Table structure for table `tpriority`
--

CREATE TABLE `tpriority` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `number` int(2) NOT NULL,
  `name` varchar(50) NOT NULL,
  `color` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tpriority`
--

INSERT INTO `tpriority` VALUES (1,0,'Urgent','#d15b47'),(2,1,'Très haute','#f89406'),(3,2,'Haute','#f8c806'),(4,3,'Moyenne','#e7ef20'),(5,4,'Basse','#c2c921'),(6,5,'Très basse','#82af6f');

--
-- Table structure for table `tprocedures`
--

CREATE TABLE `tprocedures` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `category` int(5) NOT NULL,
  `subcat` int(5) NOT NULL,
  `name` varchar(100) NOT NULL,
  `text` mediumtext NOT NULL,
  `file1` varchar(30) NOT NULL,
  `disable` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tprocedures`
--

INSERT INTO `tprocedures` VALUES (1,2,2,'Procédure 1 test (exemple de disfonctionnement)','Procédure test n°1 avec insertion d\'image<div><img src=\"data:image/png;base64,[BLOB]