X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=1b05e67eaf5a99b512e39c62c832b93742a3aa87;hb=730a173a333507926e0029d8a96c3a26b55756e4;hp=4bab494192afa8fceb929cda198e51c94f6603cc;hpb=a7c29df3b9bf8f3c3b23fec0f1d2feb814cb61fe;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);