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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ajout Des Tarif</title>
<style type="text/css" media="all">
@import url(style.css);
</style>
</head>
<body bgcolor="#677BAD">
<div id="titre">
TEST 4 requêtes SQL
</div>
<div id="conteneur2">
<div id="contenu">
<?php
include('sql/conf.php');
include('inc/gomonth.php');
$afficheSaison = mysql_query("SELECT * FROM Saison S order by S.id_s ASC") or die (mysql_error());
$afficheDuree = mysql_query("SELECT * FROM Duree D order by D.id_d ASC") or die (mysql_error());
$afficheCategorie = mysql_query("SELECT * FROM Categorie C order by C.nom_categorie ASC") or die (mysql_error());
$afficheTarif = mysql_query("SELECT * FROM Tarif T order by T.id_t ASC") or die (mysql_error());
while($rowS = mysql_fetch_assoc($afficheSaison)){
//Recup info saison
$tab['id_s'][] = $rowS['id_s'];
$tab['nom_saison'][] = $rowS['nom_saison'];
$tab['lim_basse'][] = $rowS['lim_basse'];
$tab['lim_haute'][] = $rowS['lim_haute'];
}
while($rowD = mysql_fetch_assoc($afficheDuree)){
//Recup info duree
$tab['id_d'][] = $rowD['id_d'];
$tab['nom_duree'][] = $rowD['nom_duree'];
$tab['lim_duree_basse'][] = $rowD['lim_duree_basse'];
$tab['lim_duree_haute'][] = $rowD['lim_duree_haute'];
}
while($rowC = mysql_fetch_assoc($afficheCategorie)){
//Recup info categorie
$tab['id_c'][] = $rowC['id_c'];
$tab['nom_categorie'][] = $rowC['nom_categorie'];
}
while($rowT = mysql_fetch_assoc($afficheTarif)){
//Recup info tarif
$tab['id_t'][] = $rowT['id_t'];
$tab['id_saison'][] = $rowT['id_saison'];
$tab['id_duree'][] = $rowT['id_duree'];
$tab['id_categorie'][] = $rowT['id_categorie'];
$tab['loca_tarif'][] = $rowT['loca_tarif'];
}
$Nb_saison = count($tab['id_s']);
$Nb_duree = count($tab['id_d']);
$Nb_categorie = count($tab['id_c']);
?>
<div id="visualisation3">
<?php
$i=0;
for($i=0; $i<$Nb_saison; $i++){
?>
<table cellpadding="7" cellspacing="0" border="1" width="100%" align="center">
<tr>
<td align="center" class="headtable2" colspan="<?php echo ($Nb_duree+1);?>">
<?php echo $tab['nom_saison'][$i].' : du '.toSql($tab['lim_basse'][$i]).' au '.toSql($tab['lim_haute'][$i]); ?>
</td>
</tr><tr>
<td align="center" class="headtable3">Catégories</td>
<?php
for($j=0; $j<$Nb_duree; $j++){
echo '<td align="center" class="headtable3">'.$tab['nom_duree'][$j].'</td>';
} //Fin de la boucle j pour les tranches de durée
?>
</tr>
<?php
if(!isset($m)){
$m = 0;
}
for($k=0; $k<$Nb_categorie; $k++){
echo '<tr><td align="center" class="headtable3">'.$tab['nom_categorie'][$k].'</td>';
for($l=0; $l<$Nb_duree; $l++){
echo '<td align="center" class="colorcell">'.$tab['loca_tarif'][$m].' €</td>';
$m++;
} //Fin de la boucle l pour les cellules
echo '</tr>';
} // Fin de la boucle k pour les catégories
?>
</table>
<br /><br />
<?php
} //Fin de la boucle i pour les saisons
?>
</div>
</div>
</div>
</body>
</html> |
Partager