Petit probleme de decompte : si n personnes en tout viennent (donc moi compris),...
[platal.git] / include / validations.inc.php
index 95d57c0..b00fef3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -285,6 +285,21 @@ class Validate
     }
 
     // }}}
+    // {{{ function get_typed_requests()
+
+    /** same as get_typed_request() but return an array of objects
+     */
+    static function get_typed_requests($uid, $type)
+    {
+        $res = XDB::iterRow('SELECT data FROM requests WHERE user_id={?} and type={?}', $uid, $type);
+        $array = array();
+        while (list($data) = $res->next()) {
+            $array[] = unserialize($data);
+        }
+        return $array;
+    }
+
+    // }}}
     // {{{ function _mail_body
 
     function _mail_body($isok)