Annuaire téléphonique Drupal 7

Bonjour,

J'aimerai créer un annuaire téléphonique ou e-mail sur drupal 7, pouvez-vous m'aider je suis débutant sur drupal 7.
merci d'avance pour votre aide.

2 réponses

  1. voici mon code que j'ai pour linstant et j'aimerai mettre une liste deroulante dans type de structure mais je ne sais pas comment faire

    <html><head><title>Annuaire Telephonique</title></head>

    <body BGCOLOR="#DCE1E0"><font face="arial">
    <div id="annuaire">
    <?php

    $host="x";
    $user="xx";
    $pass="xxx";
    $base1="xxxx";
    $table="xxxxx";
    $task= $_GET['task'];

    $bdd= mysql_connect($host,$user,$pass) or die("erreur de connexion au serveur $host");
    mysql_select_db($base1,$bdd) or die("erreur de connexion a la base de donnees");

    print"<table align='center'>";
    Print "<tr>";
    Print "<td>";
    Print "<H2>Annuaire Telephonique</H2>";
    Print "<li><A HREF='annuaire.php?task=2'>recherche dans la base</A></li>";
    Print "<br>";
    Print "<li><A HREF='http://www.ch-pl.fr/drupalstage/drupal02/#'>Retournez sur le site</A></li>";
    Print "</td>";
    Print "</tr>";
    Print "</table>";
    print "<br>";

    switch($task)
    {
    case 1: /* ajouter une entree dans la base*/

    $id= $_POST['id'];
    $nom= $_POST['nom'];
    $sites= $_POST['sites'];
    $services= $_POST['services'];
    $type_structure= $_POST['type_structure'];
    $adresse= $_POST['adresse'];
    $cp= $_POST['cp'];
    $ville= $_POST['ville'];
    $tel= $_POST['tel'];
    $horaire= $_POST['horaire'];
    $lienmap= $_POST['lienmap'];

    print"<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#CCCCCC'>";
    Print "<form name='ajouter' action='annuaire.php?task=6&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap' >";
    Print "<tr>";
    Print "<td colspan='2' align='center'>";
    print "<h2>Ajouter une entree</h2>";
    Print "</td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>Nom</td>";
    Print "<td><input type='text' name='nom'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>sites</td>";
    Print "<td><input type='text' name='sites'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>services</td>";
    Print "<td><input type='text' name='services'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>type_structure</td>";
    Print "<td><input type='text' name='type_structure'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>adresse</td>";
    Print "<td><input type='text' name='adresse'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>cp</td>";
    Print "<td><input type='text' name='cp'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>ville</td>";
    Print "<td><input type='text' name='ville'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>horaire</td>";
    Print "<td><input type='text' name='horaire'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>lienmap</td>";
    Print "<td><input type='text' name='lienmap'></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>Tel</td>";
    Print "<td><input type='text' name='tel'></td></tr><tr><td> </td>";
    Print "<td><input type='submit' name='op1' value='Ajouter' action='annuaire.php?task=6&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'></td>";
    Print "</tr>";
    Print "</form>";
    Print "</table>";
    break;

    case 2: /* recherche dans la base */

    print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#F9FAFA'>";
    print "<td>";
    print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#A5DDDF'>";
    print "<form name='recherche' action='annuaire.php?task=7' method='POST'>";
    print "<tr>";
    print "<td colspan='2' align='center'>";
    print "<h2>Rechercher</h2>";
    print "</td>";
    print "</tr>";
    print "<tr>";
    print "<td align='right'>Type de structure</td>";
    print "<td><input type='text' name='type_structure'></td>";
    print "</tr>";
    print "<tr>";
    print "<td align='right'>Nom</td>";
    print "<td><input type='text' name='nom'></td>";
    print "</tr>";
    print "<tr>";
    print "<td align='right'>Code Postal</td>";
    print "<td><input type='text' name='cp'></td>";
    print "</tr>";
    print "<tr>";
    print "<td align='right'>Ville</td>";
    print "<td><input type='text' name='ville'></td>";
    print "</tr>";
    print "<tr>";
    print "<td> </td>";
    print "<td><input type='submit' name='op2' value='Rechercher' action='annuaire.php?task=7'></td>";
    print "</tr>";
    print "</form>";
    print "</table>";
    print "</td>";
    print "</table>";
    break;

    case 3: /* test de suppression des resultats */

    $id= $_POST['id'];

    print"<table align='center'>";
    print "<tr>";
    print "<td>Vous etes sur ?";
    print "<li><A HREF='annuaire.php?task=5&id=$id'>OUI<A/></li>";
    print "<li><A HREF='javascript:history.back();'>Annuler<A/></li>";
    print "</td>";
    print "</tr>";
    print "</table>";

    break;
    case 4: /* modifier des resultats */

    $id= $_POST['id'];
    $nom= $_POST['nom'];
    $sites= $_POST['sites'];
    $services= $_POST['services'];
    $type_structure= $_POST['type_structure'];
    $adresse= $_POST['adresse'];
    $cp= $_POST['cp'];
    $ville= $_POST['ville'];
    $tel= $_POST['tel'];
    $horaire= $_POST['horaire'];
    $lienmap= $_POST['lienmap'];

    print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#CCCCCC'>";
    PRINT "<form name='modifier' action='annuaire.php?task=8&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap' method='POST'>";
    Print "<tr>";
    Print "<td colspan='2' align='center'>";
    Print "<h2>Modifier</h2>";
    Print "</td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>Id</td>";
    Print "<td>$id</td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>Nom</td>";
    Print "<td><input type='text' name='nom' value=$nom></td>";
    Print "</tr>";
    Print "<tr>";
    Print "<td align='right'>sites</td>";
    Print "<td><input type='text' name='prenom' value=$sites></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>services</td>";
    Print "<td><input type='text' name='services' value=$services></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>type_structure</td>";
    Print "<td><input type='text' name='type_structure' value=$type_structure></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>adresse</td>";
    Print "<td><input type='text' name='adresse' value=$adresse></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>cp</td>";
    Print "<td><input type='text' name='cp' value=$cp></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>ville</td>";
    Print "<td><input type='text' name='ville' value=$ville></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>Tel</td>";
    Print "<td><input type='text' name='tel' value=$tel></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>horaire</td>";
    Print "<td><input type='text' name='horaire' value=$horaire></td>";
    Print "</tr>";
    Print "<tr>";
    print "<td align='right'>lienmap</td>";
    Print "<td><input type='text' name='lienmap' value=$lienmap></td>";
    Print "</tr>";
    print "<tr>";
    Print "<td> </td>";
    Print "<td><input type='hidden' name='id' value='$id'><input type='submit' name='op4' value='Modifier' action='annuaire.php?task=8&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'></td>";
    Print "</tr>";
    print "</form>";
    Print "</table>";
    break;

    case 5:

    $id= $_POST['id'];

    $query="DELETE FROM $table WHERE id = '$id'";
    $res=mysql_query($query);
    if ($res)
    {
    print"<center><h4>Entree supprimee</h4></center>";
    }
    else
    {
    print "<center><h4>Erreur</h4></center>";
    }
    break;

    case 6 :

    $nom= $_POST['nom'];
    $sites= $_POST['sites'];
    $services= $_POST['services'];
    $type_structure= $_POST['type_structure'];
    $adresse= $_POST['adresse'];
    $cp= $_POST['cp'];
    $ville= $_POST['ville'];
    $tel= $_POST['tel'];
    $horaire= $_POST['horaire'];
    $lienmap= $_POST['lienmap'];

    $query="INSERT INTO $table VALUES (\"\",\"$nom\",\"$sites\",\"$services\",\"$type_structure\",\"$adresse\",\"$cp\",\"$ville\",\"$tel\",\"$horaire\",\"$lienmap\")";
    $res=mysql_query($query) or die ("erreur");
    if ($res)
    {
    print"<center><h4>Entree ajoutee</h4></center>";
    }
    else
    {
    print"<center><h4>Erreur</h4></center>";
    }
    break;

    case 7 :

    $id= $_POST['id'];
    $nom= $_POST['nom'];
    $sites= $_POST['sites'];
    $services= $_POST['services'];
    $type_structure= $_POST['type_structure'];
    $adresse= $_POST['adresse'];
    $cp= $_POST['cp'];
    $ville= $_POST['ville'];
    $tel= $_POST['tel'];
    $horaire= $_POST['horaire'];
    $lienmap= $_POST['lienmap'];

    $query="SELECT * FROM $table WHERE id IS NOT NULL";
    if ($nom)
    {
    $query.=" AND an_nom LIKE '$nom%'";
    }
    if ($sites)
    {
    $query.=" AND sites LIKE '$sites%'";
    }
    if ($services)
    {
    $query.=" AND services LIKE '$services%'";
    }
    if ($type_structure)
    {
    $query.=" AND type_structure LIKE '$type_structure%'";
    }
    if ($adresse)
    {
    $query.=" AND adresse LIKE '$adresse%'";
    }
    if ($cp)
    {
    $query.=" AND cp LIKE '$cp%'";
    }
    if ($ville)
    {
    $query.=" AND ville LIKE '$ville%'";
    }
    if ($tel)
    {
    $query.=" AND TEL LIKE '%$tel%'";
    }
    if ($horaire)
    {
    $query.=" AND horaire LIKE '$horaire%'";
    }
    if ($lienmap)
    {
    $query.=" AND lienmap LIKE '$lienmap%'";
    }

    $query.=" ORDER BY nom";
    $res=mysql_query($query);
    print "<table width='0%' cellpadding='5' cellspacing='1' border='0' align='center'>";
    print "<td bgcolor='#F9FAFA' align='center'>";
    print "<table width='0%' cellpadding='5' cellspacing='1' border='0' align='center'>";
    print "<tr>";
    // print "<td bgcolor='#CCCCCC' align='center'><b>Id</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>Type de structure</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>Nom</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>Adresse</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>CodePostal</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>Ville</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>Telephone</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>horaire</b></td>";
    print "<td bgcolor='#A5DDDF' align='center'><b>lienmap</b></td>";
    print "<td> </td>";
    print "<td> </td>";
    print "</tr>";

    while($val=mysql_fetch_array($res)or die(mysql_error()))
    {
    $id = $val['id'];
    $nom = $val['nom'];
    $sites = $val['sites'];
    $services = $val['services'];
    $type_structure = $val['type_structure'];
    $adresse = $val['adresse'];
    $cp = $val['cp'];
    $ville = $val['ville'];
    $tel = $val['tel'];
    $horaire = $val['horaire'];
    $lienmap = $val['lienmap'];

    print"<tr>";
    // print "<td bgcolor='#CCCCCC'>$id</td>";
    print "<td bgcolor='#A5DDDF'>$type_structure</td>";
    print "<td bgcolor='#A5DDDF'>$nom</td>";
    print "<td bgcolor='#A5DDDF'>$adresse</td>";
    print "<td bgcolor='#A5DDDF'>$cp</td>";
    print "<td bgcolor='#A5DDDF'>$ville</td>";
    print "<td bgcolor='#A5DDDF'>$tel</td>";
    print "<td bgcolor='#A5DDDF'>$horaire</td>";
    print "<td bgcolor='#A5DDDF'><A HREF='$lienmap'>Google Map<A/></td>";

    // print "<td bgcolor='#CCCCCC'>";
    // print "<A HREF='annuaire.php?task=4&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'>modifier</A>";
    // print "</td>";
    // print "<td bgcolor='#CCCCCC'>";
    // print "<A HREF='annuaire.php?task=3&id=$id'>effacer</A>";
    // print "</td>";
    // print "</tr>";
    }
    print"</table><br>";
    print "</td>";
    print"</table<br>";

    break;
    case 8 :

    $id= $_POST['id'];
    $nom= $_POST['nom'];
    $sites= $_POST['sites'];
    $services= $_POST['services'];
    $type_structure= $_POST['type_structure'];
    $adresse= $_POST['adresse'];
    $cp= $_POST['cp'];
    $ville= $_POST['ville'];
    $tel= $_POST['tel'];
    $horaire= $_POST['horaire'];
    $lienmap= $_POST['lienmap'];

    $query="UPDATE $table SET nom='$nom', sites='$sites',services='$services',type_structure='type_structure',adresse='$adresse',cp='$cp',ville='$ville',tel='$tel',horaire='$horaire',lienmap='lienmap' WHERE id='$id'";
    $res=mysql_query($query);
    if ($res)
    {
    print"<center><h4>Entree modifiee</h4></center>";
    }
    else
    {
    print"<center><h4>Erreur</h4></center>";
    }
    break;

    }
    mysql_close();
    ?>
    </div>
    </font></body></html>
    0
    1. alors j'ai reussit a mettre ma liste deroulante le seul problème est que je n'arrive pas a afficher le contenu de toute ma base quand type de structure = tous et ville = toutes

      Voici mon code

      <html><head><title>Annuaire Telephonique</title></head>

      <body BGCOLOR="#DCE1E0"><font face="arial">
      <div id="annuaire">
      <?php

      $host="x;
      $user="x";
      $pass="x";
      $base1="x";
      $table="x";
      $task= $_GET['task'];

      $bdd= mysql_connect($host,$user,$pass) or die("erreur de connexion au serveur $host");
      mysql_select_db($base1,$bdd) or die("erreur de connexion a la base de donnees");

      print"<table align='center'>";
      Print "<tr>";
      Print "<td>";
      Print "<H2>Annuaire Telephonique</H2>";
      Print "<li><A HREF='annuaire.php?task=2'>recherche dans la base</A></li>";
      Print "<br>";
      Print "<li><A HREF='http://www.ch-pl.fr/drupalstage/drupal02/#'>Retournez sur le site</A></li>";
      Print "</td>";
      Print "</tr>";
      Print "</table>";
      print "<br>";

      switch($task)
      {
      case 1: /* ajouter une entree dans la base*/

      $id= $_POST['id'];
      $nom= $_POST['nom'];
      $sites= $_POST['sites'];
      $services= $_POST['services'];
      $type_structure= $_POST['type_structure'];
      $adresse= $_POST['adresse'];
      $cp= $_POST['cp'];
      $ville= $_POST['ville'];
      $tel= $_POST['tel'];
      $horaire= $_POST['horaire'];
      $lienmap= $_POST['lienmap'];

      print"<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#CCCCCC'>";
      Print "<form name='ajouter' action='annuaire.php?task=6&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap' >";
      Print "<tr>";
      Print "<td colspan='2' align='center'>";
      print "<h2>Ajouter une entree</h2>";
      Print "</td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>Nom</td>";
      Print "<td><input type='text' name='nom'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>sites</td>";
      Print "<td><input type='text' name='sites'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>services</td>";
      Print "<td><input type='text' name='services'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>type_structure</td>";
      Print "<td><input type='text' name='type_structure'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>adresse</td>";
      Print "<td><input type='text' name='adresse'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>cp</td>";
      Print "<td><input type='text' name='cp'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>ville</td>";
      Print "<td><input type='text' name='ville'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>horaire</td>";
      Print "<td><input type='text' name='horaire'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>lienmap</td>";
      Print "<td><input type='text' name='lienmap'></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>Tel</td>";
      Print "<td><input type='text' name='tel'></td></tr><tr><td> </td>";
      Print "<td><input type='submit' name='op1' value='Ajouter' action='annuaire.php?task=6&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'></td>";
      Print "</tr>";
      Print "</form>";
      Print "</table>";
      break;

      case 2: /* recherche dans la base */

      print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#F9FAFA'>";
      print "<td>";
      print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#A5DDDF'>";
      print "<form name='recherche' action='annuaire.php?task=7' method='POST'>";
      print "<tr>";
      print "<td colspan='2' align='center'>";
      print "<h2>Rechercher</h2>";
      print "</td>";
      print "</tr>";
      print "<tr>";
      print "<td align='right'>Type de structure</td>";
      print "<td><select size='1' name='type_structure'>";
      print "<option selected value='type_structure'>Tous</option>";
      print "<option value='type_structure'>Antenne</option>";
      print "<option value='type_structure'>CATTP</option>";
      print "<option value='type_structure'>CESAM</option>";
      print "<option value='type_structure'>CMP</option>";
      print "<option value='type_structure'>Chateau Augy</option>";
      print "<option value='type_structure'>Hopital de jour</option>";
      print "<option value='type_structure'>Pole de Readaptation Intersectoriel</option>";
      print "<option value='type_structure'>Pole Nevers</option>";
      print "<option value='type_structure'>Pole Nord</option>";
      print "<option value='type_structure'>Pole Sud</option>";
      print "<option value='type_structure'>Unite de Gerontopsychiatrie</option>";
      print "<option value='type_structure'>Unite de preparation a la S</option>";
      print "<option value='type_structure'>Unite de Sejour prolonge</option>";
      print "<option value='type_structure'>Unite de Soins de longue</option>";
      print "<option value='type_structure'>Unite Entrant Pole Nevers</option>";
      print "<option value='type_structure'>Unite Entrant Pole Nord</option>";
      print "</select></td>";
      print "</tr>";
      print "<tr>";
      print "<td align='right'>Nom</td>";
      print "<td><input type='text' name='nom'></td>";
      print "</tr>";
      print "<tr>";
      print "<td align='right'>Code Postal</td>";
      print "<td><input type='text' name='cp'></td>";
      print "</tr>";
      print "<tr>";
      print "<td align='right'>Ville</td>";
      print "<td><select size='1' name='ville'>";
      print "<option selected value='ville'>Toutes</option>";
      print "<option value='ville'>Chatillon en Bazois</option>";
      print "<option value='ville'>Clamecy</option>";
      print "<option value='ville'>Cosne sur loire</option>";
      print "<option value='ville'>Corbigny</option>";
      print "<option value='ville'>Decize</option>";
      print "<option value='ville'>Guerigny</option>";
      print "<option value='ville'>Imphy</option>";
      print "<option value='ville'>La charite sur loire</option>";
      print "<option value='ville'>Nevers</option>";
      print "<option value='ville'>Saint Pierre le Moutier</option>";
      print "<option value='ville'>Sancergues</option>";
      print "<option value='ville'>Varzy</option>";
      print "</select></td>";
      print "</tr>";
      print "<tr>";
      print "<td> </td>";
      print "<td><input type='submit' name='op2' value='Rechercher' action='annuaire.php?task=7'></td>";
      print "</tr>";
      print "</form>";
      print "</table>";
      print "</td>";
      print "</table>";
      break;

      case 3: /* test de suppression des resultats */

      $id= $_POST['id'];

      print"<table align='center'>";
      print "<tr>";
      print "<td>Vous etes sur ?";
      print "<li><A HREF='annuaire.php?task=5&id=$id'>OUI<A/></li>";
      print "<li><A HREF='javascript:history.back();'>Annuler<A/></li>";
      print "</td>";
      print "</tr>";
      print "</table>";

      break;
      case 4: /* modifier des resultats */

      $id= $_POST['id'];
      $nom= $_POST['nom'];
      $sites= $_POST['sites'];
      $services= $_POST['services'];
      $type_structure= $_POST['type_structure'];
      $adresse= $_POST['adresse'];
      $cp= $_POST['cp'];
      $ville= $_POST['ville'];
      $tel= $_POST['tel'];
      $horaire= $_POST['horaire'];
      $lienmap= $_POST['lienmap'];

      print "<table width='0%' cellpadding='5' cellspacing='0' border='0' align='center' bgcolor='#CCCCCC'>";
      PRINT "<form name='modifier' action='annuaire.php?task=8&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap' method='POST'>";
      Print "<tr>";
      Print "<td colspan='2' align='center'>";
      Print "<h2>Modifier</h2>";
      Print "</td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>Id</td>";
      Print "<td>$id</td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>Nom</td>";
      Print "<td><input type='text' name='nom' value=$nom></td>";
      Print "</tr>";
      Print "<tr>";
      Print "<td align='right'>sites</td>";
      Print "<td><input type='text' name='prenom' value=$sites></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>services</td>";
      Print "<td><input type='text' name='services' value=$services></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>type_structure</td>";
      Print "<td><input type='text' name='type_structure' value=$type_structure></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>adresse</td>";
      Print "<td><input type='text' name='adresse' value=$adresse></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>cp</td>";
      Print "<td><input type='text' name='cp' value=$cp></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>ville</td>";
      Print "<td><input type='text' name='ville' value=$ville></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>Tel</td>";
      Print "<td><input type='text' name='tel' value=$tel></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>horaire</td>";
      Print "<td><input type='text' name='horaire' value=$horaire></td>";
      Print "</tr>";
      Print "<tr>";
      print "<td align='right'>lienmap</td>";
      Print "<td><input type='text' name='lienmap' value=$lienmap></td>";
      Print "</tr>";
      print "<tr>";
      Print "<td> </td>";
      Print "<td><input type='hidden' name='id' value='$id'><input type='submit' name='op4' value='Modifier' action='annuaire.php?task=8&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'></td>";
      Print "</tr>";
      print "</form>";
      Print "</table>";
      break;

      case 5:

      $id= $_POST['id'];

      $query="DELETE FROM $table WHERE id = '$id'";
      $res=mysql_query($query);
      if ($res)
      {
      print"<center><h4>Entree supprimee</h4></center>";
      }
      else
      {
      print "<center><h4>Erreur</h4></center>";
      }
      break;

      case 6 :

      $nom= $_POST['nom'];
      $sites= $_POST['sites'];
      $services= $_POST['services'];
      $type_structure= $_POST['type_structure'];
      $adresse= $_POST['adresse'];
      $cp= $_POST['cp'];
      $ville= $_POST['ville'];
      $tel= $_POST['tel'];
      $horaire= $_POST['horaire'];
      $lienmap= $_POST['lienmap'];

      $query="INSERT INTO $table VALUES (\"\",\"$nom\",\"$sites\",\"$services\",\"$type_structure\",\"$adresse\",\"$cp\",\"$ville\",\"$tel\",\"$horaire\",\"$lienmap\")";
      $res=mysql_query($query) or die ("erreur");
      if ($res)
      {
      print"<center><h4>Entree ajoutee</h4></center>";
      }
      else
      {
      print"<center><h4>Erreur</h4></center>";
      }
      break;

      case 7 :

      $id= $_POST['id'];
      $nom= $_POST['nom'];
      $sites= $_POST['sites'];
      $services= $_POST['services'];
      $type_structure= $_POST['type_structure'];
      $adresse= $_POST['adresse'];
      $cp= $_POST['cp'];
      $ville= $_POST['ville'];
      $tel= $_POST['tel'];
      $horaire= $_POST['horaire'];
      $lienmap= $_POST['lienmap'];

      $query="SELECT * FROM $table WHERE id IS NOT NULL";
      if ($nom)
      {
      $query.=" AND nom LIKE '$nom%'";
      }
      if ($sites)
      {
      $query.=" AND sites LIKE '$sites%'";
      }
      if ($services)
      {
      $query.=" AND services LIKE '$services%'";
      }
      if ($type_structure!='Tous')
      {
      $query.=" AND type_structure LIKE '$type_structure%'";
      }
      else
      {
      $query.=" AND type_structure LIKE '%'";
      }
      if ($adresse)
      {
      $query.=" AND adresse LIKE '$adresse%'";
      }
      if ($cp)
      {
      $query.=" AND cp LIKE '$cp%'";
      }
      if ($ville!='Toutes')
      {
      $query.=" AND ville LIKE '$ville%'";
      }
      else
      {
      $query.=" AND ville LIKE '%'";
      }
      if ($tel)
      {
      $query.=" AND TEL LIKE '%$tel%'";
      }
      if ($horaire)
      {
      $query.=" AND horaire LIKE '$horaire%'";
      }
      if ($lienmap)
      {
      $query.=" AND lienmap LIKE '$lienmap%'";
      }

      $query.=" ORDER BY nom";
      $res=mysql_query($query);
      print "<table width='0%' cellpadding='5' cellspacing='1' border='0' align='center'>";
      print "<td bgcolor='#F9FAFA' align='center'>";
      print "<table width='0%' cellpadding='5' cellspacing='1' border='0' align='center'>";
      print "<tr>";
      // print "<td bgcolor='#CCCCCC' align='center'><b>Id</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>Type de structure</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>Nom</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>Adresse</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>CodePostal</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>Ville</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>Telephone</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>horaire</b></td>";
      print "<td bgcolor='#A5DDDF' align='center'><b>lienmap</b></td>";
      print "<td> </td>";
      print "<td> </td>";
      print "</tr>";

      while($val=mysql_fetch_array($res)or die(mysql_error()))
      {
      $id = $val['id'];
      $nom = $val['nom'];
      $sites = $val['sites'];
      $services = $val['services'];
      $type_structure = $val['type_structure'];
      $adresse = $val['adresse'];
      $cp = $val['cp'];
      $ville = $val['ville'];
      $tel = $val['tel'];
      $horaire = $val['horaire'];
      $lienmap = $val['lienmap'];

      print"<tr>";
      // print "<td bgcolor='#CCCCCC'>$id</td>";
      print "<td bgcolor='#A5DDDF'>$type_structure</td>";
      print "<td bgcolor='#A5DDDF'>$nom</td>";
      print "<td bgcolor='#A5DDDF'>$adresse</td>";
      print "<td bgcolor='#A5DDDF'>$cp</td>";
      print "<td bgcolor='#A5DDDF'>$ville</td>";
      print "<td bgcolor='#A5DDDF'>$tel</td>";
      print "<td bgcolor='#A5DDDF'>$horaire</td>";
      print "<td bgcolor='#A5DDDF'><A HREF='$lienmap'>Google Map<A/></td>";

      // print "<td bgcolor='#CCCCCC'>";
      // print "<A HREF='annuaire.php?task=4&id=$id&nom=$nom&sites=$sites&services=$services&type_structure=$type_structure&adresse=$adresse&cp=$cp&ville=$ville&tel=$tel&horaire=$horaire&lienmap=$lienmap'>modifier</A>";
      // print "</td>";
      // print "<td bgcolor='#CCCCCC'>";
      // print "<A HREF='annuaire.php?task=3&id=$id'>effacer</A>";
      // print "</td>";
      // print "</tr>";
      }
      print"</table>";
      print "</td>";
      print"</table>";

      break;
      case 8 :

      $id= $_POST['id'];
      $nom= $_POST['nom'];
      $sites= $_POST['sites'];
      $services= $_POST['services'];
      $type_structure= $_POST['type_structure'];
      $adresse= $_POST['adresse'];
      $cp= $_POST['cp'];
      $ville= $_POST['ville'];
      $tel= $_POST['tel'];
      $horaire= $_POST['horaire'];
      $lienmap= $_POST['lienmap'];

      $query="UPDATE $table SET nom='$nom', sites='$sites',services='$services',type_structure='type_structure',adresse='$adresse',cp='$cp',ville='$ville',tel='$tel',horaire='$horaire',lienmap='lienmap' WHERE id='$id'";
      $res=mysql_query($query);
      if ($res)
      {
      print"<center><h4>Entree modifiee</h4></center>";
      }
      else
      {
      print"<center><h4>Erreur</h4></center>";
      }
      break;

      }
      mysql_close();
      ?>
      </div>
      </font></body></html>
      0