<!DOCTYPE html>
<html>
	<head>
		<title>Carte</title>
		<?php $titre = 'Carte'; ?>
		<meta charset="UTF-8">
		<?php include 'session.inc.php'; check_login(); ?>
		<link rel="stylesheet" href="style/style.css" />
		<link rel="stylesheet" href="style/style_jquery-ui.css">
		<script type="text/javascript" src="script/jquery.js"></script>
		<script type="text/javascript" src="script/jquery-ui.js"></script>
  		<script>
			$(function() {
				$( "#tabs" ).tabs();
			});
 		</script>

	</head>

	<body>
		<?php
			error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
			Include('../database.params.inc.php');
			$link = pg_connect("host=$machine user=$user password=$pwd dbname=$db")or die("Erreur de Connection !<br />".pg_last_error()) ;
		?>
    	<?php include("menu.php"); ?>
		<div id="contenu">
			<!-- Le contenu doit etre écrit ci-dessous -->

			<form method=post name="carte" action="carte_2.php">
				<?php
					// récupération des type de conso
					$query = "SELECT DISTINCT type FROM PRODUIT ORDER BY type";
					$result = pg_query($link, $query) or die("Erreur SQL !<br />$query<br />".pg_last_error()) ;
					$nb_type = pg_num_rows($result);
					$i = 0;
					while ($i<$nb_type) {
						$type[$i] = pg_fetch_result($result, $i, "type");
						$i++;
					}
				?>

				<!-- Systeme d'onglet -->
				<div id="tabs">
					<ul>
						<?php 
							$a = 1;
							while ( $a <= $nb_type) {?>
						        <li><a href="#tabs-<?php echo $a;?>"><?php echo $type[$a-1];?></a></li>
							<?php 
								$a++; 
							} 
						?>
					</ul>


			    	<?php 
			    		$b = 1;
			    		while ( $b <= $nb_type) {
			    			$val = $b-1;
			    			$query2 = "SELECT id_produit, nom, prix, information, img, dispo FROM PRODUIT WHERE type = '$type[$val]' ORDER BY id_produit";
			    			$result2 = pg_query($link, $query2) or die("Erreur SQL !<br />$query<br />".pg_last_error()) ;
			    			$num = pg_num_rows($result2);

			    			?> 
		    				<div id="tabs-<?php echo $b;?>">
		    				<!--tab content-->
				    			<?php
				    				$c = 0;
				    				while ($c < $num) { 
				    					$nb_commande = pg_fetch_result($result2, $c, "id_produit");
				    					$dispo = pg_fetch_result($result2, $c, "dispo");
				    					?>
				    					<input type='hidden' id='prod_<?php echo $nb_commande ;?>' name='prod_<?php echo $nb_commande ;?>' value='null'>
							        
							            <!-- Affichage en forme du produit -->
										<table>
											<tr>
												<td rowspan="2" class="tab_1"><img src="../carte/<?php echo( pg_fetch_result($result2, $c, "img")); ?>" class="tab_1_input"></td>
												<td class="tab_2"><?php echo( pg_fetch_result($result2, $c, "nom")); ?></td>
												<td rowspan="2" class="tab_6"><?php echo( pg_fetch_result($result2, $c, "prix")); ?>€</td>
												<td rowspan="2" class="tab_3" style="<?php if( $dispo == 'false'){ echo 'position: relative; z-index: 2;';}?>"><button id="bt_index" onclick="document.forms.carte.prod_<?php echo $nb_commande ;?>.value='true'; submit();"><img src="img/check.png"></button></td>
												<td rowspan="2" class="tab_4" style="<?php if( $dispo == 'true'){ echo 'position: relative; z-index: 2;';}?>"><button id="bt_index" onclick="document.forms.carte.prod_<?php echo $nb_commande ;?>.value='false';submit();"><img src="img/delete.png"></button></td>
																
																
											</tr>
											<tr>
												<td class="tab_7"><?php echo( pg_fetch_result($result2, $c, "information")); ?></td>
											</tr>
											<?php if( $dispo == 'false'){ echo "<tr class='table_gris'></tr>";}?>
											
										</table>
										<br>						        
						        	<?php $c++; 
						    		}
				        		?> 		
			        		</div> 
				        	<?php
				        	$b++; 
						} 
					?>

				</div>
			</form>
		</div>
	</body>
</html>
<!--
Donc, le tr que tu veux griser tu le positionne en relatif.
Tu ajoute dedans, en plus des td , un contenait qui fait la même taille que le tr.
Lui tu le positionne en absolue.
Plus qu'a jouer sur les z-index et la couleur et en principe c'est bon.
position relative + z-index 2;
-->