-- --------------------------------------------------------
-- Hôte:                         127.0.0.1
-- Version du serveur:           8.0.42 - MySQL Community Server - GPL
-- SE du serveur:                Win64
-- HeidiSQL Version:             12.8.0.6908
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- Listage de la structure de table intranet. actus
CREATE TABLE IF NOT EXISTS `actus` (
  `id` int NOT NULL AUTO_INCREMENT,
  `titre` text NOT NULL,
  `actu` text NOT NULL,
  `image` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `date` date NOT NULL,
  `idSite` tinyint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.actus : ~6 rows (environ)
INSERT INTO `actus` (`id`, `titre`, `actu`, `image`, `date`, `idSite`) VALUES
	(1, 'Chill avec les potes', 'Ajourd\'hui on a chill avec les potes à la maison, moi et les boys forever.', 'actu_1_1772639173.JPG', '2026-02-10', 1),
	(2, '#Onfoutlefeu (Manifestation)', 'rveuherubiueriuberuihbeiuhubihraiuehbuihearphberiuahbuiearhbiuherauihbuireahiuhabieruphbiruehabuihberiuhahbuirhbeabaeveccece', 'actu_2_1772639391.jpg', '2026-02-10', 1),
	(3, 'Nouveau pc de g@m3r', 'On a un vélo', 'actu_3_1772638885.JPG', '2026-02-10', 1),
	(4, 'Futur repas :miam:', 'g\'tohgio\'h', 'actu_4_1772639824.jpg', '2026-02-10', 1),
	(7, 'uytre', 'gdnngd', 'actu_7_1773042067.gif', '2026-03-09', 1),
	(8, 'TIC et TAC', 'TIC et TAC arrivent à APEI de Maubeuge', 'actu_8_1773146906.jpg', '2026-03-10', 2);

-- Listage de la structure de table intranet. evenements
CREATE TABLE IF NOT EXISTS `evenements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `titre` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `couverture` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `site_id` tinyint DEFAULT NULL,
  `public` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `FK_evenements_site` (`site_id`),
  CONSTRAINT `FK_evenements_site` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.evenements : ~10 rows (environ)
INSERT INTO `evenements` (`id`, `date`, `titre`, `couverture`, `site_id`, `public`) VALUES
	(1, '2026-02-28', '50 ans des papillons blancs', 'event_1_1772616599.JPG', 2, 1),
	(3, '2026-02-24', 'Assemblée générale 2014 La longueville', 'event_3_1772619824.JPG', 2, 0),
	(4, '2026-02-24', 'Fête associative 2018', 'event_4_1772620173.jpg', 2, 1),
	(6, '2026-02-24', 'miaou', 'https://static.vecteezy.com/ti/photos-gratuite/t2/36324708-ai-genere-image-de-une-tigre-en-marchant-dans-le-foret-photo.jpg', 3, 0),
	(7, '2026-02-24', 'wow', 'https://static.nationalgeographic.fr/files/styles/image_3200/public/01-solar-system-pia12114_orig.webp?w=1190&h=896', 3, 0),
	(8, '2026-02-24', 'ptkhpkth', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbspCVkfI_IJYPEpTu8Qbb9s-FE5sMbdNDbQ&s', 3, 0),
	(9, '2026-02-24', 'ptkhpkth', 'https://cdn.pixabay.com/photo/2024/05/26/10/15/bird-8788491_1280.jpg', 3, 0),
	(10, '2026-02-24', '40 ans IME Jeumont', 'event_10_1772786010.JPG', 2, 0),
	(16, '2015-03-10', 'bla bla bla bla bla', 'event_16_1772793122.jfif', 2, 0),
	(17, '2017-10-10', 'JADE 2017', 'event_17_1773139543.jpg', 2, 0);

-- Listage de la structure de table intranet. gallerie
CREATE TABLE IF NOT EXISTS `gallerie` (
  `event_id` int NOT NULL,
  `chemin` text,
  `texte` text,
  KEY `FK_gallerie_evenements` (`event_id`),
  CONSTRAINT `FK_gallerie_evenements` FOREIGN KEY (`event_id`) REFERENCES `evenements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.gallerie : ~90 rows (environ)
INSERT INTO `gallerie` (`event_id`, `chemin`, `texte`) VALUES
	(4, 'gallery_4_1772628170_0.JPG', ''),
	(4, 'gallery_4_1772628170_1.JPG', ''),
	(4, 'gallery_4_1772628170_2.JPG', ''),
	(4, 'gallery_4_1772628170_3.JPG', ''),
	(4, 'gallery_4_1772628170_4.JPG', ''),
	(4, 'gallery_4_1772628170_5.JPG', ''),
	(4, 'gallery_4_1772628170_6.JPG', ''),
	(4, 'gallery_4_1772628170_7.JPG', ''),
	(4, 'gallery_4_1772628170_8.JPG', ''),
	(4, 'gallery_4_1772628170_9.JPG', ''),
	(4, 'gallery_4_1772628170_10.JPG', ''),
	(4, 'gallery_4_1772628170_11.JPG', ''),
	(4, 'gallery_4_1772628170_12.JPG', ''),
	(4, 'gallery_4_1772628170_13.JPG', ''),
	(4, 'gallery_4_1772628170_14.JPG', ''),
	(4, 'gallery_4_1772628170_15.JPG', ''),
	(4, 'gallery_4_1772628170_16.JPG', ''),
	(4, 'gallery_4_1772628170_17.JPG', ''),
	(4, 'gallery_4_1772628170_18.JPG', ''),
	(4, 'gallery_4_1772628170_19.JPG', ''),
	(1, 'gallery_1_1772629484_0.JPG', ''),
	(1, 'gallery_1_1772629484_1.JPG', ''),
	(1, 'gallery_1_1772629484_2.JPG', ''),
	(1, 'gallery_1_1772629484_3.JPG', ''),
	(1, 'gallery_1_1772629484_4.JPG', ''),
	(1, 'gallery_1_1772629484_5.JPG', ''),
	(1, 'gallery_1_1772629484_6.JPG', ''),
	(1, 'gallery_1_1772629484_7.JPG', ''),
	(1, 'gallery_1_1772629484_8.JPG', ''),
	(1, 'gallery_1_1772629484_9.JPG', ''),
	(1, 'gallery_1_1772629484_10.JPG', ''),
	(1, 'gallery_1_1772629484_11.JPG', ''),
	(1, 'gallery_1_1772629484_12.JPG', ''),
	(1, 'gallery_1_1772629484_13.JPG', ''),
	(1, 'gallery_1_1772629484_14.JPG', ''),
	(1, 'gallery_1_1772629484_15.JPG', ''),
	(1, 'gallery_1_1772629484_16.JPG', ''),
	(1, 'gallery_1_1772629484_17.JPG', ''),
	(1, 'gallery_1_1772629484_18.JPG', ''),
	(1, 'gallery_1_1772629484_19.JPG', ''),
	(1, 'gallery_1_1772629707_0.JPG', ''),
	(3, 'gallery_3_1772632151_0.JPG', ''),
	(3, 'gallery_3_1772633113_0.JPG', ''),
	(3, 'gallery_3_1772633113_1.JPG', ''),
	(3, 'gallery_3_1772633113_2.JPG', ''),
	(3, 'gallery_3_1772633113_3.JPG', ''),
	(3, 'gallery_3_1772633113_4.JPG', ''),
	(3, 'gallery_3_1772633113_5.JPG', ''),
	(3, 'gallery_3_1772633114_6.JPG', ''),
	(3, 'gallery_3_1772633114_7.JPG', ''),
	(3, 'gallery_3_1772633114_8.JPG', ''),
	(3, 'gallery_3_1772633114_9.JPG', ''),
	(3, 'gallery_3_1772633468_0.JPG', ''),
	(3, 'gallery_3_1772633469_1.JPG', ''),
	(3, 'gallery_3_1772633469_2.JPG', ''),
	(3, 'gallery_3_1772633469_3.JPG', ''),
	(3, 'gallery_3_1772633469_4.JPG', ''),
	(3, 'gallery_3_1772633469_5.JPG', ''),
	(3, 'gallery_3_1772633469_6.JPG', ''),
	(3, 'gallery_3_1772633469_7.JPG', ''),
	(3, 'gallery_3_1772633469_8.JPG', ''),
	(10, 'gallery_10_1772786068_0.JPG', ''),
	(10, 'gallery_10_1772786068_1.JPG', ''),
	(10, 'gallery_10_1772786069_2.JPG', ''),
	(10, 'gallery_10_1772786069_3.JPG', ''),
	(10, 'gallery_10_1772786069_4.JPG', ''),
	(10, 'gallery_10_1772786069_5.JPG', ''),
	(10, 'gallery_10_1772786069_6.JPG', ''),
	(10, 'gallery_10_1772786069_7.JPG', ''),
	(10, 'gallery_10_1772786069_8.JPG', ''),
	(10, 'gallery_10_1772786069_9.JPG', ''),
	(10, 'gallery_10_1772786069_10.JPG', ''),
	(16, 'gallery_16_1772793327_0.jfif', ''),
	(16, 'gallery_16_1772793327_1.jfif', ''),
	(16, 'gallery_16_1772793327_2.jfif', ''),
	(16, 'gallery_16_1772793327_3.jfif', ''),
	(16, 'gallery_16_1772802166_0.gif', ''),
	(17, 'gallery_17_1773139597_0.jpg', ''),
	(17, 'gallery_17_1773139597_1.jpg', ''),
	(17, 'gallery_17_1773139597_2.jpg', ''),
	(17, 'gallery_17_1773139597_3.jpg', ''),
	(17, 'gallery_17_1773139597_4.jpg', ''),
	(17, 'gallery_17_1773139597_5.jpg', ''),
	(17, 'gallery_17_1773139597_6.jpg', ''),
	(17, 'gallery_17_1773139597_7.jpg', ''),
	(17, 'gallery_17_1773139597_8.jpg', ''),
	(17, 'gallery_17_1773139597_9.jpg', ''),
	(17, 'gallery_17_1773139597_10.jpg', ''),
	(17, 'gallery_17_1773139598_11.jpg', ''),
	(17, 'gallery_17_1773139598_12.jpg', '');

-- Listage de la structure de table intranet. guides
CREATE TABLE IF NOT EXISTS `guides` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nom` tinytext NOT NULL,
  `lien` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.guides : ~1 rows (environ)
INSERT INTO `guides` (`id`, `nom`, `lien`) VALUES
	(1, 'Test Guide 1', 'https://google.fr');

-- Listage de la structure de table intranet. permissions
CREATE TABLE IF NOT EXISTS `permissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nom` varchar(50) DEFAULT NULL,
  `poids` tinyint unsigned DEFAULT NULL COMMENT 'Plus la valeur est importante, plus les privilèges sont importants',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_nom` (`nom`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.permissions : ~4 rows (environ)
INSERT INTO `permissions` (`id`, `nom`, `poids`) VALUES
	(1, 'admin', 99),
	(2, 'directeur', 50),
	(3, 'redacteur', 45),
	(4, 'visiteur', 10);

-- Listage de la structure de table intranet. raccourcis
CREATE TABLE IF NOT EXISTS `raccourcis` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nom` tinytext NOT NULL,
  `image` text NOT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COMMENT='Raccourcis de la page d''accueil';

-- Listage des données de la table intranet.raccourcis : ~10 rows (environ)
INSERT INTO `raccourcis` (`id`, `nom`, `image`, `url`) VALUES
	(1, 'Google', './Assets/Logos/google.png', 'https://google.com/'),
	(2, 'Orange', './Assets/Logos/orange.png', 'https://dro.orange-business.com/authentification?codeContexte=eceDefault&TYPE=33554433&REALMOID=06-0008fae7-1ec1-1184-b5ad-5e0e0a63d064&GUID=1&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-WSU81RKkuhqhTH%2b1DDCWyU0dUsCVOUEXZH%2fo6toyJ5TivCcULz4UBdXhakZa13z8&TARGET=-SM-HTTPS%3a%2f%2fespaceclient%2eorange--business%2ecom%2fgroup%2fece2%2fhome%3fcodeContexte%3deceDefault'),
	(3, 'AVS', './Assets/Logos/avs.png', 'https://ateliersduvaldesambre.fr/'),
	(4, '3CX', './Assets/Logos/3cx.jpg', 'https://apei-maubeuge.on3cx.fr/'),
	(5, 'Outlook', './Assets/Logos/outlook.jpg', 'https://outlook.live.com/owa/'),
	(6, 'Netvie', './Assets/Logos/netvie.jpg', 'https://n.netsoins.com/'),
	(7, 'Teams', './Assets/Logos/teams.png', 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token&scope=openid%20profile&client_id=5e3ce6c0-2b1f-4285-8d4b-75ee78787346&redirect_uri=https%3A%2F%2Fteams.microsoft.com%2Fgo&state=eyJpZCI6IjdkMjgxYjQ4LWY2ZDMtNDI4MS05ODUxLWRmYzJkMTE5YzViYSIsInRzIjoxNjU0NjkwMTIxLCJtZXRob2QiOiJyZWRpcmVjdEludGVyYWN0aW9uIn0%3D&nonce=103471a8-5ca1-403b-865b-e9b83ff1e769&client_info=1&x-client-SKU=MSAL.JS&x-client-Ver=1.3.4&client-request-id=7f26a741-1190-4cfe-8025-20c36359120b&response_mode=fragment'),
	(9, 'Octime', './Assets/Logos/octime.png', 'http://172.17.0.239/WD210AWP/WD210AWP.EXE/CONNECT/wmoctime92?INI=APEI&'),
	(10, 'malakoff', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcQZG24wWrwI5cMUjZxk2jAoLkM4ue5xVgew&s', 'https://connexion.malakoffhumanis.com/entreprises/login/?sessionOnly=true&goto=https%3A%2F%2Fconnexion.malakoffhumanis.com%2Fentreprises%2Fauth%2Foauth2.0%2Fv1%2Fauthorize%3Fredirect_uri%3Dhttps%253A%252F%252Fespace-entreprise.malakoffhumanis.com%26client_id%3D2984dd01-0449-44cc-bce4-bb5a01d86895%26response_type%3Dcode%26state%3DR9jfTumx7x%26scope%3DphoneNumberAndEmail%2Bentreprises%2Bprofile%2Bopenid%26nonce%3D0.zyyvn70cn5h%26code_challenge%3DJP13n_I6BCRrEUcCL-eWFJOjpPqfEf9vG80th2Hh6tk%26code_challenge_method%3DS256'),
	(12, 'teste de ra', './Assets/Logos/nothing.jpg', 'https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fsites.google.com%2Fsite%2Fbdumbge%2Fhome&followup=https%3A%2F%2Fsites.google.com%2Fsite%2Fbdumbge%2Fhome&ifkv=ASKV5Mj4fAqVIp99h_LjoeiDIZX1sTwzSe7T2gg1dsarFNfPdbsyWVCEBrJvAkMXh1UrXnr7zv3cIA&osid=1&passive=1209600&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S372091009%3A1747655585598786');

-- Listage de la structure de table intranet. site
CREATE TABLE IF NOT EXISTS `site` (
  `site_id` tinyint NOT NULL AUTO_INCREMENT,
  `nom` tinytext NOT NULL,
  PRIMARY KEY (`site_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3;

-- Listage des données de la table intranet.site : ~9 rows (environ)
INSERT INTO `site` (`site_id`, `nom`) VALUES
	(2, 'siège'),
	(3, 'ime la source'),
	(4, 'ime st hilaire'),
	(5, 'ime jeumont'),
	(8, 'foyer la longueville'),
	(10, 'centre habitat'),
	(11, 'masfamcaj'),
	(22, 'avs'),
	(25, 'samsah');

-- Listage de la structure de table intranet. utilisateurs
CREATE TABLE IF NOT EXISTS `utilisateurs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` tinytext NOT NULL,
  `password` text NOT NULL,
  `permissions` varchar(50) NOT NULL,
  `site_id` tinyint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_site_id` (`site_id`),
  KEY `FK_utilisateurs_permissions` (`permissions`),
  CONSTRAINT `fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`site_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `FK_utilisateurs_permissions` FOREIGN KEY (`permissions`) REFERENCES `permissions` (`nom`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COMMENT='Comptes autorisés à modifier les raccourcis\r\nMots de passes stoqués en SHA256';

-- Listage des données de la table intranet.utilisateurs : ~2 rows (environ)
INSERT INTO `utilisateurs` (`id`, `username`, `password`, `permissions`, `site_id`) VALUES
	(1, 'erwann', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'admin', 2),
	(4, 'blandine', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'admin', 2);

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
