X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=php%2Fclass_participant.php;h=a4024028b260457bacb527b7ad2351087eef7b97;hb=eb13d74a54796fabaa4034eeb2e803f41c7424ab;hp=d5f9c71a013911be918de8556dfcf8cdaa9991a0;hpb=27f3004da65f2b5803709b3fa76a791c9b38a0c9;p=cl7.git diff --git a/php/class_participant.php b/php/class_participant.php index d5f9c71..a402402 100644 --- a/php/class_participant.php +++ b/php/class_participant.php @@ -27,7 +27,7 @@ class Participant else # Sinon c'est l'id $res = mysql_query("SELECT * FROM participants WHERE id = " . addslashes($v1)); - if (mysql_num_rows($res) == 0) + if (mysql_error() || mysql_num_rows($res) == 0) { $this->valide = FALSE; } @@ -57,11 +57,11 @@ class Participant */ static function nombre_participant_max_atteint() { - global $NB_MAX_PARTICIPANT; + global $config; $res_SQL = mysql_query("SELECT COUNT(*) FROM participants"); $nb_participant = mysql_fetch_row($res_SQL); - return $nb_participant[0] >= $NB_MAX_PARTICIPANT; + return $nb_participant[0] >= $config->get('nb_max_participant'); } /** @@ -69,11 +69,11 @@ class Participant */ static function nombre_place_restante() { - global $NB_MAX_PARTICIPANT; + global $config; $res_SQL = mysql_query("SELECT COUNT(*) FROM participants"); $nb_participant = mysql_fetch_row($res_SQL); - return $NB_MAX_PARTICIPANT - $nb_participant[0]; + return $config->get('nb_max_participant') - $nb_participant[0]; } }