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
| <?php
try
{
$bdd= new PDO('mysql:host=localhost;dbname=elections','root','',array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
// On démarre la session AVANT d'écrire du code HTML
session_start();
// On s'amuse à créer quelques variables de session dans $_SESSION
$_SESSION['prenom'] = 'Jean';
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Vote</title>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="styleIndex.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="date_heure.js"></script>
<style>
.trait
{
width: 100%;
height: 40px;
background-color: #8C5DA2;
}
</style>
</head>
<body>
<div id="bloc_page" >
<?php
include('traitement/connexionPDO.php');
?>
<?php if(isset($_POST['IDVote']))
include("traitement/traivote.php");
?>
<?php
include('includes/header.php');
?>
<span id="date_heure"></span>
<script type="text/javascript">window.onload = date_heure('date_heure');</script>
<?php
echo'<i>Vous êtes ici : </i> <a href="../index.php">Accueil</a> > Espace Vote';
?>
<hr style="width: 100%; height: 1px" color="blue">
<center>
<form action="traitement/traivote.php" method="POST">
<table border="0">
<tr><td align="right"><b><label for="bureau">Bureau de vote : </label></b></td>
<td>
<select name="bureau" id="bureau" required>
<?php
$reponse = $bdd->query('SELECT * FROM bureau_de_vote');
while ($donnees = $reponse->fetch())
{
?>
<option value="<?php echo $donnees['CodeBureau_de_vote']; ?>">
<?php echo $donnees['NomBureau_de_vote']; ?>
</option>
<?php
}
?>
</select>
</td>
<td align="right"><b><label for="election">Election : </label></b></td>
<td>
<select name="election" id="election" required>
<?php
$reponse = $bdd->query('SELECT * FROM election');
while ($donnees = $reponse->fetch())
{
?>
<option value="<?php echo $donnees['CodeElection']; ?>">
<?php echo $donnees['NomElection']; ?>
</option>
<?php
}
?>
</select>
</td>
<td align="right"><b><label for="parti">Parti Politique : </label></b></td>
<td>
<select name="parti" id="parti" required>
<?php
$reponse = $bdd->query('SELECT * FROM parti');
while ($donnees = $reponse->fetch())
{
?>
<option value="<?php echo $donnees['CodeParti']; ?>">
<?php echo $donnees['NomParti']; ?>
</option>
<?php
}
?>
</select>
</td>
</tr>
</table>
<tr><td align="center"><br/><input type="submit" value="Voter"></td><td align="center"> <input type="reset" value="Anbandonner"><br/></td>
</form>
</center>
<br>
</div>
<footer>
<h5><font color="white">Copyright © 2018 - e-elections - Tous droits réservés.</font></h5>
</footer>
</body>
</html> |
Partager