66 lines
2.4 KiB
PHP
66 lines
2.4 KiB
PHP
<?php
|
|
// ****************************************'
|
|
// Le CASTEL-BTS SIO/ PROJET GSB '
|
|
// Programme: c_utilisateur.php '
|
|
// Objet : gestion des utilisateurs '
|
|
// Client : Bts SIO1 '
|
|
// Version : 22.03 '
|
|
// Date : 24 mars 2022 '
|
|
// Auteur : LG '
|
|
//*****************************************'
|
|
|
|
$action = $_REQUEST['action'];
|
|
|
|
if (!isset($_REQUEST['zNom'])) {$nom = '*';} else {$nom =$_REQUEST['zNom'];}
|
|
if (!isset($_REQUEST['zPrenom'])) {$prenom = '*';} else {$prenom =($_REQUEST['zPrenom']);}
|
|
if (!isset($_REQUEST['zAdresse'])) {$adresse = '*';} else {$adresse =$_REQUEST['zAdresse'];}
|
|
if (!isset($_REQUEST['zCP'])) {$codePostal = 0;} else {$codePostal =intval($_REQUEST['zCP']);}
|
|
if (!isset($_REQUEST['zVille'])) {$ville = '*';} else {$ville =$_REQUEST['zVille'];}
|
|
if (!isset($_REQUEST['zLogin'])) {$login = '*';} else {$login =$_REQUEST['zLogin'];}
|
|
if (!isset($_REQUEST['zMDP'])) {$mdp = '*';} else {$mdp =$_REQUEST['zMDP'];}
|
|
if (!isset($_REQUEST['lstRegion'])) {$region = 'premier';} else {$region =$_REQUEST['lstRegion'];}
|
|
if (!isset($_REQUEST['lstStatut'])) {$statut = 'premier';} else {$statut =$_REQUEST['lstStatut'];}
|
|
if (!isset($_REQUEST['lstLabo'])) {$labo = 'premier';} else {$labo =$_REQUEST['lstLabo'];}
|
|
if (!isset($_POST['rdbMDP'])) {$rdbmdp = '*';} else {$rdbmdp =$_POST['rdbMDP'];}
|
|
|
|
|
|
|
|
switch($action) {
|
|
case 'voir':
|
|
{
|
|
include("vues/v_entete.php");
|
|
$lesInfosProfil = $pdo->getInfosUtilisateur("*",$_SESSION['idUtilisateur']);
|
|
include("vues/v_ficheProfil.php");
|
|
break;
|
|
}
|
|
|
|
//----------------------------------------- /MODIFICATION/
|
|
|
|
case 'modifier':
|
|
|
|
{
|
|
include("vues/v_entete.php");
|
|
$lesInfosProfil = $pdo->getInfosUtilisateur("*",$_SESSION['idUtilisateur']);
|
|
$infoStatut = $pdo->getParametre('statUti');
|
|
$infoRegion = $pdo->getParametre('region');
|
|
$infoLabo = $pdo->getInfoLabo();
|
|
include("vues/v_modifProfil.php");
|
|
break;
|
|
}
|
|
|
|
//----------------------------------------- VALIDATION MODIFICATION
|
|
case 'validerModifier':
|
|
{
|
|
if ($_REQUEST['zOk']=="OK") {$pdo->majProfil($_SESSION['idUtilisateur'], $nom, $prenom, $adresse, $codePostal, $ville, $login, $mdp, $rdbmdp);}
|
|
//header ('location: index.php?choixTraitement=utilisateur&action=voir');
|
|
break;
|
|
}
|
|
|
|
|
|
default :
|
|
{
|
|
echo 'erreur d\'aiguillage !'.$action;
|
|
break;
|
|
}
|
|
}
|
|
?>
|