SET NAMES UTF8;

DROP TABLE IF EXISTS`tab_fichiers`;
CREATE TABLE  `tab_fichiers` (
`FIC_CLE` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`FIC_NOM` VARCHAR( 50 ) NOT NULL ,
`FIC_KEY` VARCHAR( 32 ) NOT NULL ,
`FIC_TYPE` VARCHAR( 15 ) NOT NULL ,
`FIC_EXT` VARCHAR( 5 ) NOT NULL ,
`FIC_AJOUT` DATETIME NOT NULL ,
`JOU_CLE` INT UNSIGNED NOT NULL ,
`MAT_CLE` INT UNSIGNED NOT NULL ,
`FIC_VUS` INT UNSIGNED NOT NULL ,
`FIC_PDS` INT UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;



DROP TABLE IF EXISTS`rel_eqi_jou`;

CREATE TABLE IF NOT EXISTS `rel_eqi_jou` (
  `EQI_CLE` int(10) unsigned NOT NULL DEFAULT '0',
  `JOU_CLE` int(10) unsigned NOT NULL DEFAULT '0',
  `JOU_POSTE` int(11) NOT NULL DEFAULT '0',
  `JOU_DATE_AJ` datetime NOT NULL,
  PRIMARY KEY (`EQI_CLE`,`JOU_CLE`),
  KEY `FK_JOU_CLE` (`JOU_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;




DROP TABLE IF EXISTS`rel_tns_eqi`;
CREATE TABLE IF NOT EXISTS `rel_tns_eqi` (
  `TNS_CLE` int(10) unsigned NOT NULL,
  `EQI_CLE` int(10) unsigned NOT NULL,
  `EQI_VAL` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `POU_CLE` int(10) unsigned NOT NULL DEFAULT '0',
  `EQI_TNS` enum('0','1') COLLATE utf8_swedish_ci NOT NULL DEFAULT '1',
  PRIMARY KEY (`TNS_CLE`,`EQI_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;




DROP TABLE IF EXISTS`rel_tns_eqi_mat`;
CREATE TABLE IF NOT EXISTS `rel_tns_eqi_mat` (
  `MAT_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TNS_CLE` int(10) unsigned NOT NULL,
  `MAT_TOUR` mediumint(8) unsigned NOT NULL,
  `MAT_POU` mediumint(8) unsigned NOT NULL,
  `MAT_LB` enum('0','1') COLLATE utf8_swedish_ci NOT NULL,
  `EQI_CLE1` int(10) unsigned NOT NULL,
  `EQI_S1` int(10) unsigned DEFAULT NULL,
  `EQI_CLE2` int(10) unsigned NOT NULL,
  `EQI_S2` int(10) unsigned DEFAULT NULL,
  `MAT_DATE` datetime DEFAULT NULL,
  `MAT_LIEU` varchar(250) COLLATE utf8_swedish_ci DEFAULT NULL,
  `MAT_ETAT` tinyint(3) unsigned NOT NULL,
  `MAT_TYPE` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `MAT_DETAILS` text COLLATE utf8_swedish_ci,
  `MAT_FLAG` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`MAT_CLE`),
  KEY `FK_TNS_CLE` (`TNS_CLE`),
  KEY `FK_EQI_CLE1` (`EQI_CLE1`),
  KEY `FK_EQI_CLE2` (`EQI_CLE2`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;




CREATE TABLE IF NOT EXISTS `tab_cms` (
  `CMS_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `CMS_AUTEUR` int(11) NOT NULL,
  `CMS_TITRE` varchar(200) COLLATE utf8_swedish_ci NOT NULL,
  `CMS_TEXTE` text COLLATE utf8_swedish_ci NOT NULL,
  `CMS_DATE` datetime NOT NULL,
  `CMS_ACTIF` int(11) NOT NULL,
  `CMS_PAGE_ACCUEIL` int(11) NOT NULL,
  `CMS_COM` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`CMS_CLE`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=3 ;


INSERT INTO `tab_cms` (`CMS_CLE`, `CMS_AUTEUR`, `CMS_TITRE`, `CMS_TEXTE`, `CMS_DATE`, `CMS_ACTIF`, `CMS_PAGE_ACCUEIL`, `CMS_COM`) VALUES
(1, 1, 'Bienvenue sur votre zKup', '<p>&nbsp;Bienvenue sur votre nouveau site zKup !</p>\r\n<p>&nbsp;</p>\r\n<p><img width="147" height="200" alt="" src="/app/config/cache/upload/divers/BOX009.jpg" /></p>', NOW(), 1, 1, 1),
(2, 1, 'Contact', '<p>Toute r&eacute;clamation doit se faire aupr&egrave;s de l''administrateur du tournoi</p>', NOW(), 1, 0, 0);


DROP TABLE IF EXISTS`tab_commentaires`;
CREATE TABLE IF NOT EXISTS `tab_commentaires` (
  `COM_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `JOU_CLE` int(11) NOT NULL,
  `COM_DEST_CLE` int(11) NOT NULL,
  `COM_DEST_TYPE` varchar(3) NOT NULL,
  `COM_TEXT` text NOT NULL,
  `COM_DATE` datetime NOT NULL,
  `COM_ACTIF` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`COM_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS`tab_logs`;
CREATE TABLE IF NOT EXISTS `tab_logs` (
  `LOG_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `LOG_DATE` datetime NOT NULL,
  `LOG_TYPE` enum('ERROR','DEBUG','INFO') NOT NULL,
  `LOG_CODE` varchar(40) NOT NULL,
  `LOG_TITRE` varchar(255) NOT NULL,
  `LOG_MESSAGE` text NOT NULL,
  `LOG_PRIVATE` enum('0','1') NOT NULL DEFAULT '1',
  `LOG_DEST` varchar(15) NOT NULL,
  `LOG_DEST_CLE` int(11) NOT NULL,
  PRIMARY KEY (`LOG_CLE`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS`tab_equipes`;
CREATE TABLE IF NOT EXISTS `tab_equipes` (
  `EQI_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `EQI_NOM` varchar(40) COLLATE utf8_swedish_ci NOT NULL,
  `EQI_TAG` varchar(15) COLLATE utf8_swedish_ci NOT NULL,
  `EQI_PASS` varchar(32) COLLATE utf8_swedish_ci NOT NULL,
  `EQI_PAYS` varchar(2) COLLATE utf8_swedish_ci NOT NULL DEFAULT 'fr',
  `EQI_LOC` varchar(30) COLLATE utf8_swedish_ci DEFAULT '',
  `EQI_URL` varchar(100) COLLATE utf8_swedish_ci DEFAULT '',
  `EQI_CONTACT` varchar(100) COLLATE utf8_swedish_ci DEFAULT '',
  `EQI_LOGO` varchar(100) COLLATE utf8_swedish_ci DEFAULT '',
  `EQI_SLOGAN` varchar(200) COLLATE utf8_swedish_ci DEFAULT '',
  `EQI_JEU` smallint(5) unsigned DEFAULT '1',
  `EQI_DESC` text COLLATE utf8_swedish_ci,
  `EQI_DATE_INS` datetime NOT NULL,
  `EQI_ETAT` tinyint(3) unsigned DEFAULT '1',
  PRIMARY KEY (`EQI_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_joueurs`;
CREATE TABLE IF NOT EXISTS `tab_joueurs` (
  `JOU_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `JOU_LOGIN` varchar(40) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_PASS` varchar(32) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_MAIL` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_CODE_CONF` varchar(32) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_ETAT` smallint(5) unsigned NOT NULL DEFAULT '0',
  `JOU_SID` varchar(32) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_IP` varchar(32) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_PAYS` varchar(3) COLLATE utf8_swedish_ci NOT NULL DEFAULT 'fr',
  `JOU_NUM_MEMBRE` varchar(200) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_NOM` varchar(40) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_PRE` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_LOC` varchar(30) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_SEXE` enum('0','1') COLLATE utf8_swedish_ci NOT NULL DEFAULT '0',
  `JOU_DESC` text COLLATE utf8_swedish_ci NOT NULL,
  `JOU_AVATAR` varchar(200) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_CONTACT` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
  `JOU_DATE_INS` datetime NOT NULL,
  `JOU_DATE_NAI` date NOT NULL,
  `JOU_LIC` text COLLATE utf8_swedish_ci NOT NULL,
  `JOU_MAIL_MP` enum('0','1') COLLATE utf8_swedish_ci NOT NULL DEFAULT '1',
  `JOU_ACTIVITE` INT( 15 ) NOT NULL,
  PRIMARY KEY (`JOU_CLE`),
  UNIQUE KEY `JOU_LOGIN` (`JOU_LOGIN`),
  UNIQUE KEY `JOU_MAIL` (`JOU_MAIL`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_ladder`;
CREATE TABLE IF NOT EXISTS `tab_ladder` (
  `TNS_CLE` int(10) unsigned NOT NULL,
  `EQI_CLE` int(10) unsigned NOT NULL,
  `LAD_DATE_INSC` date NOT NULL,
  `LAD_NB_VICT` int(11) NOT NULL DEFAULT '0',
  `LAD_NB_NUL` int(11) NOT NULL DEFAULT '0',
  `LAD_NB_DEF` int(11) NOT NULL DEFAULT '0',
  `LAD_GA` int(11) NOT NULL DEFAULT '0',
  `LAD_PENA` int(11) NOT NULL DEFAULT '0',
  `LAD_PTS` int(11) NOT NULL,
  `LAD_ETAT` int(11) NOT NULL,
  `LAD_PTS_AVANT` int(11) NOT NULL,
  `LAD_NB_MAT` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;




DROP TABLE IF EXISTS`tab_mails`;
CREATE TABLE IF NOT EXISTS `tab_mails` (
  `MAIL_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `MAIL_TAG` varchar(15) COLLATE utf8_swedish_ci NOT NULL,
  `MAIL_TITRE` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
  `MAIL_MESSAGE` text COLLATE utf8_swedish_ci NOT NULL,
  PRIMARY KEY (`MAIL_CLE`),
  UNIQUE KEY `MAIL_TAG` (`MAIL_TAG`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=19 ;


INSERT INTO `tab_mails` (`MAIL_CLE`, `MAIL_TAG`, `MAIL_TITRE`, `MAIL_MESSAGE`) VALUES
(2, 'insc.eq.comp', 'Une équipe vient de s''inscrire', '<p>Vous venez de recevoir une demande d''inscription &agrave; une&nbsp;comp&eacute;tition.<br />\r\n<br />\r\n<u><strong>Informations :</strong></u></p>\r\n<p><strong>Comp&eacute;tition</strong>&nbsp;:&nbsp;{{$competition}}<br />\r\n<strong>Equipe</strong> :&nbsp;{{$equipe}}<br />\r\n<br />\r\nMerci de vous connecter &agrave; votre administration zKup afin de r&eacute;pondre &agrave; cette demande.</p>\r\n<p>{{$url}}</p>'),
(3, 'insc.eq.c.ref', 'Votre demande d''inscription a été refusée', '<p>&nbsp;Bonjour {{$capitaine}},</p>\r\n<p>&nbsp;</p>\r\n<p>Nous sommes au regret de vous annoncer que votre demande<br />\r\nd''inscription &agrave; la comp&eacute;tition {{$competition}} sur {{$url}}&nbsp;<br />\r\na &eacute;t&eacute; refus&eacute;e.</p>\r\n<p>&nbsp;</p>\r\n<p><u><strong>Explications du responsable :</strong></u></p>\r\n<p><em>{{$raison}}</em><br />\r\n&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>{{$url}}</p>'),
(4, 'insc.eq.c.val', 'Votre demande d''inscription a été validée', '<p>&nbsp;&nbsp;Bonjour&nbsp;{{$capitaine}},</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Nous avons le plaisir de vous annoncer que votre demande<br />\r\nd''inscription &agrave; la comp&eacute;tition {{$competition}} sur {{$url}}&nbsp;<br />\r\na &eacute;t&eacute; <strong>valid&eacute;e</strong>.<b><br />\r\n</b></p>\r\n<p>Pour plus d''informations sur la comp&eacute;tition &agrave; cette adresse :</p>\r\n<p>{{$url_competition}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t !</p>\r\n</div>\r\n<p>&nbsp;</p>'),
(5, 'insc.joueur', 'Valider votre inscription', '<p>Bonjour <strong>{{$nom}} {{$prenom}}</strong>,</p>\r\n<p>&nbsp;Nous vous souhaitons la bienvenue sur {{$url}} et nous vous remercions de vous &ecirc;tre inscrit<br />\r\nsur notre site web.</p>\r\n<p>Afin de terminer votre inscription il vous suffit simplement de cliquer sur le lien ci-dessous, ou de le copier dans votre navigateur web.</p>\r\n<p><strong><span style="color: rgb(0, 0, 255); ">{{$confirmation}}</span></strong></p>\r\n<p>Voici les informations relatives &agrave; votre inscription :</p>\r\n<ul>\r\n    <li><strong>Votre nom d''utilisateur&nbsp;</strong>: {{$login}}</li>\r\n    <li><strong>Votre mot de passe</strong> : {{$pwd}}</li>\r\n</ul>\r\n<p style="text-align: left; ">&nbsp;</p>\r\n<p style="text-align: left; ">Voici le lien pour acc&eacute;der &agrave; votre compte :&nbsp;<strong><span style="color: rgb(0, 0, 255); ">{{$compte}}</span></strong></p>\r\n<p>&nbsp;</p>\r\n<p>Nous esp&eacute;rons vous revoir tr&egrave;s prochainement sur notre site :<br />\r\n{{$url}}</p>\r\n<p>&nbsp;</p>\r\n<p>Toute l''&eacute;quipe</p>\r\n<p>&nbsp;</p>'),
(6, 'r.date.eq1.val', '[Activité matchs] Demande validation des dates', '<p>Bonjour {{$login}},</p>\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition : <strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient de valider ses informations de date et de lieu :</p>\r\n<p><strong>Date :&nbsp;</strong>{{$date}}</p>\r\n<p><strong>Lieu :&nbsp;</strong>{{$lieu}}</p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Vous devez :</strong></span></p>\r\n<ul>\r\n    <li>Saisir votre lieu de rencontre</li>\r\n</ul>\r\n<p><strong>Vous pouvez :</strong></p>\r\n<ul>\r\n    <li>Accepter la date de cette rencontre\r\n    <ul>\r\n        <li>et donc passer en &quot;Match &agrave; jouer&quot;</li>\r\n    </ul>\r\n    </li>\r\n    <li>Proposer une nouvelle date de rencontre\r\n    <ul>\r\n        <li>L''&eacute;quipe adverse devra confirmer cette date ou en proposer une nouvelle</li>\r\n    </ul>\r\n    </li>\r\n</ul>\r\n<p>Pour saisir vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>'),
(7, 'r.date2.eq1.val', '[Activité matchs] Dates validées - Match à jouer', '<p>&nbsp;Bonjour {{$login}},</p>\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient d''<strong>accepter votre date</strong> :</p>\r\n<p><strong>Date :&nbsp;</strong>{{$date}}</p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Vous devez :</strong></span></p>\r\n<ul>\r\n    <li>Jouer le match aux horaires et lieux pr&eacute;vus</li>\r\n    <li>Reporter les scores sur votre fiche de match<b><br />\r\n    </b></li>\r\n</ul>\r\n<p>&nbsp;</p>\r\n<p>Pour saisir vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>'),
(9, 'r.date2.eq1.ref', '[Activité matchs] Dates refusées - intervention admin', '<p>&nbsp;&nbsp;Bonjour,</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient de&nbsp;<span style="color: rgb(255, 0, 0); "><strong>refuser votre date.</strong></span></p>\r\n<p>Comme <strong>vous n''avez pas trouv&eacute; d''accord commun&nbsp;</strong>sur un horaire,&nbsp;<span style="color: rgb(255, 0, 0); "><strong>un admin a &eacute;t&eacute; alert&eacute;</strong></span>.</p>\r\n<p>&nbsp;</p>\r\n<p><strong>Rencontre </strong>: {{$eq1}} <em>vs</em> {{$eq2}}</p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;</p>\r\n<p>&nbsp;</p>'),
(8, 'r.date.eq2.ref', '[Activité matchs] Dates refusées - demande validation', '<p>&nbsp;Bonjour {{$login}},\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient de valider ses informations de lieu :<b><br />\r\n</b></p>\r\n<p><strong>Lieu :&nbsp;</strong>{{$lieu}}</p>\r\n<p>&nbsp;</p>\r\n<p>Elle a &eacute;galement <span style="color: rgb(255, 0, 0); "><strong>refus&eacute;e votre date</strong></span> et vous<strong>&nbsp;propose une nouvelle date :</strong></p>\r\n<p><strong>Date :&nbsp;</strong>{{$date}}</p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Vous devez :</strong></span></p>\r\n<ul>\r\n    <li><strong>Valider </strong>cette date ou <strong>proposer une nouvelle date</strong></li>\r\n</ul>\r\n<p>&nbsp;</p>\r\n<p>Pour saisir vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n</p>\r\n<p>A bient&ocirc;t&nbsp;</p>\r\n<p>&nbsp;</p>'),
(10, 'r.maj', '[Activité matchs] Mise à jour de la rencontre', '<p>&nbsp;&nbsp;Bonjour,\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Un administrateur vient de modifier des informations sur votre rencontre.</p>\r\n<p><strong>Rencontre&nbsp;</strong>: {{$eq1}}&nbsp;<em>vs</em>&nbsp;{{$eq2}}</p>\r\n<p><strong>Etat </strong>: {{$etat}}</p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</p>\r\n<p>&nbsp;</p>'),
(11, 'r.s.eq1.val', '[Activité matchs] Demande validation des scores', '<p>&nbsp;&nbsp;Bonjour {{$login}},\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient de <strong>saisir les scores.</strong><b><br />\r\n</b></p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Vous devez :</strong></span></p>\r\n<ul>\r\n    <li><strong>Valider les scores</strong> ou faire une <strong>nouvelle proposition de scores</strong></li>\r\n</ul>\r\n<p>&nbsp;</p>\r\n<p>Pour saisir vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n</p>'),
(12, 'r.val', '[Activité matchs] Match clos', '<p>&nbsp;&nbsp;&nbsp;Bonjour,</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Toutes les informations ayant &eacute;t&eacute; correctement saisies, <strong>la rencontre est termin&eacute;e</strong>.</p>\r\n<p><strong>Rencontre&nbsp;</strong>: {{$eq1}}&nbsp;<em>vs</em>&nbsp;{{$eq2}}<b><br />\r\n</b></p>\r\n</div>\r\n<p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n</p>\r\n<p>&nbsp;&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>'),
(13, 'r.admin', '[Activité matchs] intervention admin', '<p>&nbsp;Bonjour,\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Un admin a &eacute;t&eacute; alert&eacute; suite &agrave; la demande d''intervention.</strong></span></p>\r\n<p>&nbsp;</p>\r\n<p><strong>Rencontre&nbsp;</strong>: {{$eq1}}&nbsp;<em>vs</em>&nbsp;{{$eq2}}</p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n</p>'),
(14, 'insc.eq.c.dis', 'Votre équipe a été retirée de la compétition', '<p><span class="Apple-style-span" style="font-family: ''Times New Roman''; font-size: medium; ">\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;&nbsp;Bonjour&nbsp;{{$capitaine}},</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Nous avons le regr&egrave;s de vous annoncer que votre &eacute;quipe vient<br />\r\nd''&ecirc;tre <strong>retir&eacute;e de la comp&eacute;tition</strong> {{$competition}} sur {{$url}}&nbsp;.<b><br />\r\n</b></p>\r\n<p>Plus d''informations sur la comp&eacute;tition &agrave; cette adresse :</p>\r\n<p>{{$url_competition}}</p>\r\n<p>&nbsp;</p>\r\n<p>Merci</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n</div>\r\n</span></p>'),
(15, 'insc.eq.c.ena', 'Votre équipe ré-intègre la compétition', '<p><span class="Apple-style-span" style="font-family: ''Times New Roman''; font-size: medium; ">\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;&nbsp;Bonjour&nbsp;{{$capitaine}},</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Nous avons le plaisir de vous annoncer que votre &eacute;quipe<br />\r\npeut &agrave; nouveau <strong>participer &agrave; la comp&eacute;tition </strong>{{$competition}} sur {{$url}}&nbsp;.<b><br />\r\n</b></p>\r\n<p>Pplus d''informations sur la comp&eacute;tition &agrave; cette adresse :</p>\r\n<p>{{$url_competition}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t !</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n</div>\r\n</span></p>'),
(16, 'r.eq2.refus', '[Match] Refus du match', '<p>&nbsp;Bonjour,</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}} vient de refuser votre demande de match.</p>\r\n<p>&nbsp;</p>\r\n<p>{{$url}}&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t!</p>\r\n</div>\r\n<p>&nbsp;</p>'),
(17, 'j.oubli.pwd', 'Rappel de vos identifiants', '<p>Bonjour,</p>\r\n<p>Vous avez demand&eacute; &agrave; changer de mot de passe.</p>\r\n<p>&nbsp;</p>\r\n<p>Voici les informations relatives &agrave; votre inscription :</p>\r\n<p>\r\n<ul>\r\n    <li><strong>Votre nom d''utilisateur&nbsp;</strong>: {{$login}}</li>\r\n    <li><strong>Votre nouveau mot de passe</strong>&nbsp;: {{$pwd}}</li>\r\n</ul>\r\n<p style="text-align: left; ">&nbsp;</p>\r\n<p style="text-align: left; ">Voici le lien pour acc&eacute;der &agrave; votre compte :&nbsp;<strong><span style="color: rgb(0, 0, 255); ">{{$compte}}</span></strong></p>\r\n<p>&nbsp;</p>\r\n<p>Nous esp&eacute;rons vous revoir tr&egrave;s prochainement sur notre site :<br />\r\n{{$url}}</p>\r\n</p>'),
(18, 'r.appeladmin', 'Demande d''intervention', '<p>&nbsp;<span class="Apple-style-span" style="font-family: Times; font-size: medium; "><span class="Apple-style-span" style="font-family: Arial, Verdana, sans-serif; font-size: 12px; ">&nbsp;Bonjour,</span>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0); "><strong>Une &eacute;quipe demande votre intervention.</strong></span></p>\r\n<p>&nbsp;</p>\r\n<p><strong>Rencontre&nbsp;</strong>: {{$eq1}}&nbsp;<em>vs</em>&nbsp;{{$eq2}}</p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter les informations, rendez vous sur les matchs de cette comp&eacute;tition<br />\r\npuis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n</div>\r\n</span></p>'),
(19, 'r.nouveau', '[Activité Matchs] Une équipe souhaite vous défier', '<p>&nbsp;&nbsp;Bonjour,</p>\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>L''&eacute;quipe {{$adversaire}}<span style="font-weight: bold;"> souhaite vous d&eacute;fier.</span><b><br />\r\n</b></p>\r\n<p>&nbsp;</p>\r\n<p><span style="color: rgb(255, 0, 0);"><strong>Vous pouvez :</strong></span></p>\r\n<ul>\r\n    <li>Refuser le d&eacute;fi</li>\r\n    <li>Attendre que l''&eacute;quipe<strong> {{$adversaire}}</strong> propose une date</li>\r\n</ul>\r\n<p>&nbsp;</p>\r\n<p>Pour en savoir plus, rendez vous sur vos matchs puis cliquez sur cette rencontre.</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n<p>&nbsp;</p>'),
(20, 'mp.new', 'Un nouveau message privé vient d''arriver', '<p>Bonjour,</p>\r\n<p>Vous avez re&ccedil;u un nouveau message priv&eacute;.</p>\r\n<p>Vous pouvez voir votre nouveau message en cliquant sur le lien suivant:</p>\r\n<p>{{$url_message}}</p>\r\n<p>&nbsp;</p>\r\n<p>Vous avez demand&eacute; &agrave; &ecirc;tre averti dans ce cas,<br />\r\nrappelez-vous que vous pouvez choisir de <br />\r\nne plus &ecirc;tre averti de l''arriv&eacute;e de nouveaux <br />\r\nmessages priv&eacute;s en modifiant l''option appropri&eacute;e <br />\r\ndans votre compte.</p>'),
(21, 'r.val.admin', '[Activité matchs] Match validé par un admin', '<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;&nbsp; Bonjour,</p>\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<div style="background-color: rgb(255, 255, 255); padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Arial, Verdana, sans-serif; font-size: 12px; ">\r\n<p>&nbsp;</p>\r\n<p>Informations concernant la comp&eacute;tition :&nbsp;<strong>{{$competition}}</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Un administrateur vient de <strong>cl&ocirc;turer votre rencontre</strong>.</p>\r\n<p><strong>Rencontre&nbsp;</strong>: {{$eq1}}&nbsp;<em>vs</em>&nbsp;{{$eq2}}<b><br />\r\n</b></p>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>Pour consulter vos informations, rendez vous sur vos matchs puis cliquez sur cette rencontre :</p>\r\n<p>{{$page_matchs}}</p>\r\n<p>&nbsp;</p>\r\n<p>A bient&ocirc;t</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</div>\r\n<p>&nbsp;</p>\r\n</div>');



DROP TABLE IF EXISTS`tab_messages`;
CREATE TABLE IF NOT EXISTS `tab_messages` (
  `MES_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `JOU_EXP` int(11) NOT NULL,
  `JOU_DEST` int(11) NOT NULL,
  `MES_CONTENU` text CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL,
  `MES_LU` tinyint(4) NOT NULL DEFAULT '0',
  `MES_DATE` datetime NOT NULL,
  `MES_SUP_EXP` tinyint(4) NOT NULL DEFAULT '0',
  `MES_SUP_DEST` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`MES_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_options`;
CREATE TABLE IF NOT EXISTS `tab_options` (
  `OPT_CLE` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `OPT_NOM` varchar(40) COLLATE utf8_swedish_ci NOT NULL,
  `OPT_VAL` text COLLATE utf8_swedish_ci NOT NULL,
  `OPT_AUTO` smallint(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (`OPT_CLE`),
  UNIQUE KEY `nom` (`OPT_NOM`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_partenaires`;
CREATE TABLE IF NOT EXISTS `tab_partenaires` (
  `PAR_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `PAR_NOM` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
  `PAR_URL` varchar(255) COLLATE utf8_swedish_ci NOT NULL,
  `PAR_IMG` varchar(255) COLLATE utf8_swedish_ci NOT NULL,
  `PAR_DESC` text COLLATE utf8_swedish_ci NOT NULL,
  `PAR_POS` smallint(6) NOT NULL DEFAULT '0',
  `PAR_ACTIF` enum('0','1') COLLATE utf8_swedish_ci NOT NULL DEFAULT '1',
  PRIMARY KEY (`PAR_CLE`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=2 ;


INSERT INTO `tab_partenaires` (`PAR_CLE`, `PAR_NOM`, `PAR_URL`, `PAR_IMG`, `PAR_DESC`, `PAR_POS`, `PAR_ACTIF`) VALUES
(1, 'zKup', 'http://www.zkup.net', '1.jpg', '', 0, '1');


DROP TABLE IF EXISTS`tab_poules`;
CREATE TABLE IF NOT EXISTS `tab_poules` (
  `POU_CLE` int(10) unsigned NOT NULL,
  `POU_NOM` varchar(40) COLLATE utf8_swedish_ci DEFAULT NULL,
  `TNS_CLE` int(10) unsigned NOT NULL,
  PRIMARY KEY (`POU_CLE`,`TNS_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;




DROP TABLE IF EXISTS`tab_reglements`;
CREATE TABLE IF NOT EXISTS `tab_reglements` (
  `REG_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `REG_JEU` smallint(5) unsigned NOT NULL,
  `REG_NOM` varchar(150) COLLATE utf8_swedish_ci NOT NULL,
  `REG_TEXTE` longtext COLLATE utf8_swedish_ci NOT NULL,
  PRIMARY KEY (`REG_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_serveurs`;
CREATE TABLE IF NOT EXISTS `tab_serveurs` (
  `SER_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `SER_NOM` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
  `SER_IP` varchar(255) COLLATE utf8_swedish_ci NOT NULL,
  `SER_JEU` int(11) NOT NULL,
  PRIMARY KEY (`SER_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;




DROP TABLE IF EXISTS`tab_shoutbox`;
CREATE TABLE IF NOT EXISTS `tab_shoutbox` (
  `SHB_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `SHB_AUTEUR` int(11) NOT NULL,
  `SHB_MESSAGE` varchar(250) COLLATE utf8_swedish_ci NOT NULL,
  `SHB_DATE` datetime NOT NULL,
  PRIMARY KEY (`SHB_CLE`),
  KEY `SHB_AUTEUR` (`SHB_AUTEUR`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=2 ;


INSERT INTO `tab_shoutbox` (`SHB_CLE`, `SHB_AUTEUR`, `SHB_MESSAGE`, `SHB_DATE`) VALUES
(1, 1, 'Premier message dans la shoutbox !', '2010-05-09 12:00:00');


DROP TABLE IF EXISTS`tab_tournois`;
CREATE TABLE IF NOT EXISTS `tab_tournois` (
  `TNS_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TNS_NOM` varchar(30) COLLATE utf8_swedish_ci NOT NULL,
  `TNS_NB_EQ_EVT` int(10) unsigned NOT NULL,
  `TNS_NB_EQ_TNS` int(10) unsigned NOT NULL,
  `TNS_NB_J` int(10) unsigned NOT NULL,
  `TNS_NB_POU` int(11) unsigned NOT NULL DEFAULT '0',
  `TNS_DESC` text COLLATE utf8_swedish_ci NOT NULL,
  `TNS_LB` enum('0','1') COLLATE utf8_swedish_ci NOT NULL DEFAULT '0',
  `TNS_TYPE` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `TNS_ETAT` tinyint(4) NOT NULL DEFAULT '0',
  `TNS_JEU` smallint(5) unsigned NOT NULL,
  `REG_CLE` int(10) unsigned NOT NULL,
  `TNS_G` tinyint(4) NOT NULL,
  `TNS_N` tinyint(4) NOT NULL,
  `TNS_D` tinyint(4) NOT NULL,
  `TNS_DIR` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
  `TNS_NB_T` smallint(11) unsigned NOT NULL,
  `TNS_NB_M` smallint(11) unsigned NOT NULL,
  `TNS_MAT_FLAG` tinyint(3) unsigned NOT NULL,
  `TNS_VAL_ADM` TINYINT( 4 ) DEFAULT 1,
  PRIMARY KEY (`TNS_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS`tab_responsables`;
CREATE TABLE IF NOT EXISTS `tab_responsables` (
  `RESP_CLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `JOU_CLE` int(10) unsigned NOT NULL,
  `TNS_CLE` int(10) unsigned NOT NULL,
  PRIMARY KEY (`RESP_CLE`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS`rel_jou_cha`;
CREATE TABLE `rel_jou_cha` (
  `JOU_CLE` int(10) unsigned NOT NULL,
  `CHA_CLE` int(10) unsigned NOT NULL,
  `CHA_VAL` varchar(255) NOT NULL,
  UNIQUE KEY `JOU_CLE` (`JOU_CLE`,`CHA_CLE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;

DROP TABLE IF EXISTS`tab_champs`;
CREATE TABLE `tab_champs` (
  `CHA_CLE` int(11) NOT NULL AUTO_INCREMENT,
  `CHA_NOM` varchar(30) NOT NULL,
  `CHA_REQ` enum('0','1') NOT NULL DEFAULT '0',
  `CHA_UNI` enum('0','1') NOT NULL DEFAULT '0',
  `CHA_MOD` enum('0','1') NOT NULL DEFAULT '0',
  `CHA_FOR` varchar(30) DEFAULT NULL,
  `CHA_POS` int(11) NOT NULL,
  PRIMARY KEY (`CHA_CLE`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1;

DROP TABLE IF EXISTS`tab_murs`;
CREATE TABLE  `tab_murs` (
`MUR_CLE` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`MUR_JOU_CLE` INT UNSIGNED NOT NULL ,
`MUR_MESSAGE` VARCHAR( 200 ) NOT NULL ,
`MUR_DATE` INT UNSIGNED NOT NULL ,
`MUR_SRC` ENUM(  'TNS',  'JOU',  'EQI' ) NOT NULL ,
`MUR_SRC_CLE` INT UNSIGNED NOT NULL ,
INDEX (  `MUR_JOU_CLE` ,  `MUR_SRC_CLE` )
) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;

DROP TABLE IF EXISTS`tab_matchmaking`;
CREATE TABLE  `tab_matchmaking` (
`MAK_CLE` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`MAK_TNS_CLE` INT UNSIGNED NOT NULL ,
`MAK_EQI_CLE` INT UNSIGNED NOT NULL ,
`MAK_START_DATE` DATETIME NOT NULL ,
`MAK_END_DATE` DATETIME NOT NULL ,
`MAK_DESCRIPTION` VARCHAR( 250 ) NOT NULL ,
INDEX (  `MAK_TNS_CLE` ,  `MAK_EQI_CLE` )
) ENGINE = MYISAM ;

# -------------------------------------------------------------
# ---- Remplacez le mail ( admin@mail.com ) par votre email
# -------------------------------------------------------------

INSERT INTO `tab_joueurs` (`JOU_CLE`,`JOU_LOGIN`,`JOU_PASS`,`JOU_MAIL`,`JOU_CODE_CONF`,`JOU_ETAT`,`JOU_SID`,`JOU_IP`,`JOU_PAYS`,`JOU_NUM_MEMBRE`,`JOU_DATE_INS`)
VALUES (1,'admin','e13e47e991c4f9c5fb4387a9d9278278','admin@mail.com','',9,'','','fr','',NOW());


# -------------------------------------------------------------

INSERT INTO `tab_equipes` (`EQI_CLE`, `EQI_NOM`, `EQI_TAG`, `EQI_PASS`, `EQI_PAYS`, `EQI_LOC`, `EQI_URL`, `EQI_CONTACT`, `EQI_LOGO`, `EQI_SLOGAN`, `EQI_JEU`, `EQI_DESC`, `EQI_DATE_INS`, `EQI_ETAT`) 
VALUES (1, 'admin', 'admin', '', 'fr', '', '', '', '', '', '1', NULL, NOW(), '5');

# -------------------------------------------------------------

INSERT INTO  `rel_eqi_jou` (`EQI_CLE` ,`JOU_CLE` ,`JOU_POSTE` ,`JOU_DATE_AJ`)
VALUES ('1',  '1',  '9',  NOW());


ALTER TABLE  `tab_options` ADD  `OPT_DESC` VARCHAR( 255 ) NULL;


CREATE TABLE `zkup_accroches` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `hook_id` int(10) unsigned NOT NULL,
  `module_id` int(10) unsigned NOT NULL,
  `position` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `hook_id` (`hook_id`,`module_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=11 ;

INSERT INTO `zkup_accroches` (`id`, `hook_id`, `module_id`, `position`) VALUES
(1, 4, 1, 3),
(2, 4, 2, 0),
(3, 3, 3, 1),
(4, 4, 4, 1),
(5, 4, 5, 2),
(6, 3, 6, 0),
(7, 3, 7, 2),
(8, 3, 8, 3),
(9, 3, 9, 4),
(10, 1, 10, 0);

CREATE TABLE `zkup_groupes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) CHARACTER SET utf8 NOT NULL,
  `cle` varchar(30) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cle` (`cle`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=5 ;

INSERT INTO `zkup_groupes` (`id`, `nom`, `cle`) VALUES
(1, 'Blocs', 'blocs'),
(2, 'Intégration', 'integration'),
(3, 'Statistiques', 'statistiques'),
(4, 'Navigation', 'navigation');

CREATE TABLE `zkup_hooks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `hook` varchar(30) COLLATE utf8_swedish_ci NOT NULL,
  `nom` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hook` (`hook`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=8 ;

INSERT INTO `zkup_hooks` (`id`, `hook`, `nom`) VALUES
(1, 'header', 'En-tête du site'),
(2, 'footer', 'Pied de page'),
(3, 'sidebar_left', 'Barre latérale gauche'),
(4, 'sidebar_right', 'Barre latérale droite'),
(5, 'before_login', 'Avant authentification'),
(6, 'after_login', 'Après authentification'),
(7, 'before_is_auth', 'Avant vérification des droits d''accès'),
(8, 'init', 'Avant initilisation de chaque page');

CREATE TABLE `zkup_menu_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
  `url` varchar(255) COLLATE utf8_swedish_ci DEFAULT NULL,
  `actif` tinyint(4) NOT NULL DEFAULT '1',
  `position` int(10) unsigned NOT NULL DEFAULT '0',
  `parent_menu` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_menu` (`parent_menu`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=9 ;

INSERT INTO `zkup_menu_items` (`id`, `nom`, `url`, `actif`, `position`, `parent_menu`) VALUES
(1, 'accueil', '/', 1, 0, 0),
(2, 'compétitions', '', 1, 1, 0),
(3, 'tournois', '/tournoi/index', 1, 0, 2),
(4, 'les matchs', '/tournoi/listedesmatchs', 1, 1, 2),
(5, 'historique', '/historique/index', 1, 2, 2),
(6, 'règlements', '/accueil/reglement', 1, 3, 2),
(7, 'équipes', '/equipes/index', 1, 2, 0),
(8, 'partenaires', '/accueil/partenaires', 1, 3, 0);

CREATE TABLE `zkup_modules` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(50) COLLATE utf8_swedish_ci NOT NULL,
  `nom` varchar(255) COLLATE utf8_swedish_ci NOT NULL,
  `groupe_id` int(10) unsigned NOT NULL,
  `actif` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `module` (`module`),
  KEY `groupe_id` (`groupe_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=11 ;

INSERT INTO `zkup_modules` (`id`, `module`, `nom`, `groupe_id`, `actif`) VALUES
(1, 'partenaires', 'Partenaires', 1, 1),
(2, 'blocadminsenligne', 'Bloc admins en ligne', 1, 1),
(3, 'bloccompetitionsencours', 'Bloc Compétitions en cours', 1, 1),
(4, 'tribunelibre', 'Tribune libre', 1, 1),
(5, 'blocstatistiques', 'Bloc statistiques', 1, 1),
(6, 'blocespacemembre', 'Block Espace membre', 1, 1),
(7, 'blocmatchsjoues', 'Bloc Matchs joués', 1, 1),
(8, 'blocchampionnatsencours', 'Bloc Championnats en cours', 1, 1),
(9, 'bloccompetitionscloses', 'Bloc Compétitions closes', 1, 1),
(10, 'menuclassique', 'Menu classique', 4, 1);


INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_max_mess', '10', 0, 'Nombre maximum de message à afficher dans le bloc');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_max_car', '50', 0, 'Nombre maximum de caractères par message');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_max_liens', '2', 0, 'Nombre maximum de liens dans un message');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_delai_flood', '10', 0, 'Délai en secondes entre deux envois de message');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_long_mot', '15', 0, 'Longueur maximum par mot (tronquage au dela)');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'tribunelibre_mot_lien', 'lien', 0, 'Mot servant à remplacer les liens');
INSERT INTO `tab_options` (`OPT_CLE`, `OPT_NOM`, `OPT_VAL`, `OPT_AUTO`, `OPT_DESC`) VALUES(null, 'blocadminsenligne_max_admin', '10', 0, 'Nombre maximum d''admins à afficher');
