activate modal on events app card, add class for user
This commit is contained in:
@@ -214,11 +214,11 @@ class AppCard{
|
||||
return
|
||||
"<div style=\"padding:1%;\" class=\"col s12 m6 ".$extraClass."\">".
|
||||
"<div style=\"margin:1%;\" class=\"card blue-grey darken-1\">".
|
||||
(($this->link!=null)?("<a href=\"".$this->link."\">"):(""))."<div class=\"card-content white-text\">".
|
||||
"<span class=\"card-title\">".$this->title."</span>".
|
||||
"<div class=\"card-content white-text\">".
|
||||
(($this->link!=null)?("<a href=\"".$this->link."\">"):(""))."<span class=\"card-title\">".$this->title."</span>".(($this->link!=null)?("</a>"):("")).
|
||||
(($this->imgUrl!=null)?("<img alt=\"".$this->title."\" style=\"display:block;margin-left:auto;margin-right:auto;max-height:10vh;\" class=\"responsive-img\" src=\"".$this->imgUrl."\" />"):("")).
|
||||
"<p>".$this->description."</p>".
|
||||
"</div>".(($this->link!=null)?("</a>"):("")).
|
||||
"</div>".
|
||||
"<div class=\"card-action\">".$actionListCode."</div>".
|
||||
"</div>".
|
||||
"</div>";
|
||||
@@ -474,4 +474,70 @@ class dbConnector{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* User for the Participo system
|
||||
*/
|
||||
class user{
|
||||
private $id;
|
||||
private $loginName;
|
||||
private $name;
|
||||
private $firstName;
|
||||
private $dateOfBirth;
|
||||
private $eMail;
|
||||
|
||||
public function __construct($id, $loginName, $name, $firstName, $dateOfBirth, $eMail)
|
||||
{
|
||||
$this->id = (int) id;
|
||||
$this->loginName = $loginName;
|
||||
$this->name = $name;
|
||||
$this->firstName = $firstName;
|
||||
$this->dateOfBirth = $dateOfBirth!=null?DateTime::createFromFormat('Y-m-d', $dateOfBirth):null;
|
||||
$this->eMail = $eMail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a User from an assoziative array
|
||||
*
|
||||
* @param array $member associative array with the UserData from the dbRequest
|
||||
* @return User initialized user
|
||||
*/
|
||||
public static function fromArray($member){
|
||||
return new User(
|
||||
$member['id']??null,
|
||||
$member['loginName']??null,
|
||||
$member['name']??null,
|
||||
$member['vorname']??null,
|
||||
$member['gebDatum']??null,
|
||||
array_key_exist('eMail', $member)?explode(',', $member['eMail']):null
|
||||
);
|
||||
}
|
||||
|
||||
/// Setzen aller Attribute
|
||||
/// @todo Inputvalidation
|
||||
function set($userData){
|
||||
$this->id = $userData["id"];
|
||||
$this->loginName = $userData["loginName"];
|
||||
$this->name = $userData["name"];
|
||||
$this->vorname = $userData["vorname"];
|
||||
$this->gebDatum = $userData["gebDatum"];
|
||||
$this->eMail = $userData["eMail"];
|
||||
return;
|
||||
}
|
||||
function toAssoc(){
|
||||
return array(
|
||||
"id" => $this->id,
|
||||
"loginName"=> $this->loginName,
|
||||
"name" => $this->name,
|
||||
"vorname" => $this->vorname,
|
||||
"gebDatum" => $this->gebDatum,
|
||||
"eMail" => $this->eMail);
|
||||
}
|
||||
function loadFromDb($dbConn, $id){
|
||||
$this->set(
|
||||
loadUserDataFromDb($dbConn, $id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user