Skip to content
Extraits de code Groupes Projets
Valider 5e2581c4 rédigé par Nassim YAICI's avatar Nassim YAICI
Parcourir les fichiers

Modifications

parent a8e424bf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<?php
session_start();
require_once"fonction.php";
$bdd=bdd();
?>
......@@ -10,6 +11,7 @@ $bdd=bdd();
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./bootstrap/css/mystyle.css">
<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
</head>
......@@ -17,29 +19,28 @@ $bdd=bdd();
<div class="container-fluid">
<div class="jumbotron">
<h1><span style="color: white">Com-Ensiie</span></h1>
</div>
<?php
if(isset($_SESSION['id']))
{
if (isset($_SESSION['pseudo'])) {
$pseudo=$_SESSION['pseudo'];
?>
<div>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./deconnexion.php'" >Deconnexion</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./edit.php'" >Edit</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./deconnexion.php'">Deconnexion</button>
<label for="hello"><?php echo "Bonjour, $pseudo";?></label>
</div>
<?php
}
else
{
?>
</div>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Log In</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./register.php'">Register</button>
</div>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Se connecter</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./register.php'">S'enregistrer</button>
<?php
}
?>
</div>
<div>
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="accueil.php">Com-Ensiie</a>
......
......@@ -31,11 +31,11 @@ class connexion
public function session()
{
$requete = ("SELECT id FROM users WHERE pseudo ='$this->pseudo'");
$requete = ("SELECT * FROM users WHERE pseudo ='$this->pseudo'");
$sql = pg_fetch_array(pg_query($requete));
$_SESSION['id'] = $sql['id'];
$_SESSION['pseudo'] = $this->pseudo;
$_SESSION['su'] = $sql['su'];
return 1;
}
}
......
<?php
session_start();
session_unset();
session_destroy();
header('Location: ./accueil.php');
<?php
session_start();
function bdd()
{
$bdd=pg_connect("host=localhost dbname=buyIIE user=postgres password=NASS12m26") or die("Erreur de connection à la base de données");
......

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
#
# Initial commit
#
# Changes to be committed:
# new file: README.md
# new file: accueil.php
# new file: base.sql
# new file: bootstrap/css/bootstrap-theme.css
# new file: bootstrap/css/bootstrap-theme.css.map
# new file: bootstrap/css/bootstrap-theme.min.css
# new file: bootstrap/css/bootstrap-theme.min.css.map
# new file: bootstrap/css/bootstrap.css
# new file: bootstrap/css/bootstrap.css.map
# new file: bootstrap/css/bootstrap.min.css
# new file: bootstrap/css/bootstrap.min.css.map
# new file: bootstrap/css/mystyle.css
# new file: bootstrap/fonts/glyphicons-halflings-regular.eot
# new file: bootstrap/fonts/glyphicons-halflings-regular.svg
# new file: bootstrap/fonts/glyphicons-halflings-regular.ttf
# new file: bootstrap/fonts/glyphicons-halflings-regular.woff
# new file: bootstrap/fonts/glyphicons-halflings-regular.woff2
# new file: bootstrap/js/bootstrap.js
# new file: bootstrap/js/bootstrap.min.js
# new file: bootstrap/js/jquery.min.js
# new file: bootstrap/js/npm.js
# new file: class/connexion.class.php
# new file: class/inscription.class.php
# new file: fonction.php
# new file: img/ad1.jpg
# new file: img/ad2.jpg
# new file: img/animal.jpg
# new file: img/autre.png
# new file: img/bg.jpg
# new file: img/multimedia.jpg
# new file: img/vetement.png
# new file: login.php
# new file: register.php
#
<?php
session_start();
require_once"fonction.php";
require_once"class/connexion.class.php";
$bdd=bdd();
if (!isset($_SESSION['id'])) {
if (isset($_POST['pseudo']) AND isset($_POST['mdp']))
{
$pseudo = $_POST['pseudo'];
......@@ -11,37 +13,38 @@ if (isset($_POST['pseudo']) AND isset($_POST['mdp']))
$verif = $connexion->verify();
if($verif == 1)
{
if ($connexion->session()) {
header("Location: ./accueil.php");
}
}
else
{
$erreur = $verif;
}
}
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Authentification</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<title>Com-Ensiie</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./bootstrap/css/mystyle.css">
<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="jumbotron">
<h1><span style="color: white">Com-Ensiie</span></h1>
</div>
<?php
if (!isset($pseudo, $mdp)) {
?>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Log In</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Se connecter</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./register.php'" >S'enregistrer</button>
<?php
}
......@@ -106,15 +109,15 @@ if (isset($_POST['pseudo']) AND isset($_POST['mdp']))
</form>
<div class="form-group">
<div >
<label for="creer" class="col-sm-2 control-label">Créer un compte</label>
<button type="submit" class="btn btn-primary" onclick="location.href='./register.php'">S'enregistrer</button>
<button type="submit" class="btn btn-success" onclick="location.href='./register.php'">S'enregistrer</button>
</div>
</div>
</div>
<div class="footer">
<div class="footre">
</div>
......
......@@ -3,43 +3,28 @@ require_once"fonction.php";
require_once"/class/inscription.class.php";
$bdd=bdd();
if(isset($_POST['pseudo'], $_POST['mail'], $_POST['mdp'], $_POST['mdpC']))
{
$inscription = new inscription($_POST['pseudo'], $_POST['mail'], $_POST['mdp'], $_POST['mdpC']);
$erreur = $inscription->verify();
if($erreur == "ok")
{
if($inscription->enregistrer())
{
header('Location: ./accueil.php');
}
}
else
{
$verif=$erreur;
}
}
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Création de compte</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<title>Com-Ensiie</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./bootstrap/css/mystyle.css">
<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="jumbotron">
<h1><span style="color: white">Com-Ensiie</span></h1>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Log In</button>
</div>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Se connecter</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./register.php'" >S'enregistrer</button>
</div>
</div>
<div>
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="accueil.php">Com-Ensiie</a>
......@@ -101,13 +86,7 @@ if(isset($_POST['pseudo'], $_POST['mail'], $_POST['mdp'], $_POST['mdpC']))
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<input type="submit" name="signUp" class="btn btn-primary" value="S'enregistrer">
<?php
if(isset($verif))
{
echo $verif;
}
?>
<input type="submit" name="signup" class="btn btn-primary" value="S'enregistrer">
</div>
</div>
</form>
......
<?php
session_start();
require_once"fonction.php";
$bdd = bdd();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Com-Ensiie</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./bootstrap/css/mystyle.css">
<script src="./bootstrap/js/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="jumbotron">
<h1><span style="color: white">Com-Ensiie</span></h1>
</div>
<?php
if(isset($_SESSION['pseudo'])){
$pseudo=$_SESSION['pseudo'];
?>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./deconnexion.php'" >Deconnexion</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./edit.php'" >Edit</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./newtopic.php'" >Nouveau sujet</button>
<label for="hello"><?php echo "Bonjour, $pseudo";?></label>
<?php
}
else
{
?>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./login.php'" >Log In</button>
<button type="button" class="btn btn-success btn-right" onclick="location.href='./register.php'">Register</button>
<?php
}
?>
</div>
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="accueil.php">Com-Ensiie</a>
</div>
<ul class="nav navbar-nav">
<li class="dropdown active"><a class="dropdown-toggle" data-toggle="dropdown" href="./topiclist.php">Commercial <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a id="cat" href="./topiclist.php">Multimédia</a></li>
<li><a id="cat" href="./topiclist.php">Vêtement</a></li>
<li><a id="cat" href="./topiclist.php">Animal</a></li>
<li><a id="cat" href="./topiclist.php">Autre</a></li>
</ul>
</li>
</ul>
</nav>
<?php
$dn2 = pg_query("SELECT * FROM toppics NATURAL JOIN users");
$nb = pg_fetch_row($dn2);
if($nb>=0)
{
?>
<div class="col-lg-8 lg-8 text-left">
<table class="table">
<col width="20%">
<col width="60%">
<col width="20%">
<thead>
<tr>
<th class="lead">Category</th>
<th class="lead">Sujet</th>
<th class="lead">Date</th>
<?php
if(isset($_SESSION['pseudo']) and $_SESSION['su'])
{
?>
<th class="lead">Action</th>
<?php
}
?>
</tr>
</thead>
</tr>
<div class="message">Cette catégorie ne contient aucun sujet.</div>
<?php
}
?>
</body>
</html>
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter