Document expires field

This commit is contained in:
nikolark committed 2014-05-12 15:30:32 +02:00
1 parent b561dc0531
commit 5499086ea0
1 file changed
+6
+6
View File
@@ -11,6 +11,12 @@ function set_response_code($code) {
function get_user($user_id) {
global $conn;
/* Note: Field 'expires' can have the following meanings:
* - 0000-00-00 (default): No membership (never has)
* - a date < NOW(): Expired membership
* - a date >= NOW(): Valid membership
* - NULL: Lifelong membership
*/
$cols = array('id', 'firstname', 'lastname', 'email', 'expires', 'cardno');
$sql = "SELECT ".implode($cols, ",").",GROUP_CONCAT(group_id) AS group_ids,expires > NOW() OR expires IS NULL AS is_member FROM din_user AS u, din_usergrouprelationship AS ug WHERE u.id=$user_id AND u.id=ug.user_id GROUP BY user_id";
$res = $conn->query($sql);