X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=1b05e67eaf5a99b512e39c62c832b93742a3aa87;hb=2c385cd54dcef7d75e0b59b9212a209f086cb74a;hp=4bab494192afa8fceb929cda198e51c94f6603cc;hpb=179afa7fa79902e11498314d37fe4dbf452b3617;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 4bab494..1b05e67 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -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);