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
| <?php
// inclure le fichier de connection a la bdd
include "config.php" ;
// Demarer la session
session_start();
// Si aucune session est detecter on redirige vers la page de connection
if(!isset($_SESSION['username']) || empty($_SESSION['username'])){
header("location: login.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<!-- Css -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
<style>
.login-panel {
margin-top: 150px;
}
.table {
margin-top: 50px;
}
</style>
<body>
<div class="table-scrol">
<h1 align="center">Tout vos heures enregistrées</h1>
<div class="table-responsive"><!--this is used for responsive display in mobile and other devices-->
<table class="table table-bordered table-hover table-striped" style="table-layout: fixed">
<thead>
<tr>
<th>Dates</th>
<th>Nom du projet</th>
<th>Heure de debut</th>
<th>Heure de fin</th>
<th>Pause</th>
<th>Total</th>
<th>Commentaires</th>
<th>Editer</th>
<th>Suprimer</th>
</tr>
</thead>
<?php
$view_users_query="select * from heures";//select query for viewing users.
$sql=mysqli_query($bddconnection,$view_users_query);//here sql the sql query.
while($row=mysqli_fetch_array($sql))//while look to fetch the result and store in a array $row.
{
$id=$row[id];
$date=$row[dates];
$nom_projet=$row[nom_projet];
$heure_debut=$row[heure_debut];
$heure_fin=$row[heure_fin];
$pause=$row[pause];
$total=$row[total];
$commentaires=$row[commentaires];
?>
<tr>
<!--ici on affiche les resultats dans le tableau -->
<td><?php echo $date; ?></td>
<td><?php echo $nom_projet; ?></td>
<td><?php echo $heure_debut; ?></td>
<td><?php echo $heure_fin; ?></td>
<td><?php echo $pause; ?></td>
<td><?php echo $total ?></td>
<td><a href="?voir-commentaire=<?php echo $id ?>"><button class="btn btn-info">Voir Notes</button></a></td> <!--btn btn-danger is a bootstrap button to show danger-->
<td><a href="delete.php?del=<?php echo $id ?>"><button class="btn btn-warning">Editer</button></a></td> <!--btn btn-danger is a bootstrap button to show danger-->
<td><a href="delete.php?id=<?php echo $id ?>" onClick="return confirm('Etes vous sur de vouloir suprimer')"><button class="btn btn-danger">Suprimer</button></a></td> <!--btn btn-danger is a bootstrap button to show danger-->
</tr>
<?php
}
$bddconnection->close();
?>
</table>
</div>
</div>
</body>
</html> |
Partager