From: gburri Date: Sun, 28 Sep 2008 19:58:09 +0000 (+0000) Subject: ADD informations concernant les jours pendant lesquels les participants sont présent... X-Git-Tag: cl7~21 X-Git-Url: http://git.euphorik.ch/?p=cl7.git;a=commitdiff_plain;h=262be7e249593a2764a7c452f70dc5ac68887d5c ADD informations concernant les jours pendant lesquels les participants sont présent (pas fini) git-svn-id: svn://localhost/cl7/trunk@2 4c3d3983-c6fa-4c6c-9935-18c3bbef1bf0 --- diff --git a/index.php b/index.php index 8d6c578..9e1c878 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ diff --git a/tx_inscription.php b/tx_inscription.php index 22847f4..742e153 100644 --- a/tx_inscription.php +++ b/tx_inscription.php @@ -93,6 +93,25 @@ else valide?('value="'.$le_participant->info->e_mail.'"'):''); ?> /> + + + présence + + + valide ? $le_participant->info->id : "0")." + "); + while($periode = mysql_fetch_object($res)) + { + echo '

valide || $periode->participant_id ? 'checked="checked"' : '').' id="periode'.$periode->id.'" type="checkbox" />

'; + } + ?> + + remarques diff --git a/tx_jeux_joues.php b/tx_jeux_joues.php index 8908949..304c34b 100644 --- a/tx_jeux_joues.php +++ b/tx_jeux_joues.php @@ -23,7 +23,7 @@ $jeux_query = mysql_query(" while ($jeu = mysql_fetch_object($jeux_query)) { - // est-ce que le participant courant à voté pour ce jeu ? + # est-ce que le participant courant à voté pour ce jeu ? if ($le_participant->valide) { $a_vote = mysql_fetch_row(mysql_query(" @@ -50,7 +50,7 @@ if ($le_participant->valide) echo ''; -// affichage du nombre de vote restant +# affichage du nombre de vote restant if ($le_participant->valide) echo '

Nombre de votes restant : ' . $le_participant->nb_vote_restant() . '

'; diff --git a/update_db.php b/update_db.php index 3cce184..5ff5904 100644 --- a/update_db.php +++ b/update_db.php @@ -55,8 +55,8 @@ function creer_db() "); mysql_query(" CREATE TABLE IF NOT EXISTS jeux_choisis ( - participant_id mediumint(3) unsigned NOT NULL default '0', - jeu_id mediumint(3) unsigned NOT NULL default '0', + participant_id mediumint(3) unsigned NOT NULL, + jeu_id mediumint(3) unsigned NOT NULL, PRIMARY KEY USING BTREE (participant_id,jeu_id), KEY FK_jeu (jeu_id), CONSTRAINT FK_participant FOREIGN KEY (participant_id) REFERENCES participants (id) ON DELETE CASCADE ON UPDATE CASCADE, @@ -74,7 +74,7 @@ function update_db() { # si la table 'config' n'existe pas alors on suppose qu'aucune table n'existe $version = 0; - if(!$version = @mysql_fetch_object(mysql_query("SELECT valeur FROM config WHERE nom = 'version'"))) + if(!$version = (int)@mysql_fetch_object(mysql_query("SELECT valeur FROM config WHERE nom = 'version'"))) { mysql_query("BEGIN TRANSACTION"); creer_db(); @@ -82,6 +82,34 @@ function update_db() mysql_query("COMMIT"); $version = 1; } + + # version 1 -> 2 + if ($version == 1) + { + mysql_query("BEGIN TRANSACTION"); + mysql_query(" + CREATE TABLE IF NOT EXISTS periodes ( + id mediumint(3) unsigned NOT NULL auto_increment, + nom varchar(200) NOT NULL, + PRIMARY KEY (id) + ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; + "); + mysql_query("INSERT INTO periodes (nom) VALUES ('Vendredi soir à samedi')"); + mysql_query("INSERT INTO periodes (nom) VALUES ('Samedi à dimanche')"); + mysql_query("INSERT INTO periodes (nom) VALUES ('Dimanche à lundi')"); + mysql_query(" + CREATE TABLE IF NOT EXISTS participations ( + participant_id mediumint(3) unsigned NOT NULL, + periode_id mediumint(3) unsigned NOT NULL, + PRIMARY KEY USING BTREE (participant_id, periode_id), + KEY FK_periode (periode_id), + CONSTRAINT FK_participant_participations FOREIGN KEY (participant_id) REFERENCES participants (id) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT FK_periode_participations FOREIGN KEY (periode_id) REFERENCES periodes (id) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + "); + mysql_query("UPDATE config SET valeur = '2' WHERE nom = 'version')"); + mysql_query("COMMIT"); + } } update_db();