WUI-CARIA1.1.0
Edit files for UserInterface - Signin, Profil change - Add fonctionnality Picture Resize
This commit is contained in:
@@ -12,4 +12,19 @@ function get_LastMember()
|
||||
$req = $bdd->query('SELECT pseudo, idclient FROM Client ORDER BY idclient DESC LIMIT 0, 1');
|
||||
$data = $req->fetch();
|
||||
return $data;
|
||||
}
|
||||
function get_allMember()
|
||||
{
|
||||
//NOT USE actually
|
||||
global $bdd;
|
||||
//Cette requête permet d'obtenir tout sur le forum
|
||||
$req = $bdd->prepare('SELECT cat_id, cat_nom,forum_forum.forum_id, forum_name, forum_desc, forum_post, forum_topic, auth_view,
|
||||
forum_topic.topic_id, forum_topic.topic_post, post_id, post_time, post_createur, membre_pseudo, membre_id FROM forum_categorie
|
||||
LEFT JOIN forum_forum ON forum_categorie.cat_id = forum_forum.forum_cat_id
|
||||
LEFT JOIN forum_post ON forum_post.post_id = forum_forum.forum_last_post_id
|
||||
LEFT JOIN forum_topic ON forum_topic.topic_id = forum_post.topic_id
|
||||
LEFT JOIN forum_membres ON forum_membres.membre_id = forum_post.post_createur
|
||||
WHERE auth_view <= :lvl ORDER BY cat_ordre, forum_ordre DESC');
|
||||
$req->bindValue(':lvl',$lvl,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
}
|
||||
@@ -27,14 +27,26 @@ function post_Registre()
|
||||
$pseudo=$_POST['pseudo'];
|
||||
$pass = /*md5*/($_POST['password']);
|
||||
$email = $_POST['email'];
|
||||
$nomavatar=(!empty($_FILES['avatar']['size']))?move_avatar($_FILES['avatar']):'';
|
||||
mkdir("./images/avatars/".$pseudo."/", 0700);
|
||||
$nomavatar=(!empty($_FILES['avatar']['size']))?edit_avatar($_FILES['avatar'], $pseudo):'';
|
||||
$localisation = $_POST['localisation'];
|
||||
$req = $bdd->prepare('INSERT INTO Client (pseudo, mdp, adressemail, imageclient, adresse, dateenregistre)
|
||||
VALUES (:pseudo, :pass, :email, :nomavatar, :localisation, NOW())');
|
||||
$prenom = $_POST['prenom'];
|
||||
$nom = $_POST['nom'];
|
||||
$sexe = $_POST['sexe'];
|
||||
$age = $_POST['age'];
|
||||
$permis = $_POST['permis'];
|
||||
$req = $bdd->prepare('INSERT INTO Client (pseudo, mdp, adressemail, imageclient, adresse, prenom, nom, sexe, age, permis, dateenregistre)
|
||||
VALUES (:pseudo, :pass, :email, :nomavatar, :localisation, :prenom, :nom, :sexe, :age, :permis, NOW())');
|
||||
$req->bindValue(':pseudo', $pseudo, PDO::PARAM_STR);
|
||||
$req->bindValue(':pass', $pass, PDO::PARAM_INT);
|
||||
$req->bindValue(':pass', $pass, PDO::PARAM_STR);
|
||||
$req->bindValue(':email', $email, PDO::PARAM_STR);
|
||||
$req->bindValue(':nomavatar', $nomavatar, PDO::PARAM_STR);
|
||||
$req->bindValue(':localisation', $localisation, PDO::PARAM_STR);
|
||||
$req->bindValue(':prenom', $prenom, PDO::PARAM_STR);
|
||||
$req->bindValue(':nom', $nom, PDO::PARAM_STR);
|
||||
$req->bindValue(':sexe', $sexe, PDO::PARAM_STR);
|
||||
$req->bindValue(':age', $age, PDO::PARAM_INT);
|
||||
$req->bindValue(':permis', $permis, PDO::PARAM_INT);
|
||||
|
||||
$req->execute();
|
||||
}
|
||||
@@ -4,7 +4,7 @@ function get_MemberInfo()
|
||||
global $bdd;
|
||||
$membre = isset($_GET['m'])?(int) $_GET['m']:'';
|
||||
//On récupère les infos du membre
|
||||
$req = $bdd->prepare('SELECT pseudo, imageclient, adressemail, dateenregistre, adresse FROM Client WHERE idclient=:membre');
|
||||
$req = $bdd->prepare('SELECT pseudo, imageclient, adressemail, dateenregistre, adresse, prenom, nom, age, permis FROM Client WHERE idclient=:membre');
|
||||
$req->bindValue(':membre',$membre, PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
$data = $req->fetch();
|
||||
@@ -14,8 +14,9 @@ function get_MemberInfoId()
|
||||
{
|
||||
global $bdd;
|
||||
$id=(isset($_SESSION['idclient']))?(int) $_SESSION['idclient']:0;
|
||||
|
||||
//On prend les infos du membre
|
||||
$req = $bdd->prepare('SELECT pseudo, adressemail,adresse,imageclient FROM Client WHERE idclient=:id');
|
||||
$req = $bdd->prepare('SELECT pseudo, imageclient, adressemail, adresse, prenom, nom, age, permis FROM Client WHERE idclient=:id');
|
||||
$req->bindValue(':id',$id,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
$data = $req->fetch();
|
||||
@@ -32,6 +33,17 @@ function get_checkMail()
|
||||
$data = $req->fetch();
|
||||
return $data;
|
||||
}
|
||||
function get_Pseudo()
|
||||
{
|
||||
global $bdd;
|
||||
$id=(isset($_SESSION['idclient']))?(int) $_SESSION['idclient']:0;
|
||||
//On commence donc par récupérer le pseudo
|
||||
$req = $bdd->prepare('SELECT pseudo FROM Client WHERE idclient =:id');
|
||||
$req->bindValue(':id',$id,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
$data = $req->fetch();
|
||||
return $data;
|
||||
}
|
||||
function get_checkCopyMail()
|
||||
{
|
||||
global $bdd;
|
||||
@@ -44,12 +56,12 @@ function get_checkCopyMail()
|
||||
$req->CloseCursor();
|
||||
return $mail_free;
|
||||
}
|
||||
function post_UpdateAvatar()
|
||||
function post_UpdateAvatar($pseudo)
|
||||
{
|
||||
global $bdd;
|
||||
$id=(isset($_SESSION['idclient']))?(int) $_SESSION['idclient']:0;
|
||||
$nomavatar=move_avatar($_FILES['avatar']);
|
||||
$req = $bdd->prepare('UPDATE Client SET imageclient = '/images/avatars/' :avatar WHERE idclient = :id');
|
||||
$nomavatar=edit_avatar($_FILES['avatar'], $pseudo );
|
||||
$req = $bdd->prepare('UPDATE Client SET imageclient = :avatar WHERE idclient = :id');
|
||||
$req->bindValue(':avatar',$nomavatar,PDO::PARAM_STR);
|
||||
$req->bindValue(':id',$id,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
@@ -72,7 +84,7 @@ function post_UpdateMember()
|
||||
$email = $_POST['email'];
|
||||
$localisation = $_POST['localisation'];
|
||||
$req = $bdd->prepare('UPDATE Client SET mdp = :mdp, adressemail=:mail, adresse=:loc WHERE idclient=:id');
|
||||
$req->bindValue(':mdp',$pass,PDO::PARAM_INT);
|
||||
$req->bindValue(':mdp',$pass,PDO::PARAM_STR);
|
||||
$req->bindValue(':mail',$email,PDO::PARAM_STR);
|
||||
$req->bindValue(':loc',$localisation,PDO::PARAM_STR);
|
||||
$req->bindValue(':id',$id,PDO::PARAM_INT);
|
||||
|
||||
Reference in New Issue
Block a user