ADD informations concernant les jours pendant lesquels les participants sont présent...
[cl7.git] / php / class_participant.php
index d5f9c71..a402402 100644 (file)
@@ -27,7 +27,7 @@ class Participant
                else # Sinon c'est l'id
                        $res = mysql_query("SELECT * FROM participants WHERE id = " . addslashes($v1));\r
       
-               if (mysql_num_rows($res) == 0)\r
+               if (mysql_error() || mysql_num_rows($res) == 0)\r
       {\r
          $this->valide = FALSE;\r
       }\r
@@ -57,11 +57,11 @@ class Participant
      */\r
    static function nombre_participant_max_atteint()\r
    {\r
-      global $NB_MAX_PARTICIPANT;\r
+      global $config;\r
       $res_SQL = mysql_query("SELECT COUNT(*) FROM participants");\r
       $nb_participant = mysql_fetch_row($res_SQL);\r
 \r
-      return $nb_participant[0] >= $NB_MAX_PARTICIPANT;\r
+      return $nb_participant[0] >= $config->get('nb_max_participant');\r
    }\r
    \r
    /**\r
@@ -69,11 +69,11 @@ class Participant
      */\r
    static function nombre_place_restante()\r
    {\r
-      global $NB_MAX_PARTICIPANT;\r
+      global $config;\r
       $res_SQL = mysql_query("SELECT COUNT(*) FROM participants");\r
       $nb_participant = mysql_fetch_row($res_SQL);\r
       \r
-      return $NB_MAX_PARTICIPANT - $nb_participant[0];\r
+      return $config->get('nb_max_participant') - $nb_participant[0];\r
    }
 }