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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="fr" />
<title>Application de Gestion de stage GSB</title>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
<script type='text/javascript' src='Scripts/jquery-1.3.2.min.js'></script>
<!-- Tooltip -->
<script type="text/javascript" src="Scripts/jquery.tipsy.js"></script>
<!-- fade in/fade out -->
<script type="text/javascript" src="Scripts/jquery.innerfade.js"></script>
<!-- Featured list -->
<script type="text/javascript" src="Scripts/jquery.featureList-1.0.0.js"></script>
<script src="js/fonctions.js" type="text/javascript"></script>
</head>
<?php
// ajout du script de la connexion à la bdd
include("includes/accesBDD.php");
// fonctions de contrôle
include("includes/utilitaires.php");
?>
<body>
<div id="wrapper">
<?php
include("includes/menu.php");
?>
<div id="preview_wrap">
<div id="preview_outer">
<div id="preview_inner">
<div>
<?php
if(count($_POST)==0)
{
$ident = "";
$motDePasse = "";
$prenom = "";
$nom = "";
$statut = "";
}
?>
<?php
if(count($_POST)>0)
{
supEspaceDebutFin($_POST);
extract($_POST);
$mdpCrypte = sha1($ident.$motDePasse);
// création du tableau qui va contenir les erreurs trouvées
$tableauErreurs = array();
// appel de ma méthode verifierDemande qui va vérifier les données saisies. les erreurs seton placées dans tableauErreurs
$retVerif = verifierConnexion($ident, $motDePasse, $tableauErreurs);
if (nbErreurs($tableauErreurs)>0)
{
$lstErr = chaineErreurs($tableauErreurs);
echo ("<script>alert('$lstErr ')</script>");
}
else
{
$requete = "SELECT ident, motPasse FROM personnel WHERE ident = '$ident' AND motPasse = '$mdpCrypte'";
$result = $db -> query($requete);
if($result!=false)
{
$ligne=$result->fetch_object();
if($ligne == false)
{
echo ("<script>alert('Identifiant et / ou mot de passe incorrect(s)')</script>");
}
else
{
$requete2 = "SELECT personnel.code AS personnel, ident, prenom, nom, statut.libelle FROM personnel, statut WHERE statut.code = personnel.codeStatut AND personnel.ident = '$ident'";
$result2 = $db -> query($requete2);
if($result2!=false)
{
$ligne=$result2->fetch_object();
session_start();
$_SESSION['pseudo'] = $ligne->ident;
$_SESSION['prenom'] = $ligne->prenom;
$_SESSION['nom'] = $ligne->nom;
$_SESSION['statut'] = $ligne->libelle;
$_SESSION['numero'] = $ligne->personnel;
header("Location:index.php");
}
}
}
else
{
echo ("<script>alert('Problème de lecture de la table personnel')</script>");
}
}
}
?>
<form id="connexion" action="connexion.php" method="post" onsubmit="return verifConnexion();">
<div id="corpsForm">
<table id="form">
<tr>
<td>
<label for="ident">Votre identifiant :</label>
</td>
<td>
<input type="text" name="ident" id="ident" value="<?php echo ($ident) ;?>" size="25" class="text" />
</td>
</tr>
<tr>
<td>
<label for="motDePasse">Votre mot de passe :</label>
</td>
<td>
<input type="password" name="motDePasse" id="motDePasse" value="<?php echo ($motDePasse) ;?>" size="25" class="text"/>
</td>
</tr>
<tr>
<td colspan="2"><br/>
<input type="hidden" name="prenom" id="prenom" value="<?php $prenom ;?>"/>
<input type="hidden" name="nom" id="nom" value="<?php $nom ;?>"/>
<input type="hidden" name="statut" id="statut" value="<?php $statut ;?>"/>
</td>
</tr>
<td colspan="2">
<div id="bouton">
<input type ="submit" name="connexion" id="Connexion" value= "Connexion"/>
</div>
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
<div id="footer">
<h4> Copyright © 2013 Groupe1 Conçu, Développé et Administré par Groupe1 </h4>
</div>
</div>
</body>
</html> |