/**
 * Sigma Apprentissage dump
 *
 */



/* Dump of table `sa_user_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_user_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `user_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `user_type_category` (`user_type_category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_user_type` ( ID, user_type_category ) VALUES ( 1, 'Administrateur' );
INSERT INTO `sa_user_type` ( ID, user_type_category ) VALUES ( 2, 'Pôle Administration' );
INSERT INTO `sa_user_type` ( ID, user_type_category ) VALUES ( 64, 'Pôle Pédagogique' );
INSERT INTO `sa_user_type` ( ID, user_type_category ) VALUES ( 65, 'Responsable pédagogique' );



/* Dump of table `sa_contacts`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_contacts` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `contact_person_id` int unsigned NOT NULL DEFAULT '0',
  `contact_value` varchar(100) NOT NULL DEFAULT '',
  `contact_label` varchar(60) DEFAULT NULL,
  `contact_type` smallint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_contact_person_id` FOREIGN KEY (`contact_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_contact_type` FOREIGN KEY (`contact_type`) REFERENCES `sa_contact_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_contacts` ( ID, contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 1, 1, '+33688471935', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 1, '+33142780375', NULL, 2 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 1, '+33956685292', NULL, 16 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 1, 'skoenig@sigma-apprentissage.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 2, 'manieref.cfa08@wanadoo.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 3, 'avocat@wittmardufour.com', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 3, '+33143400203', NULL, 2 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 4, 'p.noel@ipesup.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 4, '+33144321200', NULL, 2 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 5, 'martine.saint-dizier@orange.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 5, '+33232252793', NULL, 3 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 5, '+33688593142', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 6, 'virginie.poulain@bnpparibas.com', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 6, '+33144743350', NULL, 2 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 6, '+33144743365', NULL, 16 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 7, 'jcsontag@sigma-apprentissage.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 7, '+33676551136', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 8, 'blanchard.sege@wanadoo.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 8, '+33177185892', NULL, 3 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 8, '+33251334723', 'résidence secondaire', 3 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 9, 'fredericrousseau@wanadoo.fr', NULL, 32 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 9, '+33680004031', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 9, '+33143419831', 'résidence secondaire', 3 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 10, '+33684532223', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 11, '+33626762532', NULL, 1 );
INSERT INTO `sa_contacts` ( contact_person_id, contact_value, contact_label, contact_type ) VALUES ( 11, '+33951220034', NULL, 3 );



/* Dump of table `sa_contact_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_contact_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `contact_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `contact_type_category` (`contact_type_category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_contact_type` ( ID, contact_type_category ) VALUES ( 1, 'Téléphone portable' );
INSERT INTO `sa_contact_type` ( ID, contact_type_category ) VALUES ( 2, 'Téléphone bureau' );
INSERT INTO `sa_contact_type` ( ID, contact_type_category ) VALUES ( 3, 'Téléphone personnel' );
INSERT INTO `sa_contact_type` ( ID, contact_type_category ) VALUES ( 16, 'Fax' );
INSERT INTO `sa_contact_type` ( ID, contact_type_category ) VALUES ( 32, 'E-mail' );



/* Dump of table `sa_civility_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_civility_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `civility_type_category` varchar(8) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `civility_type_category` (`civility_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_civility_type` ( ID, civility_type_category ) VALUES ( 1, 'Mlle' );
INSERT INTO `sa_civility_type` ( civility_type_category ) VALUES ( 'Mme' );
INSERT INTO `sa_civility_type` ( civility_type_category ) VALUES ( 'M' );



/* Dump of table `sa_persons`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_persons` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `person_civility` smallint unsigned NOT NULL DEFAULT '0',
  `person_name` varchar(60) NOT NULL DEFAULT '',
  `person_firstname` varchar(60) NOT NULL DEFAULT '',
  `person_address` varchar(1024) DEFAULT NULL ,
  `person_city` varchar(100) DEFAULT NULL,
  `person_postal` varchar(10) DEFAULT NULL,
  `person_region` smallint unsigned NOT NULL DEFAULT '0',
  `person_title` varchar(256) DEFAULT NULL,
  `person_themes` varchar(512) DEFAULT NULL,
  `person_comment` text,
  `person_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_person_civility` FOREIGN KEY (`person_civility`) REFERENCES `sa_civility_type`(`ID`),
  CONSTRAINT `fk_person_region` FOREIGN KEY (`person_region`) REFERENCES `sa_regions`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_persons` ( ID, person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 1, 3, 'Koenig', 'Sébastien', '59 rue des Archives', 'Paris', '75003', 0, NULL, NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 3, 'Manière', 'Franck', '129 avenue Charles de Gaulle', 'Charleville-Mézières', '08000', 0, NULL, NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 2, 'Wittmar-Dufour', 'Caroline', '29 avenue Bel Air', 'Paris', '75012', 0, 'Avocate', NULL, 'Création de Sigma Apprentissage et acquisition du Groupe Sigma Apprentissage d\'IPESUP', 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 3, 'Noël', 'Patrick', '18 rue du Cloître Notre-Dame', 'Paris', '75004', 0, 'Directeur d\'IPESUP', NULL, 'Ex-responsable de Groupe Sigma Apprentissage', 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 2, 'Saint Dizier', 'Martine', '5 rue Pasteur', 'Pinterville', '27400', 0, NULL, ';1;', NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 2, 'Poulain', 'Virginie', '23 boulevard Diderot', 'Paris', '75012', 0, 'Chargée d\'Affaires Professionnels BNP', NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 3, 'Sontag', 'Jean-Claude', '14 avenue de la grange', 'Montgeron', '91230', 0, NULL, NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 3, 'Blanchard', 'Serge', '16 bis rue Pierre Fontaine', 'Paris', '75009', 0, NULL, NULL, 'Secondaire:27 rue Boisnivet,85520 Jard sur Mer', 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 3, 'Rousseau', 'Frédéric', '8 rue de la Tombe-Issoire', 'Paris', '75014', 0, NULL, NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 1, 'Sellier', 'Françoise', '4 rue Hermel', 'Paris', '75018', 0, NULL, NULL, NULL, 1 );
INSERT INTO `sa_persons` ( person_civility, person_name, person_firstname, person_address, person_city, person_postal, person_region, person_title, person_themes, person_comment, person_active ) VALUES ( 2, 'Delfosse', 'Françoise', '83 boulevard de Redon;Résidence la Rouvière Bât. D1', 'Marseille', '13009', 0, NULL, NULL, NULL, 1 );



/* Dump of table `sa_regions`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_regions` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `region_name` varchar(64) NOT NULL DEFAULT '',
  `region_counties` varchar(5256) NOT NULL DEFAULT '',
  `region_country` smallint unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `region_name` (`region_name`),
  CONSTRAINT `fk_region_country` FOREIGN KEY (`region_country`) REFERENCES `sa_countries`(`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 44, 'Alsace-Champagne-Ardenne-Lorraine', ';08;57;', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 75, 'Aquitaine-Limousin-Poitou-Charentes', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 84, 'Auvergne-Rhône-Alpes', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 27, 'Bourgogne-Franche-Comté', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 53, 'Bretagne', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 24, 'Centre-Val de Loire', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 94, 'Corse', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 970, 'DOM-TOM', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 11, 'Île-de-France', ';75;', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 76, 'Languedoc-Roussillon-Midi-Pyrénées', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 32, 'Nord-Pas-de-Calais-Picardie', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 28, 'Normandie', ';27;', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 52, 'Pays de la Loire', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 93, 'Provence-Alpes-Côte d\'Azur', '', 1 );
INSERT INTO `sa_regions` ( ID, region_name, region_counties, region_country ) VALUES ( 32767, 'Non disponible', '', 1 );



/* Dump of table `sa_countries`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_countries` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `country_name` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `country_name` (`country_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_countries` ( ID, country_name ) VALUES ( 1, 'France' );



/* Dump of table `sa_workers`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_workers` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `worker_person_id` int unsigned NOT NULL DEFAULT '0',
  `worker_diploma` varchar(255) NOT NULL DEFAULT '',
  `worker_date_signature` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `worker_last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `worker_state_employee` tinyint(1) NOT NULL DEFAULT '0',
  `worker_state_employee_job` varchar(128) DEFAULT NULL,
  `worker_state_employee_payslip_url` varchar(255) DEFAULT NULL,
  `worker_foreign` tinyint(1) NOT NULL DEFAULT '0',
  `worker_contract_url` varchar(255) NOT NULL DEFAULT '',
  `worker_prefered_payment_type` smallint unsigned NOT NULL DEFAULT '2',
  `worker_prefered_payment_doc_url` varchar(255) DEFAULT NULL,
  `worker_mobility` varchar(512) DEFAULT NULL,
  `worker_comment` text,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `worker_person_id` (`worker_person_id`),
  CONSTRAINT `fk_worker_person_id` FOREIGN KEY (`worker_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_worker_prefered_payment_type` FOREIGN KEY (`worker_prefered_payment_type`) REFERENCES `sa_payment_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_workers` ( ID, worker_person_id, worker_diploma, worker_date_signature, worker_last_update, worker_state_employee, worker_state_employee_job, worker_state_employee_payslip_url, worker_foreign, worker_contract_url, worker_prefered_payment_type, worker_prefered_payment_doc_url, worker_mobility, worker_comment ) VALUES ( 1, 5, 'DESS Ingénierie de la Formation', '2015-12-08 12:00:00', '2015-12-08 12:00:00', 0, NULL, NULL, 0, 'test_contract', 2, NULL, NULL, NULL );
INSERT INTO `sa_workers` ( worker_person_id, worker_diploma, worker_date_signature, worker_last_update, worker_state_employee, worker_state_employee_job, worker_state_employee_payslip_url, worker_foreign, worker_contract_url, worker_prefered_payment_type, worker_prefered_payment_doc_url, worker_mobility, worker_comment ) VALUES ( 8, 'DEA de Psychologie', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, NULL, NULL, 0, 'test_contract', 1, NULL, NULL, NULL );
INSERT INTO `sa_workers` ( worker_person_id, worker_diploma, worker_date_signature, worker_last_update, worker_state_employee, worker_state_employee_job, worker_state_employee_payslip_url, worker_foreign, worker_contract_url, worker_prefered_payment_type, worker_prefered_payment_doc_url, worker_mobility, worker_comment ) VALUES ( 9, 'Maître de Conférences en psychologie', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, NULL, NULL, 0, 'test_contract', 1, NULL, NULL, NULL );
INSERT INTO `sa_workers` ( worker_person_id, worker_diploma, worker_date_signature, worker_last_update, worker_state_employee, worker_state_employee_job, worker_state_employee_payslip_url, worker_foreign, worker_contract_url, worker_prefered_payment_type, worker_prefered_payment_doc_url, worker_mobility, worker_comment ) VALUES ( 10, 'DESS Psychologie clinique / DEA Etudes féminines', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, NULL, NULL, 0, 'test_contract', 1, NULL, NULL, NULL );
INSERT INTO `sa_workers` ( worker_person_id, worker_diploma, worker_date_signature, worker_last_update, worker_state_employee, worker_state_employee_job, worker_state_employee_payslip_url, worker_foreign, worker_contract_url, worker_prefered_payment_type, worker_prefered_payment_doc_url, worker_mobility, worker_comment ) VALUES ( 11, 'TODO', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, NULL, NULL, 0, 'test_contract', 1, NULL, NULL, NULL );



/* Dump of table `sa_sites`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_sites` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `site_name` varchar(100) NOT NULL DEFAULT '',
  `site_category` smallint unsigned NOT NULL DEFAULT '0',
  `site_address` varchar(1024) NOT NULL DEFAULT '',
  `site_city` varchar(100) NOT NULL DEFAULT '',
  `site_postal` varchar(10) NOT NULL DEFAULT '',
  `site_region` smallint unsigned NOT NULL DEFAULT '0',
  `site_mail` varchar(100) DEFAULT NULL,
  `site_phone` varchar(24) NOT NULL DEFAULT '',
  `site_fax` varchar(24) DEFAULT NULL,
  `site_themes` varchar(512) DEFAULT NULL,
  `site_comment` text,
  `site_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_site_category` FOREIGN KEY (`site_category`) REFERENCES `sa_site_type`(`ID`),
  CONSTRAINT `fk_site_region` FOREIGN KEY (`site_region`) REFERENCES `sa_regions`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_sites` ( ID, site_name, site_category, site_address, site_city, site_postal, site_region, site_mail, site_phone, site_fax, site_themes, site_comment, site_active ) VALUES ( 1, 'Sigma Apprentissage', 1, '59 rue des Archives', 'Paris', '75003', 0, 'sigma@sigma-apprentissage.fr', '+33142780375', '+33956685292', NULL, 'Siège social de Sigma Apprentissage', 1 );
INSERT INTO `sa_sites` ( site_name, site_category, site_address, site_city, site_postal, site_region, site_mail, site_phone, site_fax, site_themes, site_comment, site_active ) VALUES ( 'CFA Interprofessionnel des Ardennes', 1024, '129 avenue Charles de Gaulle', 'Charleville-Mézières', '08000', 0, 'cfa08.contact@orange.fr', '+33324330224', '+33324339094', NULL, NULL, 1 );
INSERT INTO `sa_sites` ( site_name, site_category, site_address, site_city, site_postal, site_region, site_mail, site_phone, site_fax, site_themes, site_comment, site_active ) VALUES ( 'Centre des Impôts', 127, '10 rue Michel le Comte', 'Paris', '75003', 0, '', '+33144595959', '', NULL, NULL, 1 );
INSERT INTO `sa_sites` ( site_name, site_category, site_address, site_city, site_postal, site_region, site_mail, site_phone, site_fax, site_themes, site_comment, site_active ) VALUES ( '1\&1', 128, '7 place de la Gare', 'Sarreguemines', '57200', 0, '', '+33970808911', '', NULL, 'Pour l\'aide en ligne passez par le site http://assistance.1and1.fr/contact?hc=Control-Panel', 1 );



/* Dump of table `sa_site_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_site_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `site_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `site_type_category` (`site_type_category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_site_type` ( ID, site_type_category ) VALUES ( 1, 'Siège' );
INSERT INTO `sa_site_type` ( ID, site_type_category ) VALUES ( 127, 'Administration' );
INSERT INTO `sa_site_type` ( site_type_category ) VALUES ( 'Commercial' );
INSERT INTO `sa_site_type` ( ID, site_type_category ) VALUES ( 1024, 'CFA' );



/* Dump of table `sa_assignments`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_assignments` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `assignment_person_id` int unsigned NOT NULL DEFAULT '0',
  `assignment_site_id` int unsigned NOT NULL DEFAULT '0',
  `assignment_category` smallint unsigned NOT NULL DEFAULT '0',
  `assignment_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_assignment_person_id` FOREIGN KEY (`assignment_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_assignment_site_id` FOREIGN KEY (`assignment_site_id`) REFERENCES `sa_sites`(`ID`),
  CONSTRAINT `fk_assignment_category` FOREIGN KEY (`assignment_category`) REFERENCES `sa_assignment_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_assignments` ( ID, assignment_person_id, assignment_site_id, assignment_category, assignment_active ) VALUES ( 1, 1, 1, 1, 1 );
INSERT INTO `sa_assignments` ( assignment_person_id, assignment_site_id, assignment_category, assignment_active ) VALUES ( 2, 2, 2, 1 );
INSERT INTO `sa_assignments` ( assignment_person_id, assignment_site_id, assignment_category, assignment_active ) VALUES ( 7, 1, 2, 1 );



/* Dump of table `sa_assignment_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_assignment_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `assignment_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `assignment_type_category` (`assignment_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_assignment_type` ( ID, assignment_type_category ) VALUES ( 1, 'Président / Directeur' );
INSERT INTO `sa_assignment_type` ( ID, assignment_type_category ) VALUES ( 2, 'Responsable Pédagogique' );
INSERT INTO `sa_assignment_type` ( ID, assignment_type_category ) VALUES ( 3, 'Responsable Financier / Comptable' );
INSERT INTO `sa_assignment_type` ( ID, assignment_type_category ) VALUES ( 4, 'Responsable Administratif' );
INSERT INTO `sa_assignment_type` ( ID, assignment_type_category ) VALUES ( 5, 'Secrétaire' );




/* Dump of table `sa_formations`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_formations` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `formation_id` int unsigned DEFAULT NULL,
  `formation_title` varchar(255) NOT NULL DEFAULT '',
  `formation_category` smallint unsigned NOT NULL DEFAULT '0',
  `formation_themes` varchar(512) NOT NULL DEFAULT '',
  `formation_url` varchar(255) NOT NULL DEFAULT '',
  `formation_content` text,
  `formation_comment` text,
  `formation_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `formation_id` (`formation_id`),
  UNIQUE KEY `formation_title` (`formation_title`),
  CONSTRAINT `fk_formation_category` FOREIGN KEY (`formation_category`) REFERENCES `sa_formation_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 1, 25, 'Débuter dans le métier de formateur en CFA', 4, '', '25. Débuter en formateur.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 2, 47, 'Faire de l\'hétérogénéité un atout pédagogique', 3, '', '47. Hétérog atout pédago.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 3, 27, 'Prévention et gestion des conflits avec les adolescents', 4, '', '27. Gerstion conflits ados.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 4, 7, 'Enseigner autrement avec les nouvelles technologies', 1, '', '07. Enseigner autrement.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 5, 29, 'Powerpoint™ : un logiciel au service des formateurs', 1, '', '29. Powerpoint.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 6, 33, 'Internet et la messagerie électronique : comment gagner du temps et de l\'efficacité ?', 1, '', '33. Internet email.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 7, 34, 'Perfectionnement Internet. De l\'autodidaxie au savoir-faire maîtrisé', 1, '', '34. Perfectionn internet.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 8, 58, 'Mettre en place une utilisation partagée et collaborative des ressources du web', 1, '', '58. Ressources web.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 9, 3, 'Du référentiel à l\'évaluation', 2, '', '03. Référentiel Evaluation.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 10, 5, 'La pédagogie en alternance au niveau BTS', 2, '', '05. Pédagogie de l\'alternance.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 11, 12, 'Organiser l\'acquisition des compétences dans un système d\'alternance', 2, '', '12. Acquisition compétences.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 12, 18, 'Le projet : une démarche pédagogique', 2, '', '18. Projet démarche pédagogique.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 13, 28, 'Pratiquer la pédagogie par objectifs pour structurer son enseignement', 2, '', '28. Pédagogie par objectifs.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 14, 35, 'Pour une optimisation de la séance de formation : démarches d\'apprentissage et méthodes pédagogiques', 2, '', '35. Optimisation formation.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 15, 43, 'Des manières d\'évaluer conçues pour faire progresser les apprentis', 2, '', '43. Manièreévaluer.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 16, 22, 'S\'approprier les épreuves d\'évaluation et de remédiation conçues pour les apprentis de niveau V', 2, '', '22. S\'approprier les évaluations.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 17, 10, 'Réaliser et exploiter des supports d\'enseignement efficaces', 2, '', '10. Supports d\'enseignement.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 18, 56, 'Enseigner et valider le socle commun de connaissances et de compétences en CFA', 2, '', '56. Socle commun.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 19, 38, 'Modulariser une formation diplômante, étape 1 : concepts et méthodologie', 2, '', '38. Formation diplômante 1.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 20, 39, 'Modulariser une formation diplômante, étape 2 : construction et mise en œuvre', 2, '', '39. Formation diplômante 2.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 21, 19, 'Travailler en équipes pluridisciplinaires', 2, '', '19. Equipes pluridisciplinaires.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 22, 52, 'Des compétences de base indispensables à la réussite de tout apprentissage', 2, '', '52. Compétence base.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 23, 16, 'Gérer les hétérogénéités par une pédagogie différenciée', 3, '', '16. Gérer hétérogénéités.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 24, 17, 'Engager une réflexion sur l\'individualisation de la formation', 3, '', '17. Individualisation de la formation.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 25, 8, 'Remettre au travail des jeunes démotivés', 3, '', '08. Jeunes démotivés.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 26, 21, 'Le rapport aux apprentissages : comment l\'améliorer chez des apprentis en difficulté ?', 3, '', '21. Le rapport aux apprentissages.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 27, 32, 'Que faire quand « ils » ne savent pas (bien) lire ?', 3, '', '32. Ne savent pas lire.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 28, 44, 'Non, une mauvaise orthographe n\'est pas une fatalité', 3, '', '44. Mauvaise orthographe.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 29, 6, 'Que faire face aux transgressions et à la violence ?', 4, '', '06. Transgression violence.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 30, 31, 'Comment instaurer la discipline dans son cours ? ', 4, '', '31. Discipline cours.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 31, 49, 'Gérer l\'écoute, les difficultés d\'attention et d\'apprentissage', 4, '', '49. Gérer l\'écoute.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 32, 30, 'Développer ses facultés d\'expression orale', 4, '', '30. Expression orale.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 33, 2, 'Gérer le stress', 4, '', '02. Gérer le stress.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 34, 37, 'Comment gérer le stress en situation professionnelle', 4, '', '37. Stress situ pro.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 35, 36, 'Poser sa voix', 4, '', '36. Poser sa voix.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 36, 23, 'Aide à l\'analyse des pratiques professionnelles', 4, '', '23. Analyse pratiques pro.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 37, 14, 'Organiser et exploiter une visite en entreprise', 5, '', '14. Visite en entreprise.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 38, 15, 'Aider les maîtres d\'apprentissage dans l\'évaluation des apprentis', 5, '', '15. Evaluation des apprentis.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 39, 46, 'Exploiter des situations technologiques ou professionnelles en enseignement général', 5, '', '46. Situations technopro.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 40, 53, 'Pour un véritable partenariat entreprise-CFA', 5, '', '53. Partenariat entr-cfa.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 41, 57, 'Comment prévenir les ruptures de contrat d\'apprentissage', 5, '', '57. Ruptures contrat.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 42, 1, 'Savoir écouter les apprentis pour les comprendre et les aider', 6, '', '01. Ecouter apprentis.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 43, 4, 'Conduire un entretien : des techniques utiles', 6, '', '04. Conduire entretien.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 44, 24, 'Comment l\'intelligence vient-elle aux apprentis… et aux autres ?', 6, '', '24. Intelligence apprentis.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 45, 48, 'Estime de soi, motivation et réussite', 6, '', '48. Estime de soi.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 46, 41, 'Concepts et théories liés aux apprentissages et à la psychopédagogie des jeunes adultes', 6, '', '41. Apprentissage et psychopédagogie.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 47, 50, 'Que faire face aux conduites addictives ?', 6, '', '50. Conduites addictives.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 48, 54, 'La gestion du leadership au sein des groupes', 6, '', '54. Gestion leadership.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 49, 20, 'L\'erreur : un outil pour le formateur ?', 6, '', '20. Erreur outil.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 50, 13, 'Parler pour penser et apprendre', 6, '', '13. Parler pour penser.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 51, 9, 'Travailler efficacement en équipe', 0, '', '09. Travailler en équipe.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 52, 11, 'Conduire un projet à la réussite', 0, '', '11. Réussite d\'un projet.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 53, 26, 'Comment accompagner les candidats à la VAE', 0, '', '26. Accompagner candidats VAE.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 54, 40, 'Acquérir de nouvelles méthodes d\'accueil et d\'intégration des jeunes', 0, '', '40. Nouvelles méthodes d\'intégration.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 55, 42, 'Agir contre les discriminations', 0, '', '42. Discriminations.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 56, 45, 'Animer une réunion', 0, '', '45. Animer réunion.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 57, 51, 'Techniques pour un entretien préalable à une formation en CFA', 0, '', '51. Techniques entretien.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 58, 55, 'Réaliser un diagnostic d\'établissement', 0, '', '55. Diagnostic établissement.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 59, 59, 'Favoriser la confiance et le respect mutuel dans la classe', 0, '', '59. Confiance respect.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 60, 60, 'Prévention des risques professionnels (PRP) et habilitation électrique', 0, '', '60. Prevention risques PRP.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 61, 61, 'Organiser le lien entre période en entreprise et période en CFA', 0, '', '61. Lien Entrep-CFA.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 62, 62, 'Prévenir les décrochages dans la formation des apprentis', 0, '', '62. Prévenir décrochages.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 63, 63, 'L\'ADVP : une démarche éducative d\'accompagnement et d\'orientation', 0, '', '63. ADVP.pdf', NULL, NULL, 1 );
INSERT INTO `sa_formations` ( ID, formation_id, formation_title, formation_category, formation_themes, formation_url, formation_content, formation_comment, formation_active ) VALUES ( 64, 64, 'Intégrer des apprentis sourds ou malentendants dans un groupe', 0, '', '64. Intégrer apprentis malentendants.pdf', NULL, NULL, 1 );



/* Dump of table `sa_formations_ressource`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_formation_ressource` (
  `formation_ressource_formation_id` int unsigned DEFAULT NULL,
  `formation_ressource_worker_id` int unsigned DEFAULT NULL,
  `formation_ressource_comment` text,
  `formation_ressource_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`formation_ressource_formation_id`,`formation_ressource_worker_id`),
  CONSTRAINT `fk_formation_ressource_formation_id` FOREIGN KEY (`formation_ressource_formation_id`) REFERENCES `sa_formations`(`ID`),
  CONSTRAINT `fk_formation_ressource_worker_id` FOREIGN KEY (`formation_ressource_worker_id`) REFERENCES `sa_workers`(`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 2, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 4, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 9, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 11, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 13, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 14, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 14, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 14, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 17, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 17, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 17, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 21, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 21, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 21, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 22, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 22, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 22, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 23, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 25, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 25, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 25, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 1, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 37, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 38, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 40, 1, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 29, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 29, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 3, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 3, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 30, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 30, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 31, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 32, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 33, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 34, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 35, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 36, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 42, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 43, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 43, 4, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 45, 3, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 45, 4, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 47, 4, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 50, 5, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 55, 4, NULL, 1 );
INSERT INTO `sa_formation_ressource` ( formation_ressource_formation_id, formation_ressource_worker_id, formation_ressource_comment, formation_ressource_active ) VALUES ( 15, 5, NULL, 1 );



/* Dump of table `sa_themes`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_themes` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `theme_label` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `theme_label` (`theme_label`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 1, 'cfa' );
INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 2, 'formateur' );
INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 3, 'début' );
INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 4, 'hétérogénéité' );
INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 5, 'atout' );
INSERT INTO `sa_themes` ( ID, theme_label ) VALUES ( 6, 'pédagogie' );



/* Dump of table `sa_formation_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_formation_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `formation_type_category` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `formation_type_category` (`formation_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 0, 'Pas de catégorie' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 1, 'L\'outil informatique et les nouvelles technologies' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 2, 'Pédagogie de l\'alterance et pédagogie générale' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 3, 'Techniques d\'adaptation pédagogiques au public des apprentis' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 4, 'Technique de gestion de classe' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 5, 'De l\'entreprise au CFA' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 6, 'Psychopédagogie' );
INSERT INTO `sa_formation_type` ( ID, formation_type_category ) VALUES ( 7, 'Formations déstinées à l\'équipe de direction' );



/* Dump of table `sa_publications`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_publications` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `publication_formation_id` int unsigned NOT NULL DEFAULT '0',
  `publication_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `publication_category` smallint unsigned NOT NULL DEFAULT '0',
  `publication_comment` text,
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_publication_formation_id` FOREIGN KEY (`publication_formation_id`) REFERENCES `sa_formations`(`ID`),
  CONSTRAINT `fk_publication_category` FOREIGN KEY (`publication_category`) REFERENCES `sa_publication_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_publications` ( ID, publication_formation_id, publication_date, publication_category, publication_comment ) VALUES ( 1, 3, '2014-10-27 12:00:00', 1, NULL );
INSERT INTO `sa_publications` ( ID, publication_formation_id, publication_date, publication_category, publication_comment ) VALUES ( 2, 4, '2014-10-27 12:00:00', 1, NULL );



/* Dump of table `sa_publication_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_publication_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `publication_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `publication_type_category` (`publication_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_publication_type` ( ID, publication_type_category ) VALUES ( 1, 'Courrier' );
INSERT INTO `sa_publication_type` ( ID, publication_type_category ) VALUES ( 2, 'E-mail' );
INSERT INTO `sa_publication_type` ( ID, publication_type_category ) VALUES ( 3, 'Facebook' );
INSERT INTO `sa_publication_type` ( ID, publication_type_category ) VALUES ( 4, 'Twitter' );
INSERT INTO `sa_publication_type` ( ID, publication_type_category ) VALUES ( 5, 'Google+' );



/* Dump of table `sa_contracts`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_contracts` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `contract_category` smallint unsigned NOT NULL DEFAULT '0',
  `contract_interlocutor_id` int unsigned NOT NULL DEFAULT '0',
  `contract_date_signature` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `contract_abstract` varchar(1024) NOT NULL DEFAULT '',
  `contract_url` varchar(255) NOT NULL DEFAULT '',
  `contract_comment` text,
  `contract_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_contract_category` FOREIGN KEY (`contract_category`) REFERENCES `sa_contract_type`(`ID`),
  CONSTRAINT `fk_contract_interlocutor_id` FOREIGN KEY (`contract_interlocutor_id`) REFERENCES `sa_assignments`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_contracts` ( ID, contract_category, contract_interlocutor_id, contract_date_signature, contract_abstract, contract_url, contract_comment, contract_active ) VALUES ( 1, 1, 2, '2015-12-08 12:00:00', 'Faire de l\'hétérogénéité un atout pédagogique (2j) + suivi (1j)', '/CFA Ardennes/20151210-recu/Convention.pdf', NULL, 1 );



/* Dump of table `sa_contract_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_contract_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `contract_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `contract_type_category` (`contract_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_contract_type` ( ID, contract_type_category ) VALUES ( 1, 'Convention' );



/* Dump of table `sa_actions`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_actions` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `action_contract_id` int unsigned NOT NULL DEFAULT '0',
  `action_formation_id` int unsigned NOT NULL DEFAULT '0',
  `action_site_id` int unsigned NOT NULL DEFAULT '0',
  `action_date_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `action_date_end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `action_nb_hours` smallint unsigned NOT NULL DEFAULT '6',
  `action_comment` text,
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_action_contract_id` FOREIGN KEY (`action_contract_id`) REFERENCES `sa_contracts`(`ID`),
  CONSTRAINT `fk_action_formation_id` FOREIGN KEY (`action_formation_id`) REFERENCES `sa_formations`(`ID`),
  CONSTRAINT `fk_action_site_id` FOREIGN KEY (`action_site_id`) REFERENCES `sa_sites`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_actions` ( ID, action_contract_id, action_formation_id, action_site_id, action_date_start, action_date_end, action_nb_hours, action_comment ) VALUES ( 1, 1, 2, 2, '2105-12-14 09:00:00', '2015-12-15 16:30:00', 12, NULL );



/* Dump of table `sa_actors`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_actors` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `actor_action_id` int unsigned NOT NULL DEFAULT '0',
  `actor_person_id` int unsigned NOT NULL DEFAULT '0',
  `actor_type_id` smallint unsigned NOT NULL DEFAULT '0',
  `actor_comment` text,
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_actor_action_id` FOREIGN KEY (`actor_action_id`) REFERENCES `sa_actions`(`ID`),
  CONSTRAINT `fk_actor_person_id` FOREIGN KEY (`actor_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_actor_type_id` FOREIGN KEY (`actor_type_id`) REFERENCES `sa_actor_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_actors` ( ID, actor_action_id, actor_person_id, actor_type_id, actor_comment ) VALUES ( 1, 1, 2, 1, NULL );
INSERT INTO `sa_actors` ( ID, actor_action_id, actor_person_id, actor_type_id, actor_comment ) VALUES ( 2, 1, 5, 16, NULL );



/* Dump of table `sa_actor_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_actor_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `actor_type_category` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `actor_type_category` (`actor_type_category`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_actor_type` ( ID, actor_type_category ) VALUES ( 1, 'Interlocuteur principal' );
INSERT INTO `sa_actor_type` ( ID, actor_type_category ) VALUES ( 2, 'Interlocuteur' );
INSERT INTO `sa_actor_type` ( ID, actor_type_category ) VALUES ( 16, 'Formateur' );
INSERT INTO `sa_actor_type` ( ID, actor_type_category ) VALUES ( 32, 'Stagiaire' );




/* Dump of table `sa_recurrent_payments`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_recurrent_payments` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `recurrent_payment_amount` float NOT NULL DEFAULT '0.0',
  `recurrent_payment_person_id` int unsigned DEFAULT NULL,
  `recurrent_payment_site_id` int unsigned DEFAULT NULL,
  `recurrent_payment_date_signature` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `recurrent_payment_next_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `recurrent_payment_iterator` smallint unsigned NOT NULL DEFAULT '1',
  `recurrent_payment_unit` varchar(24) NOT NULL DEFAULT 'MONTH',
  `recurrent_payment_ref` varchar(256) DEFAULT NULL,
  `recurrent_payment_url` varchar(255) NOT NULL DEFAULT '',
  `recurrent_payment_comment` text,
  `recurrent_payment_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_recurrent_payment_person_id` FOREIGN KEY (`recurrent_payment_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_recurrent_payment_site_id` FOREIGN KEY (`recurrent_payment_site_id`) REFERENCES `sa_sites`(`ID`),
  CONSTRAINT `ck_recurrent_payment_origin` CHECK ((`recurrent_payment_person_id` IS NOT NULL) OR (`recurrent_payment_site_id` IS NOT NULL))
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_recurrent_payments` ( ID, recurrent_payment_amount, recurrent_payment_person_id, recurrent_payment_site_id, recurrent_payment_date_signature, recurrent_payment_next_date, recurrent_payment_iterator, recurrent_payment_unit, recurrent_payment_ref, recurrent_payment_url, recurrent_payment_comment, recurrent_payment_active ) VALUES ( 1, 20.8, 6, NULL, '2016-02-05 12:00:00', '2016-02-05 12:00:00', 1, 'MONTH', 'BNP Frais Compte Pro', 'test1', 'Frais de gestion de banque à 50% pendant un an', 1 );
INSERT INTO `sa_recurrent_payments` ( ID, recurrent_payment_amount, recurrent_payment_person_id, recurrent_payment_site_id, recurrent_payment_date_signature, recurrent_payment_next_date, recurrent_payment_iterator, recurrent_payment_unit, recurrent_payment_ref, recurrent_payment_url, recurrent_payment_comment, recurrent_payment_active ) VALUES ( 2, 43.06, 3, NULL, '2016-07-19 12:00:00', '2016-07-19 12:00:00', 1, 'YEAR', '1\&1 Abonnement annuel', 'test2', 'Frais d\'abonnement 1\&1 basic 12 mois', 1 );
INSERT INTO `sa_recurrent_payments` ( ID, recurrent_payment_amount, recurrent_payment_person_id, recurrent_payment_site_id, recurrent_payment_date_signature, recurrent_payment_next_date, recurrent_payment_iterator, recurrent_payment_unit, recurrent_payment_ref, recurrent_payment_url, recurrent_payment_comment, recurrent_payment_active ) VALUES ( 3, 11.99, NULL, 4, '2016-08-19 12:00:00', '2016-08-19 12:00:00', 1, 'YEAR', '1\&1 Renouvellement domaine', 'test3', 'Renouvellement de domaine par 1\&1', 1 );



/* Dump of table `sa_factures`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_factures` (
  `ID` int unsigned NOT NULL AUTO_INCREMENT,
  `facture_amount` float NOT NULL DEFAULT '0.0',
  `facture_action_id` int unsigned DEFAULT NULL,
  `facture_person_id` int unsigned DEFAULT NULL,
  `facture_site_id` int unsigned DEFAULT NULL,
  `facture_date_issue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `facture_date_payment` datetime DEFAULT NULL,
  `facture_payment_type` smallint unsigned DEFAULT NULL,
  `facture_payment_ref` varchar(256) DEFAULT NULL,
  `facture_url` varchar(255) NOT NULL DEFAULT '',
  `facture_comment` text,
  PRIMARY KEY (`ID`),
  CONSTRAINT `fk_facture_action_id` FOREIGN KEY (`facture_action_id`) REFERENCES `sa_actions`(`ID`),
  CONSTRAINT `fk_facture_person_id` FOREIGN KEY (`facture_person_id`) REFERENCES `sa_persons`(`ID`),
  CONSTRAINT `fk_facture_site_id` FOREIGN KEY (`facture_site_id`) REFERENCES `sa_sites`(`ID`),
  CONSTRAINT `ck_facture_origin` CHECK ((`facture_person_id` IS NOT NULL) OR (`facture_site_id` IS NOT NULL)),
  CONSTRAINT `fk_facture_payment_type` FOREIGN KEY (`facture_payment_type`) REFERENCES `sa_payment_type`(`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 1, -10000.0, NULL, 4, NULL, '2015-12-17 14:15:00', '2016-01-20 12:00:00', 2, 'REMB ACQUISITION DEBOURS ENREGIST', 'test1', 'Acquisition de Sigma Apprentissage, avancés par Sébastien en chèque le 17/12/2015' );
INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 2, -750.0, NULL, 3, NULL, '2015-12-07 12:00:00', '2016-01-20 12:00:00', 2, 'REMB ACQUISITION DEBOURS ENREGIST', 'test2', 'Frais de debours, avancés par Sébastien en chèque le 07/12/2015' );
INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 3, -4500.0, NULL, 3, NULL, '2015-12-17 14:15:00', '2016-01-13 12:00:00', 2, 'HONORAIRES AVOCAT /BEN VIEILLECHA', 'test3', 'Honoraires de l\'avocate, avancés par Guy en chèque le 13/01/2016' );
INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 4, -1085.5, NULL, 5, NULL, '2015-12-18 12:00:00', '2016-01-18 12:00:00', 2, '/BEN MME AUDIBERT MARTINE /REFDO', 'test4', '2 journées + frais' );
INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 5, -25.0, NULL, 4, NULL, '2015-12-17 14:15:00', '2016-01-20 12:00:00', 2, 'REMB ACQUISITION DEBOURS ENREGIST', 'test5', 'Paiement enregistrement des statuts au SIE, avancés par Sébastien en chèque le 28/12/2015' );
INSERT INTO `sa_factures` ( ID, facture_amount, facture_action_id, facture_person_id, facture_site_id, facture_date_issue, facture_date_payment, facture_payment_type, facture_payment_ref, facture_url, facture_comment ) VALUES ( 6, 2285.5, 1, 2, NULL, '2015-12-31 12:00:00', NULL, NULL, NULL, 'test6', 'Formation réalisée par Martine Saint Dizier en décembre 2015' );



/* Dump of table `sa_payment_type`
 * ------------------------------------------------------------*/


CREATE TABLE `sa_payment_type` (
  `ID` smallint unsigned NOT NULL AUTO_INCREMENT,
  `payment_type_category` varchar(256) NOT NULL DEFAULT '',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


INSERT INTO `sa_payment_type` ( ID, payment_type_category ) VALUES ( 1, 'Chèque' );
INSERT INTO `sa_payment_type` ( ID, payment_type_category ) VALUES ( 2, 'Virement' );
INSERT INTO `sa_payment_type` ( ID, payment_type_category ) VALUES ( 3, 'Espèces' );
INSERT INTO `sa_payment_type` ( ID, payment_type_category ) VALUES ( 4, 'Prélèvement' );



