예제 #1
0
This is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

this software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
require_once "../config/config_base.php";
require_once CONFIG_DIR . "/config_db.php";
require_once INC_DIR . "/autoload.function.php";
$p = new Webpage("Gestion des Types de Billets");
$p->appendCssUrl("../css/index.css");
$p->appendJsUrl("../lib/jquery.min.js");
$content = "";
if (isset($_GET['id']) && $_GET['id'] != null) {
    $request = new Request('SELECT', 'Utilisateur');
    $request->setparams("id_user ,firstName, lastName");
    $request->setConditions("id_user = "******"<p>" . $joueur['firstName'] . " " . $joueur['lastName'] . "</p>";
    }
}
$p->appendContent($content);
echo $p->toHTML();
<?php

include '../inc/autoload.function.php';
$p = new Webpage("Inscription");
$p->appendCssUrl('../css/index.css');
$p->appendBootstrap("../bootstrap");
if (isset($_GET['pass'])) {
    $p->appendContent(<<<HTML
\t<div class="alert alert-danger" role="alert"><b>Mots de passe incorrects</b></div>
HTML
);
} elseif (isset($_GET['mail'])) {
    $p->appendContent(<<<HTML
\t<div class="alert alert-danger" role="alert"><b>Mail déjà utilisé</b></div>
HTML
);
} elseif (isset($_GET['login'])) {
    $p->appendContent(<<<HTML
\t<div class="alert alert-danger" role="alert"><b>Pseudo déjà utilisé</b></div>
HTML
);
}
$p->appendContent(<<<HTML
\t<form class="form-horizontal" name="inscription" method="POST" action="../inc/inscription.php">

\t\t<div class="form-group">
\t\t\t<label for="lastName" class="col-sm-2 control-label">Nom *</label>
\t\t\t<div class="col-sm-4">
\t\t\t\t<input class="form-control" name="lastName" type="text" required>
\t\t\t</div>
\t\t</div>
예제 #3
0
<?php

require_once "autoload.function.php";
require_once "../config/config_db.php";
$p = new Webpage("Authentification");
$p->appendCssUrl('../css/index.css');
$p->appendBootstrap("../bootstrap");
if (!isset($_POST['mail']) || !isset($_POST['pass'])) {
    header('Location: formConnexion.php?err');
} else {
    $user = User::createFromAuth($_POST);
    if ($user == null) {
        header('Location: formConnexion.php?err');
    } else {
        $p->appendContent(<<<HTML
\t\t<p>Bonjour {$user->getFirstName()}</p>
HTML
);
    }
    echo $p->toHTML();
}
예제 #4
0
<?php

require_once "../inc/autoload.function.php";
require_once "../config/config_db.php";
$p = new Webpage("Hebergement");
$p->appendCssUrl('../css/index.css');
$p->appendJsUrl('../js/liens.js');
$p->appendBootstrap("../bootstrap");
$pdo = Connection_DB::getInstance();
$query = $pdo->prepare(<<<SQL
\tSELECT id_hebergeur, id_hebergement, nom, description, id_adresse, image
\tFROM Hebergement ;
SQL
);
$query->setFetchMode(PDO::FETCH_CLASS, "Hebergement");
$query->execute();
$tabHeb = $query->fetchAll();
foreach ($tabHeb as $heb) {
    $p->appendContent($heb->afficher());
}
echo $p->toHTML();
예제 #5
0
<?php

require_once "../inc/autoload.function.php";
require_once "../config/config_db.php";
$p = new Webpage("Authentification");
$p->appendCssUrl('../css/index.css');
$p->appendBootstrap("../bootstrap");
if (!isset($_POST['email']) || !isset($_POST['pass'])) {
    header('Location: ../inc/formConnexion.php?err');
} else {
    $user = Utilisateur::createFromAuth($_POST);
    if ($user == null) {
        header('Location: ../inc/formConnexion.php?err');
    } else {
        $p->appendContent(<<<HTML
\t\t<p>Bonjour {$user->affiche()}</p>
HTML
);
    }
    echo $p->toHTML();
}
예제 #6
0
$login = $_POST['login'];
$email = filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL);
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
$phone = $_POST['phone'];
if (isset($_POST['lastName']) && isset($_POST['firstName']) && isset($_POST['login']) && isset($_POST['email']) && isset($_POST['pass1']) && isset($_POST['pass2'])) {
    if ($pass1 != $pass2) {
        header("Location: ../front/formulaireInscription.php?pass");
    } elseif (valideEmail($email)) {
        header("Location: ../front/formulaireInscription.php?mail");
    } elseif (validePseudo($login)) {
        header("Location: ../front/formulaireInscription.php?login");
    } else {
        $pass = $pass1;
        $p->appendContent(<<<HTML
            <div>Votre compte à bien était créé  {$firstName}</div>
HTML
);
        $requete = Connection_DB::getInstance()->prepare(<<<SQL
        INSERT INTO Utilisateur (firstName, lastName, login, mail, password, phone) VALUES (:firstName, :lastName, :login, :mail, SHA1(:password), :phone)
SQL
);
        $requete->bindValue(':firstName', $firstName);
        $requete->bindValue(':lastName', $lastName);
        $requete->bindValue(':login', $login);
        $requete->bindValue(':mail', $email);
        $requete->bindValue(':password', $pass);
        $requete->bindValue(':phone', $phone);
        $requete->execute();
    }
} else {
    $p->appendContent(<<<HTML