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
   | <?php
        session_start();
?>
 
<!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" />
		<link rel="stylesheet" type="text/css" href="style.css" />
		<script language="javascript" src="./lib/browser-class.js"></script>
		<script language="javascript">
			var browser = new Browser();
			var xhr = browser.getRequest();
 
			function $(id)
			{
				return document.getElementById(id);
			}
			function show()
			{
 
				xhr.open("GET","makeConseil.php?id="+$('liste').value,true);
				xhr.send(null);
				xhr.onreadystatechange = view;
			}
 
			function view()
			{
				if(xhr.readyState ==4)
					if(xhr.status != 404 && xhr.status != 500)
					{
						if(navigator.userAgent.indexOf('MSIE 7') != -1 || navigator.userAgent.indexOf('MSIE 6') != -1 )
						{
							var oeuvres = xhr.responseXML.getElementsByTagName("oeuvre");
							alert(oeuvres);
 
						}
						else
						{	
							alert("autre");				
							var oeuvres = xhr.responseXML.getElementsByTagName("oeuvre");
							var string = "";
 
							for(i=0;i<oeuvres.length;i++)			
								string += "<li><a href=oeuvre.php?id_oeuvre="+
											oeuvres[i].firstChild.firstChild.data+">"+
											oeuvres[i].lastChild.firstChild.data+"</a></li>";				
 
							$('result').innerHTML = "<ul>"+string+"</ul>";
						}
					}			
			}
		</script>
 
	</head>		
 
	<?php
                include_once("design_haut.php");
        ?>
 
	<h1>Conseils de lecture</h1>
 
	Choisissez une catégorie
	<?php
                // Connection ODBC
                include_once("connection_BD.php");
                
                // Accés à la table
                $query = "Select Catégorie, Code_Catégorie 
                                  from Catégories 
                                  order by Catégorie";
                $result = odbc_exec($conn,$query);
                
                echo "<select id='liste'>";
                // Boucle de lecture
                while(odbc_fetch_row($result))
                {
                        $cat = odbc_result($result, 1);
                        $id_cat = odbc_result($result, 2);
                        echo "<option value=".$id_cat.">".$cat."</option>";
                }
                echo "</select>";
                
        
                // Déconnexion de la base de données
                include_once("deconnection_BD.php");
        ?>	
	<input type="button" onclick="show();" value="voir"/>
	<div id="result"></div>
	<?php
                include_once("design_bas.php");
        ?> | 
Partager