Пример #1
0
function createCommande($tabProduit)
{
    $db = createConnexion();
    $sql = "INSERT INTO `commandes`(`montant`, `dateCommande`, `codeClient`, `valide`,`idUtilisateur`) VALUES (:montant,:date,:codeClient,:valide,:idUser)";
    $stmt = $db->prepare($sql);
    if ($stmt->execute(array("montant" => getTotalCommande($tabProduit), "date" => date("Y-m-d H:i:s"), "codeClient" => $_SESSION["code"], "valide" => false, "idUser" => getUserId($_SESSION["code"])))) {
        insertDetails($tabProduit, $db->lastInsertId());
    }
}
Пример #2
0
<?php

$__ROOT__ = dirname(__FILE__) . "/..";
require_once $__ROOT__ . '/lib/lib.php';
if (!isset($_SESSION)) {
    session_start();
}
if (!isset($_SESSION['log'])) {
    $_SESSION['log'] = 0;
}
$db = createConnexion();
if ($db) {
    if (isset($_POST['password']) && isset($_POST['code'])) {
        $hash = hash('sha256', $_POST['password']);
        $sql = "SELECT * FROM utilisateurs WHERE codeClient = :code AND motDePasse = :hash";
        $stmt = $db->prepare($sql);
        if ($stmt->execute(array("code" => $_POST['code'], "hash" => $hash))) {
            $row = $stmt->fetch(PDO::FETCH_ASSOC);
            if ($row) {
                $_SESSION['log'] = 1;
                $_SESSION['code'] = $_POST['code'];
                $_SESSION['panier'] = array();
                if ($row["teleprospecteur"] == 1) {
                    $_SESSION['adm'] = 1;
                }
                header("Location: ..");
                die;
            } else {
                include $__ROOT__ . "/includes/error_login.html";
            }
        }
Пример #3
0
<?php

$__ROOT__ = dirname(__FILE__) . "/..";
require_once $__ROOT__ . '/lib/lib.php';
$Id = rand(10000, 99999);
$mdp = base_convert($Id, 20, 36);
$hash = hash('sha256', $mdp);
$DB = createConnexion();
?>
<html>
	<head>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
		<!-- Optional theme -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
		<!-- Latest compiled and minified JavaScript -->
		<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="../css/style.css"/>
	</head>
	<body class="home">
		<div>
			<h1 class="main-title">ALGOBREIZH</h1>
		</div>
		
		<?php 
if ($DB) {
    $stmt = $DB->prepare('SELECT codeClient FROM utilisateurs WHERE codeClient = :code');
    if ($stmt->execute(array('code' => $_POST['codeClient']))) {
        if ($stmt->fetch(PDO::FETCH_ASSOC)) {
            if (filter_var($_POST['mailClient'], FILTER_VALIDATE_EMAIL)) {
                //L'email est bon
Пример #4
0
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
	<link rel="stylesheet" href="/Algobreizh/css/style.css"/>
	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
	<!-- Latest compiled and minified JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
	<link rel="icon" type="image/png" href="/Algobreizh/images/AlgoBreizh_Logo_48px.png"/>
</head>
<body class="background-site padded">
	<?php 
include $__ROOT__ . "/includes/navbar.html";
?>
	<div style="background: rgba(500, 500, 500, 0.8);width:70%;margin-left:15%;margin-right:15%;position:absolute;padding-top:5%;margin-top:-5%" >
		<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
				<?php 
$connexion = createConnexion();
if ($connexion) {
    $request = 'SELECT idFamille,libelleFamille FROM familles ';
    $resfamille = $connexion->query($request);
    $i = 0;
    while ($donnes = $resfamille->fetch()) {
        ?>
								<div class="panel panel-default">
									<div class="panel-heading" role="tab" id="heading<?php 
        echo $i;
        ?>
">
										<h4 class="panel-title">
											<a role="button" data-toggle="collapse" href="#accordion<?php 
        echo $i;
        ?>