Guest User

Untitled

a guest
Jan 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.46 KB | None | 0 0
  1. <!-- Form pour les informations sur la licence-->
  2.     <form method="post" action="">
  3.         <table>
  4.         <tr>
  5.             <td>Type</td>
  6.             <td><input type=text name="type"></td>
  7.         </tr>
  8.         <tr>
  9.             <td>Mention</td>
  10.             <td>
  11.                             <select name="mention">
  12.                                 <?php
  13.                                         //Récupération des données de la table domaines
  14.                                     $query_dm = "select * from domaines";
  15.                                     $exec_dm = pg_query($db_bobo, $query_dm);
  16.  
  17.                                     while ($data = pg_fetch_object($exec_dm))
  18.                                     {
  19.                                             $codeDomaine = $data->code;
  20.                                             $libelleDomaine = $date->libelle;
  21.  
  22.                                             echo "<optgroup label='$libelleDomaine'>";
  23.                                             //Récupération des donées de la table mentions
  24.                                             $query_mt = "select * from mentions where code_domaine = '$codeDomaine'";
  25.                                             $exec_mt = pg_query($db_bobo, $query_mt);
  26.                                             $n_mt = pg_num_rows($exec_mt);
  27.                                             if($n_mt > 0)
  28.                                             {
  29.                                                     while ($data = pg_fetch_object($exec_mt))
  30.                                                     {
  31.                                                             $idMention = $data->id;
  32.                                                             $libelleMention = $data->libelle;
  33.  
  34.                                                             echo "<option value='mention'>$libelleMention</option>";
  35.                                                     }
  36.                                             }
  37.                                             echo "</optgroup>";
  38.                                     }
  39.                                     echo "</select></td></tr>";
  40.  
  41.                                     if($typeLicence == "professionnelle")
  42.                                     {
  43.                                             echo "<tr><td>Spécialité</td>
  44.                                                            <td><input type=text name='spécialite'></td></tr>";
  45.                                     }
  46.                                 ?>
  47.         </form>
Add Comment
Please, Sign In to add comment