X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=10bfc8293c6df9124296d1721ab0f7069bf7e178;hb=9fcc656556e911e89ecb0d9712785a19a7025da9;hp=4bab494192afa8fceb929cda198e51c94f6603cc;hpb=756ff73fbb0cdd01cce2eda27ba18e1cc99bd735;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 4bab494..10bfc82 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -153,7 +153,7 @@ abstract class Validate // }}} // {{{ function handle_formu() - /** fonction à réaliser en cas de valistion du formulaire + /** fonction à réaliser en cas de validation du formulaire */ public function handle_formu() { @@ -313,6 +313,17 @@ abstract class Validate } // }}} + // {{{ function get_typed_requests_count() + + /** same as get_typed_requests() but return the count of available requests. + */ + static public function get_typed_requests_count($uid, $type) + { + $res = XDB::query('SELECT COUNT(data) FROM requests WHERE user_id={?} and type={?}', $uid, $type); + return $res->fetchOneCell(); + } + + // }}} // {{{ function _mail_body abstract protected function _mail_body($isok);