IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

zone deroulante stressante


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre à l'essai
    Inscrit en
    Septembre 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 5
    Par défaut zone deroulante stressante
    bonjour,
    quelqu'un peut m'aider a résoudre ce problème?
    lorsque je fais une zone de liste deroulante dans ma page et j'allimente cette zone par une requete sur un champ de la BDD(boucle For),tous les autres contrôles et les div
    qui sont au dessous de la zone déroulante ne s'affichent pas!!!!!!!!!!!!
    après j'ai pu constaté que si je fais un break de la boucle for, l'affichage serait normale mais la zone n'affiche que le premier enregistrement du champ
    donc c'est la boucle qui empeche l'affichage de la zone
    aidez moi svp parceque vraiment je suis bloqué et merci d'avance
    cordialement

  2. #2
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 506
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 506
    Par défaut
    Bonjour,

    Un tout petit peu de code, nous aiderais beaucoup.

  3. #3
    Membre à l'essai
    Inscrit en
    Septembre 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 5
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    <?php
    require('connexion.php');
    session_start();//on demarre la session
    ?>
    <!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 name="Description" content="IDERGANE" />
    <meta name="Keywords" content="your, keywords" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="Distribution" content="Global" />
    <meta name="Author" content="mmm@gmail.com" />
    <meta name="Robots" content="index,follow" />
    <link href="cons.css" rel="stylesheet" type="text/css" />
    <title>application</title>
    </head>
    <body>
    <?php if(isset($_SESSION['Nom'])){ ?>
    <div id="page">
    	<div id="entete">
        			<div  id="logo-text">Bienvenue <?php echo "".$_SESSION['Nom']." ".$_SESSION['Prenom']; ?></div>
    		      <div id="slogan"><a href="deconnexion.php">Se deconnecter</a></div>	
    	</div>
     
    	<div id="espace1"></div>
    	<div id="corps">
            	<div id="nav">
     
                            <ul id="menu">
                                 <li id="current"><a href="acceuil.php">Acceuil</a></li>
                                <li><a href="facturation.php">Facturation</a></li>
                                <li><a href="action.php">Enregistrer action </a></li>
                                <li><a href="pv.php">Enregistrer PV</a></li>			
                                <li><a href="cons.php">Consultation</a></li>
                                <li><a href="administartion.php">Administration</a></li>	
                            </ul>
     
     
    		</div>
         		<div id="main">
     
    			<fieldset id="field">
    			<legend>CONSULTATION</legend>
    			<form class="form_action" method="post" action="inventaire.php">
    			<table>
    			<tr>
    									<td 	align="right">
    									<label>Recherche Par Detenteur</label>
    									</td>
    									<td align="left">
    				 						<select name="detenteur">
    											<option value="Tous">Tous</option>
    						<?php
    						$req = mysql_query('SELECT * FROM service ORDER BY libelle') or die(mysql_error());
    						while ($donnees = mysql_fetch_array($req))
    						{
    						?>
    											<option value="<?php echo $donnees['Service_Id'] ?>"><?php echo $donnees['libelle'] ?></option>
    						<?php
    						}
    						?>
    				 						</select>
    								  </td>
    				   					<td align="left">
    				 						<input type="submit" value="Chercher" /><br />
    									</td>
    									<td align="left">
    				 						<a href="generation.php?generer=1">Exporter les donnees en Excel</a>
    									</td>
    								</tr>
    				</table>		
    				</form>
     
    			<table border="0" cellpadding="3" cellspacing="" >
    				<tr>
    					<th width="80px">PNNL</th>
    					<th width="80px">SNNL</th>
    					<th width="80px">NININ</th>
    					<th width="80px">DESIGNATION</th>
    					<th width="80px">PV</th>
    					<th width="80px">CAT</th>
    					<th width="80px">PU</th>
    					<th width="80px">ACTION</th>
    					<th width="80px">ANNEE</th>
    				</tr>
    				<?php 
    				$_SESSION['detenteur']=$_POST['detenteur'];
    				$req2=mysql_query("SELECT * FROM materiel INNER JOIN  mat_sn ON materiel.ACTION=mat_sn.mat_PN WHERE  
    				mat_sn.Service_Id ='".$_POST['detenteur']."' ORDER BY ACTION")or die(mysql_error());
    				while($don1=mysql_fetch_array($req2) or die(mysql_error()))
    				{
    				?>
    				<tr>
    					<td><?php echo $don1['PNNL'] ?></td>
    					<td><?php echo $don1['SNNL'] ?></td>
    					<td ><?php echo $don1['NININ']  ?></td>
    					<td ><?php echo $don1['Designation']  ?></td>
    					<td ><?php echo $don1['PV'] ?></td>
    					<td><?php echo $don1['CAT']?></td>
    					<td><?php echo $don1['PU'] ?></td>
    					<td><?php echo $don1['ACTION'] ?></td>
    					<td><?php echo $don1['ANNEE'] ?></td>
    				</tr>
    				<?php 
    				}
    				?>
    				</table>
     
    			</fieldset>
          </div>
    	  <?php
    	  } 
    	  else
    	  { 
    	  require('deconnexion.php');
    	  }
    	  ?>
    	</div>
    	<div id="espace2"></div>
    	<div id="pied">
     
            	<center>
                &copy; 2011<strong>triami conception</strong> | 
    			<a href="mailto:
    			">Design by: N.IDENE </a>
     
       		    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     
    			<a href="index.php">Home</a>&nbsp;|&nbsp;</a>
       		    <a href="contact.php">Contact</a>
                </center>
     
          </div>
    </div>
    </html>

  4. #4
    Membre à l'essai
    Inscrit en
    Septembre 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 5
    Par défaut
    je vois pas par exemple la partie pied de page
    toute la div id="pied" est n''est plus affiché

  5. #5
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 506
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 506
    Par défaut
    J'ai modifier comme ceci, mais ton else est pour moi mal placé, parce que si tu ne rentre pas dans le if, tu affiches juste le pied de page, avec une div de trop

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
     
    <?php
    require('connexion.php');
    session_start(); //on demarre la session
    ?>
    <!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 name="Description" content="IDERGANE"/>
        <meta name="Keywords" content="your, keywords"/>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        <meta name="Distribution" content="Global"/>
        <meta name="Author" content="mmm@gmail.com"/>
        <meta name="Robots" content="index,follow"/>
        <link href="cons.css" rel="stylesheet" type="text/css"/>
        <title>application</title>
    </head>
    <body>
    <?php if(isset($_SESSION['Nom'])) : ?>
    <div id="page">
    	<div id="entete">
            <div id="logo-text">Bienvenue <?php echo "" . $_SESSION['Nom'] . " " . $_SESSION['Prenom']; ?></div>
            <div id="slogan"><a href="deconnexion.php">Se deconnecter</a></div>
        </div>
     
        <div id="espace1"></div>
    	<div id="corps">
            	<div id="nav">
     
                    <ul id="menu">
                        <li id="current"><a href="acceuil.php">Acceuil</a></li>
                        <li><a href="facturation.php">Facturation</a></li>
                        <li><a href="action.php">Enregistrer action </a></li>
                        <li><a href="pv.php">Enregistrer PV</a></li>
                        <li><a href="cons.php">Consultation</a></li>
                        <li><a href="administartion.php">Administration</a></li>
                    </ul>
     
     
                </div>
        <div id="main">
     
            <fieldset id="field">
                <legend>CONSULTATION</legend>
                <form class="form_action" method="post" action="inventaire.php">
                    <table>
                        <tr>
                            <td align="right">
                                <label>Recherche Par Detenteur</label>
                            </td>
                            <td align="left">
                                <select name="detenteur">
                                    <option value="Tous">Tous</option>
                                    <?php
                                    $req = mysql_query('SELECT * FROM service ORDER BY libelle') or die(mysql_error());
                                    while ($donnees = mysql_fetch_array($req)): ?>
                                        <option
                                            value="<?php echo $donnees['Service_Id'] ?>"><?php echo $donnees['libelle'] ?></option>
                                        <?php endwhile; ?>
                                </select>
                            </td>
                            <td align="left">
                                <input type="submit" value="Chercher"/><br/>
                            </td>
                            <td align="left">
                                <a href="generation.php?generer=1">Exporter les donnees en Excel</a>
                            </td>
                        </tr>
                    </table>
                </form>
     
                <table border="0" cellpadding="3" cellspacing="">
                    <tr>
                        <th width="80px">PNNL</th>
                        <th width="80px">SNNL</th>
                        <th width="80px">NININ</th>
                        <th width="80px">DESIGNATION</th>
                        <th width="80px">PV</th>
                        <th width="80px">CAT</th>
                        <th width="80px">PU</th>
                        <th width="80px">ACTION</th>
                        <th width="80px">ANNEE</th>
                    </tr>
                    <?php
                    $_SESSION['detenteur'] = $_POST['detenteur'];
                    $req2 = mysql_query("SELECT * FROM materiel INNER JOIN  mat_sn ON materiel.ACTION=mat_sn.mat_PN WHERE
    				mat_sn.Service_Id ='" . $_POST['detenteur'] . "' ORDER BY ACTION")or die(mysql_error());
                    while ($don1 = mysql_fetch_array($req2) or die(mysql_error())):?>
                        <tr>
                            <td><?php echo $don1['PNNL'] ?></td>
                            <td><?php echo $don1['SNNL'] ?></td>
                            <td><?php echo $don1['NININ']  ?></td>
                            <td><?php echo $don1['Designation']  ?></td>
                            <td><?php echo $don1['PV'] ?></td>
                            <td><?php echo $don1['CAT']?></td>
                            <td><?php echo $don1['PU'] ?></td>
                            <td><?php echo $don1['ACTION'] ?></td>
                            <td><?php echo $don1['ANNEE'] ?></td>
                        </tr>
                        <?php endwhile; ?>
                </table>
     
            </fieldset>
        </div>
        <?php else : require('deconnexion.php'); endif; ?>
    </div>
        <div id="espace2"></div>
        <div id="pied">
     
            <center>
                &copy; 2011<strong>triami conception</strong> |
                <a href="mailto:
    			">Design by: N.IDENE </a>
     
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     
                <a href="index.php">Home</a>&nbsp;|&nbsp;</a>
                <a href="contact.php">Contact</a>
            </center>
     
        </div>
    </div>
    </html>

  6. #6
    Membre à l'essai
    Inscrit en
    Septembre 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 5
    Par défaut
    bonjour,
    merci pour votre attention,la solution n'a pas marché
    j'ai essayé de simplifier le code un peu
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?php
    require('connexion.php');
    session_start(); //on demarre la session
    ?>
    <!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 href="style.css" rel="stylesheet" type="text/css"/>
    <title>Document sans nom</title>
    </head>
     
    <body>
    <div id="page">
      <div id="entete"></div>
      <div id="main">
      		<form class="form_MO2" method="post" action="test.php">
    			<table>
    			<tr>
                            <td align="right">
                                <label>Recherche Par Detenteur</label>
                            </td>
                            <td align="left">
                                <select name="detenteur">
                                    <option value="Tous">Tous</option>
                                    <?php
                                    $req = mysql_query('SELECT * FROM service ORDER BY libelle') or die(mysql_error());
                                    while ($donnees = mysql_fetch_array($req)){?>
                                        <option value="<?php echo $donnees['Service_Id'] ?>"><?php echo $donnees['libelle'] ?></option>      
                                <?php } ?>
    							</select>
                            </td>
                            <td align="left">
                                <input type="submit" value="Chercher"/><br/>
                            </td>
                            <td align="left">
                                <a href="generation.php?generer=1">Exporter les donnees en Excel</a>
                            </td>
                        </tr>
    					<table border="0" cellpadding="3" cellspacing="">
    				<?php $_SESSION['detenteur'] = $_POST['detenteur'];
                    $req2 = mysql_query("SELECT * FROM materiel INNER JOIN  mat_sn ON materiel.PN=mat_sn.mat_PN WHERE  
    				mat_sn.Service_Id ='".$_POST['detenteur']."' ORDER BY PN")or die(mysql_error());
    				?>
                    <tr>
                        <th width="80px">PN</th>
    					<th width="80px">SN</th>
    					<th width="80px">NIIN</th>
    					<th width="80px">DESIGNATION</th>
    					<th width="80px">PV ou OA</th>
    					<th width="80px">CAT</th>
    					<th width="80px">PU</th>
    					<th width="80px">MO</th>
    					<th width="80px">ANNEE</th>
                    </tr>
                    <?php
                    while ($don1 = mysql_fetch_array($req2) or die(mysql_error())){
    				?>
                        <tr>
                        <td><?php echo $don1['PN'] ?></td>
    					<td><?php echo $don1['SN'] ?></td>
    					<td ><?php echo $don1['NIIN']  ?></td>
    					<td ><?php echo $don1['Designation']  ?></td>
    					<td ><?php echo $don1['PVN ou TO'] ?></td>
    					<td><?php echo $don1['CAT']?></td>
    					<td><?php echo $don1['PU'] ?></td>
    					<td><?php echo $don1['MON'] ?></td>
    					<td><?php echo $don1['ANNEE'] ;}?></td>
                        </tr>
     
                </table>
                    </table>
        </form>
     
    	</div>
      <div id="pied"><center><b>c Placez ici le contenu de  id "pied"</b></center></div>
    </div>
    </body>
    </html>
    donc ic j'arrive pas a afficher la div pied
    cordialement

  7. #7
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    99
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 99
    Par défaut
    Salut,

    j'ai testé ton code sur mon poste, et également la div ne s'affichait pas.
    Cela venait des " or die(mysql_error())".

    Je te propose de :
    1 - de les enlever
    2 - à la place de tester ton retour mysql pour mettre des messages d'erreurs personnalisés.

    En effet, je pense que l'une de tes requête échoue et donc arrête le script (directive die()).

    J'espère que cela t'aidera.

Discussions similaires

  1. Ajoute Tous dans un zone deroulante
    Par karwafmhz dans le forum Requêtes et SQL.
    Réponses: 6
    Dernier message: 21/06/2013, 19h07
  2. Comment Enregistrer plusieurschamps Zone deroulante
    Par CLASSIQUE dans le forum IHM
    Réponses: 1
    Dernier message: 16/12/2011, 09h29
  3. mettre une valeur nulle ds une zone deroulante
    Par gohu13 dans le forum Access
    Réponses: 2
    Dernier message: 14/10/2005, 15h38
  4. modification contenu zone de liste deroulante
    Par Tierisa dans le forum Access
    Réponses: 12
    Dernier message: 23/09/2005, 00h06
  5. Liste deroulante avec Zone de texte associée
    Par ahage4x4 dans le forum ASP
    Réponses: 7
    Dernier message: 26/05/2005, 12h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo