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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Compteur</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="haut">
</div>
<div id="menu_haut">
<ul>
<li><a href="admin.php?log"/>Afficher les logs</a></li>
<li><a href="admin.php?caisse"/>Afficher le compteurs</a></li>
</ul>
</div>
<div id="corps">
<?php
mysql_connect('localhost','root','');
mysql_select_db('boboff');
$date = date("d/m/y");
$heure = date("H:i:s");
$prix = "10";
if (isset($_GET['stop_compteur'])) // Si on demande de supprimer une news
{
// Alors on supprime la news correspondante
mysql_query("INSERT Into compteur(id, ip, date, heure, name,fin) VALUES ('','','','','','$heure')");
}
///////////////////////////////////////
if(isset($_GET['caisse']))
{
$query = "SELECT * FROM compteur";
$result = mysql_query($query) or die("Query failed");
$total = mysql_num_rows($result);
if($total) {
echo '<table>'."\n";
echo '<tr>';
echo '<th>Nom du pc</td>';
echo '<th>Date </td>';
echo '<th>heure de d\'arrivé</td>';
echo '<th>Arreter le compteur</td>';
echo '<th>IP</td>';
echo '<th>Prix à payer</td>';
echo '</tr>'."\n";
while($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td>'.$row['name'].'</td>';
echo '<td>'.$row['date'].'</td>';
echo '<td>'.$row['heure'].'</td>';
echo '<td>?</td>';
echo '<td>'.$row['ip'].'</td>';
echo '<td>'.$calcul.'</td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
}
mysql_free_result($result);
}
?>
</div>
</body>
</html> |
Partager