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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
| <?php
session_start();
if(!empty($_POST['nom']) && !empty($_POST['prenoms'])
&& !empty($_POST['cni']) && !empty($_POST['adresse']) && !empty($_POST['sex'])){
$dns = 'mysql:dbname=pfe; charset=utf8; localhost';
$user = 'root';
$password = '';
$bdd = new PDO($dns, $user, $password);
$nom = $_POST['nom'];
$prenoms = $_POST['prenoms'];
$cni = $_POST['cni'];
$adresse = $_POST['adresse'];
$sexe = $_POST['sex'];
$numtel = $_POST['phone'];
$req=$bdd->prepare('INSERT INTO client(cni, prenom, nom, numTel, adresse, sexe)
VALUES (?, ?, ?, ?, ?, ?)')or die(print_r($bdd->errorInfo()));
$req->execute(array($cni, $prenoms, $nom, $numtel, $adresse, $sexe ));
echo $_POST['prenoms'];
header('location:home.php?message=données envoyées');
exit();
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Localisation voiture</title>
<link rel="stylesheet" href="../style/style1.css">
<link rel="stylesheet" href="../style/connection.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<?php
if(isset($_SESSION['connect'])){?>
<!--menu-->
<nav>
<div id="header" class="mt-2">
<h1>Espace Admin</h1>
<h1><a href="deconnection.php">Déconnexion</a></h1>
</div>
</nav>
<!--trait gris-->
<div class="bande-gray"></div>
<header>
<div class="header">
<div class="text">
<h1>Hello</h1>
<p style="color:white;">Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium, necessitatibus incidunt nulla fugiat eveniet <br/>et corrupti hic modi nisi debitis
alias quod sed<br/> temporibus ab maxime rem maiores sunt accusamus?
</p>
<h1><a href="#">Voir plus</a></h1>
</div>
<img src="../img/header-img.png" alt="">
</div>
</header>
<!--trait gris-->
<div class="bande-gray-header"></div>
<section id="menu">
<div class="container padding-10">
<div class="menu-p">
<div id="inscription" class="menu-e">
<img src="../img/inscription.png" alt="image-menu">
<h3>inscrire<br/> clients</h3>
<p>Lorem ipsum dolor sitn aspernatur, ipsa,
impedit asperiores doloremque?
</p>
<div class="button-menu">
<a href="#inscription_client">Lorem ipsum dolor </a>
</div>
</div>
<div id="reservation" class="menu-e">
<img src="../img/reservation.png" alt="image-menu">
<h3>Reservation <br/> véhicule</h3>
<p>Lorem ipsum dolor sitn aspernatur, ipsa,
impedit asperiores doloremque?
</p>
<div class="button-menu">
<a href="#">Lorem ipsum dolor </a>
</div>
</div>
<div id="consultation-res" class="menu-e">
<img src="../img/consulter_reservations.png" alt="image-menu">
<h3>Consulter <br/> reservations</h3>
<p>Lorem ipsum dolor sitn aspernatur, ipsa,
impedit asperiores doloremque?
</p>
<div class="button-menu">
<a href="#">Lorem ipsum dolor </a>
</div>
</div>
<div id="consulter-loc" class="menu-e">
<img src="../img/localisation.png" alt="image-menu">
<h3>Consulter<br/> localisations</h3>
<p>Lorem ipsum dolor sitn aspernatur, ipsa,
impedit asperiores doloremque?
</p>
<div class="button-menu">
<a href="#">Lorem ipsum dolor </a>
</div>
</div>
</div>
</div>
</section>
<section id="inscription_client" class="container">
<h1 style="text-align:center; padding-top:1.5rem; text-transform:uppercase">Entrez les informations du client</h1>
<div id="formulaire">
<form action="home.php" method="POST">
<table>
<tr>
<td><label for="nom">Nom</label> </td>
<td><input type="text" name="nom" placeholder="EX : stephane" id="nom" required></td>
</tr>
<tr>
<td><label for="prenom">Prenoms</label> </td>
<td><input type="text" name="prenoms" placeholder="EX : stephane" id="prenoms" required></td>
</tr>
<tr>
<td><label for="sexe" >Sexe </label> </td>
<td> M <input type="radio" name="sex" value="M" <?php if (isset($_POST['sex']) && $_POST['sex'] == 'M'): ?>checked='checked'<?php endif; ?> />
F <input type="radio" name="sex" value="F" <?php if (isset($_POST['sex']) && $_POST['sex'] == 'F'): ?>checked='checked'<?php endif; ?> /></td>
</tr>
<tr>
<td><label for="phone">Téléphone</label> </td>
<td> <input type="text" id="phone" name="phone" placeholder="EX : 06 00 00 00 00" required></td>
</tr>
<tr>
<td><label for="adresse">Adresse</label></td>
<td><input type="text" name="adresse" id="adresse" placeholder="EX : Rue AHMED BELKHAYAT" required></td>
</tr>
<tr>
<td><label for="cni">CNI</label></td>
<td><input type="text" name="cni" id="cni" placeholder=" EX : LT1669E" required></td>
</tr>
</table>
<div class="button">
<input style="background-color:#39A1FF;" type="submit" name="inscription" value="Inscription"/>
</div>
</form>
</div>
</section>
</div>
<?php }?>
</body>
</html> |
Partager