make add/remove starter buttons date sensitive

This commit is contained in:
marko
2023-01-29 19:55:33 +01:00
parent 4ff0659f90
commit ece0ef5025
9 changed files with 492 additions and 196 deletions

View File

@@ -23,6 +23,15 @@ class participo
return (isset($_SESSION) && array_key_exists('login', $_SESSION) && $_SESSION['login'] == true);
}
public static function getSessionUserId()
{
$userId = null;
if (isset($_SESSION) && array_key_exists('user', $_SESSION) && array_key_exists('userId', $_SESSION['user'])) {
$userId = $_SESSION['user']['userId'];
}
return $userId;
}
/** Remove all login data from the session data
*
* @return void
@@ -541,3 +550,17 @@ function getHtmlSquareDate($date = null)
. '<div style="font-size: small">' . $year . '</div>'
. '</div>';
}
/**
* filter_var for a (db)id
*
* check for valid id; null is default; only values > 0 are excepted
*
* @param [type] $id
* @retval int>0 filtered id
* @retval null sth. went wrong
*/
function filterId($id)
{
return filter_var($id, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 1]]);
}