2017-12-20 20:49:11 +00:00
<!DOCTYPE html>
< html lang = "fr" >
<? include('blocks/d.head.html'); ?>
< body >
<? include('blocks/d.nav.html'); ?>
< section id = "profile" >
2018-10-18 21:04:13 +00:00
<? if ($userProfile->id != 0) { ?>
2017-12-20 20:49:11 +00:00
< h1 > <?=$userProfile->name?> < / h1 >
< article >
<? if(isset($nameError) AND $nameError==1) { ?>
< p style = "color: #660000;" > Veuillez choisir un autre nom d'utilisateur.< / p >
<? } ?>
2018-10-18 19:16:18 +00:00
<? if(isset($emailError) AND $emailError==1) { ?>
< p style = "color: #660000;" > Veuillez choisir un autre email.< / p >
2017-12-20 20:49:11 +00:00
<? } ?>
<? if(isset($updated) AND $updated==1) { ?>
< p style = "color: #006600;" > Le profil a été mis à jour.< / p >
<? } ?>
2018-10-18 21:04:13 +00:00
< form action = "<?=$config['rel_root_folder']?>user/p/<?=$userProfile->id?>/edit" method = "post" class = "edituser" enctype = "multipart/form-data" >
< aside class = "<?=$userProfile->is_avatar_present=='t'?'':'no'?>avatar" >
2017-12-20 20:49:11 +00:00
< div id = "picturebuttonscontainer" >
< div id = "picturebuttons" >
2018-10-18 21:04:13 +00:00
< a href = "#" id = "uploadavatar" > < i class = "fas fa-camera" > < / i > < / a > < a < ? = $ userProfile- > is_avatar_present=='t'?'':'style="display: none;"'?> href="#" id="deleteavatar" style="font-size: 1.1em;">< i class = "fas fa-trash" > < / i > < / a >
2017-12-20 20:49:11 +00:00
< / div >
< / div >
2018-10-18 21:04:13 +00:00
< img alt = "Avatar" id = "profileavatar" src = "<?=$config['rel_root_folder']?>medias/avatars/<?=$userProfile->id?>_p.jpg" alt = "Profile picture" >
2018-10-18 19:16:18 +00:00
< i id = "profilenoavatar" class = "fas fa-user-secret" > < / i >
2017-12-20 20:49:11 +00:00
< / aside >
2018-10-18 21:04:13 +00:00
< input id = "avatarcheckbox" style = "display: none;" type = "checkbox" name = "avatar" < ? = $ userProfile- > is_avatar_present=='t'?'checked':''?>>
2017-12-20 20:49:11 +00:00
< input type = "hidden" name = "MAX_FILE_SIZE" value = "4194304" / >
< input id = "avatarfile" name = "avatarfile" style = "display: none;" type = "file" accept = "image/*" / >
2018-10-18 19:16:18 +00:00
< div id = "description" >
< ul >
< li > < label for = "name" > Nom d'utilisateur :< / label > < input name = "name" id = "name" type = "text" value = "<?=$userProfile->name?>" placeholder = "Charlie" > < / li >
< li > < label for = "email" > Adresse mail :< / label > < input name = "email" id = "email" type = "text" value = "<?=$userProfile->email?>" placeholder = "charlie@mountain.org" > < / li >
< li > < label for = "password" > Mot de passe :< / label > < input name = "password" id = "password" type = "password" placeholder = "Nouveau mot de passe" > < / li >
< li > < label for = "locale" > Langue :< / label >
< select name = "locale" id = "locale" >
2018-10-18 20:18:33 +00:00
<? foreach($locales->objs as $locale) { ?>
2018-10-22 21:09:20 +00:00
< option < ? = $ userProfile- > get_locale()==$locale->display_name?'selected':''?> value="<?=$locale->name?> "><?=$locale->display_name?> < / option >
2018-10-18 19:16:18 +00:00
<? } ?>
< / select > < / li >
<? if($user->rankIsHigher("administrator")) { ?>
< li > < label for = "rank" > Rang : < / label >
< select name = "rank" id = "rank" >
<? foreach($ranks as $rank) { ?>
2018-10-18 21:04:13 +00:00
< option < ? = $ userProfile- > rank==$rank[3]?'selected':''?> value="<?=$rank[3]?> "><?=$rank[1]?> < / option >
2018-10-18 19:16:18 +00:00
<? } ?>
< / select > < / li >
<? } ?>
< li > < label for = "website" > Site internet :< / label > < input name = "website" id = "website" type = "text" value = "<?=$userProfile->website?>" placeholder = "mountain.org" > < / li >
2017-12-20 20:49:11 +00:00
2018-10-18 19:16:18 +00:00
< input name = "submit" id = "submit" type = "submit" value = "Envoyer" >
< / ul >
< / div >
< div style = "clear:both;" > < / div >
2017-12-20 20:49:11 +00:00
< / form >
< / article >
<? } else { ?>
< p style = "color:red;" > Le profil demandé n'existe pas.< / p >
<? } ?>
< / section >
<? include('blocks/d.footer.html'); ?>
< / body >
< / html >