-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtraitementProfil.php
More file actions
88 lines (70 loc) · 3.9 KB
/
traitementProfil.php
File metadata and controls
88 lines (70 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
session_start();
include('BDD.php');
include('start.php');
$idSession = $_SESSION['ID'];
if (isset($_SESSION['SWITCH']) AND $_SESSION['SWITCH'] == "participant" AND $_SESSION['ID'] != null) {
$result = $bdd->query('SELECT avatar FROM participant WHERE participant.ID = "' . $idSession . '"');
while($data = $result->fetch()){
$avatarGet = $data['avatar'];
}$result->closeCursor();
$avatarDET = pathinfo($_FILES['avatar']['name']);
$avatarExt = $avatarDET['extension'];
if ($avatarExt == NULL) {
$chemin = $avatarGet;
} else {
move_uploaded_file($_FILES['avatar']['tmp_name'], 'img/test321' . $avatarExt);
$chemin = 'img/test321' . $avatarExt;
}
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$pseudo = $_POST['pseudo'];
$pays = $_POST['pays'];
$adresse = $_POST['adresse'];
$telMobile = $_POST['numeroPortable'];
$codePostal = $_POST['pcode'];
$ville = $_POST['villes'];
$profession = $_POST['profession'];
$loisir = $_POST['loisirs'];
$lieuNaissance = $_POST['lieuDeNaissance'];
$description = $_POST['description'];
$telFixe = $_POST['telephoneFixe'];
$dateDeNaissance = $_POST['date'];
$siteWeb = $_POST['siteWeb'];
$mail = $_POST['email'];
$sexe = $_POST['genre'];
$bdd->query('UPDATE participant SET nom = "' . $nom . '", prenom = "' . $prenom . '", pseudo = "' . $pseudo . '", lieuNaissance = "' . $lieuNaissance . '", pays = "' . $pays . '", villes = "' . $ville . '", adresse = "' . $adresse . '", codePostal = "' . $codePostal . '", description = "' . $description . '", sexe = "' . $sexe . '", telephoneFixe = "' . $telFixe . '", telephoneMobile = "' . $telMobile . '", dateDeNaissance = "' . $dateDeNaissance . '", mail = "' . $mail . '", siteWeb = "' . $siteWeb . '", avatar = "' . $chemin . '", profession = "' . $profession . '", loisirs = "' . $loisir . '" WHERE ID = "' . $idSession . '"');
header('Location:profil.php?target=info#description');
} else if (isset($_SESSION['SWITCH']) AND $_SESSION['SWITCH'] == "organisateur" AND $_SESSION['ID'] != null) {
$result = $bdd->query('SELECT logo FROM organisateur WHERE organisateur.ID = "' . $idSession . '"');
while($data = $result->fetch()){
$logoGet = $data['logo'];
}$result->closeCursor();
$logoDET = pathinfo($_FILES['logo']['name']);
$logoExt = $logoDET['extension'];
if ($logoExt == NULL) {
$chemin = $logoGet;
} else {
move_uploaded_file($_FILES['logo']['tmp_name'], 'img/test321' . $logoExt);
$chemin = 'img/test321' . $logoExt;
}
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$pseudo = $_POST['pseudo'];
$nomSociete = $_POST['nomSociete'];
$pays = $_POST['pays'];
$sexe = $_POST['genre'];
$telSociete = $_POST['telephoneSociete'];
$siteWeb = $_POST['siteWeb'];
$dateDeNaissance = $_POST['date'];
$mail = $_POST['email'];
$profession = $_POST['profession'];
$adresse = $_POST['adresse'];
$codePostal = $_POST['pcode'];
$ville = $_POST['ville'];
$telMobile = $_POST['telephoneMobile'];
$activite = $_POST['activite'];
$bdd->query('UPDATE organisateur SET nom = "' . $nom . '", prenom = "' . $prenom . '", pseudo = "' . $pseudo . '", nomSociete = "' . $nomSociete . '", pays = "' . $pays . '", ville = "' . $ville . '", adresseSociete = "' . $adresse . '", codePostalSociete = "' . $codePostal . '", sexe = "' . $sexe . '", telephoneSociete = "' . $telSociete . '", telephoneMobile = "' . $telMobile . '", dateDeNaissance = "' . $dateDeNaissance . '", mail = "' . $mail . '", siteWeb = "' . $siteWeb . '", logo = "' . $chemin . '", profession = "' . $profession . '", activite = "' . $activite . '" WHERE ID = "' . $idSession . '"');
header('Location:profil.php?target=info#description');
}
?>