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
| <thead>
<!-- debut de la pagination -->
<?php
include('../../paggination.php');
?>
<!-- fin de la pagination -->
<ol>
<center> Les jeux d'aventures </center>
<div id="genre" >
<?php
// Récupération des informations du fichier blocnote (fichier txt).
$data[] = array(); // Tableau qui contiendra les données de façon structurée.
$fileHandle = fopen("../../../txt/Fichiers_produit.txt", "r+"); // Ouverture du fichier "blocnote.txt"
if ($fileHandle) {
while (($buffer = fgets($fileHandle, 4096)) !== false) { // Lecture des lignes du fichier, une par une.
list($nom_du_jeu, $date_sortie, $image, $nbr_joueur, $OS, $genre, $prix, $quant_dispo) = explode(';', $buffer); // Séparation des données de la ligne en cours en fonction du caractère "|".
$data[] = array('image'=>$image, 'nom_du_jeu' => $nom_du_jeu,'date_sortie' => $date_sortie, 'nbr de joueurs' => $nbr_joueur,'prix' => $prix, 'quant_dispo' =>$quant_dispo); // Ajout d'un tableau dans notre tableau de données contenant le joueur et les prenom_du_jeu.
}
fclose($fileHandle); // fermeture du fichier
}
?>
<table width="100%">
<tbody><tr align="center">
<td valign="top"><table style="border-collapse: collapse;" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr style="height: 16px" align="center"><td colspan="11" bgcolor="#ffcc99"><div align="center"><span class="font_pbr"></span></div></td></tr>
<tr style="height: 16px" align="center">
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>#</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>image</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>nom_du_jeu</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>date_sortie</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>nbr de joueurs</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>prix</b></font></td>
<td bgcolor="#cccccc"><font class="font_p" color="#5d8eb3"><b>quant dispo</b></font></td>
</tr>
<?php
$nb_elements = count($data);
$nb_lignes= $nb_elements;
for ($i = 1; $i <= $nb_lignes; $i ++)
{ // On veut afficher
$position = $i; // Définition de la position à afficher
?>
<tr style="height: 16px" align="center" bgcolor="#dddddd">
<td><?php echo $position; ?></td>
<td><?php echo isset($data[$i]['image']) ? "<img src=\"".$data[$i]['image']."\">" : ''; ?></td>
<td><?php echo isset($data[$i]['nom_du_jeu']) ? $data[$i]['nom_du_jeu'] : ''; ?></td>
<td><?php echo isset($data[$i]['date_sortie']) ? $data[$i]['date_sortie'] : ''; ?></td>
<!-- <td><?php echo isset($data[$i]['OS']) ? $data[$i]['OS'] : ''; ?></td> -->
<td><?php echo isset($data[$i]['nbr de joueurs']) ? $data[$i]['nbr de joueurs'] : ''; ?></td>
<!-- <td><?php echo isset($data[$i]['genre']) ? $data[$i]['genre'] : ''; ?></td> -->
<td><?php echo isset($data[$i]['prix']) ? $data[$i]['prix'] : ''; ?></td>
<td><?php echo isset($data[$i]['quant_dipo']) ? $data[$i]['quant_dipo'] : ''; ?></td>
</tr>
<?php
} // Fin de la boucle for
?>
</div>
</ol>
</thead> |
Partager