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 :

[Dates] Bouton déroulant


Sujet :

Langage PHP

  1. #1
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    818
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Drôme (Rhône Alpes)

    Informations forums :
    Inscription : Avril 2005
    Messages : 818
    Par défaut [Dates] Bouton déroulant
    Bonjour,

    Je souhaite utiliser un bouton pour dérouler une liste. Pour être plus précis, le clique sur le bouton provoque le déroulement d'une liste et lorsque l'on reclique, je voudrais que ce qui vient de se dérouler retourne en position initiale.

    Voici à quoi ressemble le tableau qui s'affiche(les rond dans action correspondent au bouton dont je parle)

    Etat initial:

    Num commande | Date | Etat | Action
    ----------------------------------------------------------
    0254464 01/02/2006 En Attente O
    0265656 02/02/2006 Expédiée O


    Etat une fois que l'on clique sur le bouton:

    Num commande | Date | Etat | Action
    ----------------------------------------------------------
    0254464 01/02/2006 En Attente O
    Reference | Produit | Prix unitaire | Qté | Montant
    456554 veste 50 1 50
    458554 pantalon 60 2 120

    0265656 02/02/2006 Expédiée O


    Je ne sais pas si j'ai réussi à me faire comprendre, mais je voudrais savoir quel type de bouton permet de faire ce genre de chose. Autrement dis, je voudrais que mon bouton est un peu la meme fonction que le + dans l'explorateur de windows...

    Merci d'avance de votre aide.

  2. #2
    Membre émérite
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    774
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Canada

    Informations forums :
    Inscription : Juillet 2005
    Messages : 774
    Par défaut
    un bouton de type button pourra certainement faire l'affaire. en ce momeent je te conseil d'utiliser du Javascript car ce sera bcp plus rapide.
    si tu veux utiliser du php, utilise un bouton de type submit

  3. #3
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    818
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Drôme (Rhône Alpes)

    Informations forums :
    Inscription : Avril 2005
    Messages : 818
    Par défaut
    A vrai dire, je ne sais pas trop comment m'y prendre pour remplir le champ onclick...

    Je pensais utiliser:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    <tr class=Style2 bgcolor=#<? if ($i % 2 == 0) echo "FFFFFF"; else echo "F6F6F6"; ?>>
    		<td width=180><? echo"$commande"; ?></td>
    		<td width=180><? echo"$date"; ?></td>
            <td width=180><? echo"$statut"; ?></td>
    		<td width=50>
              <input type="radio" onClick=....>
            </tr>
    Mais je ne sais pas trop comment m'y prendre pour que le fait de cliquer m'affiche le résultat de la requête...

  4. #4
    Membre émérite
    Profil pro
    Inscrit en
    Juillet 2005
    Messages
    774
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Canada

    Informations forums :
    Inscription : Juillet 2005
    Messages : 774
    Par défaut
    si tu veux qe lorsqu'on click la requete soit executé, tes element s doivent etre dans un formulaire. et le click sur le bouton declenche l'envoie de ton formulaire. en ce moment a l'aide des variable $_GET et $_POST tu recupere les valeurs envoyées par ton formulaire pour effectuer ta requete. ....peut etre q j'ai pas bien compris?

  5. #5
    Membre Expert

    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 278
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 278
    Par défaut
    Tu envoies toutes tes données. Mais tu mets chaque sous-partie dans un div avec un id différent et la propriété css display: none;
    Puis tu utilises onclick pour afficher/cacher le sous-menu.

    Exemple : le html :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <p>Mon texte affiché <button type="button" onclick="afficher_cacher(texte_cache_1);" /></p>
    <div id="texte_cache_1" class="cache"><p>Mon texte caché</p></div>
    Le css :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    .cache {display: none;}
    Le javascript :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <script type="text/javascript">
    <!--
    function afficher_cacher(id) {
    	if (document.getElementById(id).style.display=='block')
    		{document.getElementById(id).style.display='none';
    		}
    		else
    			{document.getElementById(id).style.display='block';
    			}
    	}
    //-->
    </script>

  6. #6
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    818
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Drôme (Rhône Alpes)

    Informations forums :
    Inscription : Avril 2005
    Messages : 818
    Par défaut
    Merci de ta réponse vg33 mais ca ne marche pas. Quand je clique sur le bouton, rien ne se passe...

    voici le code source:
    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
    $requete2=mysql_db_query("$sql_bdd","select * from orders where client = $idc order by commande DESC limit $debut,$limit",$db_link);
    $num2=mysql_num_rows($requete2);
     
    // DEFINITION DU MESSAGE A AFFICHER
    if ($num2==0) {echo " Aucune commande trouvée."; exit;}
    else if ($mot=="") 	{echo " Données manquantes. Impossible d'exploiter la base."; exit;}
    else if (strlen($mot)<2) {echo " Données insuffisantes pour exploiter la base."; exit;}
     
    // AFFICHAGE DES RESULTATS
    else {
     
    echo " <b>$nb_total2</b> résultat"; if ($nb_total>1) {echo "s";} echo" trouvé"; if ($nb_total>1) {echo "s";}
    // echo "<br>$texte";
     
    $i=0;
    while($i<$num2)
    	{
    	$commande=mysql_result($requete2,$i,"commande");
    	$client=mysql_result($requete2,$i,"client");
    	$date=mysql_result($requete2,$i,"date");
    	$adrliv=mysql_result($requete2,$i,"adrliv");
    	$adrfac=mysql_result($requete2,$i,"adrfac");
    	$regmod=mysql_result($requete2,$i,"regmod");
    	$regdetails=mysql_result($requete2,$i,"regdetails");
    	$statut=mysql_result($requete2,$i,"statut");
    	$plus=mysql_result($requete2,$i,"plus");	
     
    	?>
            <tr class=Style2 bgcolor=#<? if ($i % 2 == 0) echo "FFFFFF"; else echo "F6F6F6"; ?>>
    		<td width=180><? echo"$commande"; ?></td>
    		<td width=180><? echo"$date"; ?></td>
            <td width=180><? echo"$statut"; ?></td>
    		<td width=50><p>Mon texte affiche<input type="button" onClick="afficher_cacher(texte_cache_1);"/></p></td>
    		<div id="texte_cache_1" class="cache"><p>Mon texte caché</p></div>
            </tr>
    	<?
     
    	$i++;
    	}
    Dans le champs Action du tableau, il s'affiche:
    "Mon texte affiche"
    et le bouton.
    Mais lorsque l'on clique sur ce dernier, rien ne se passe...

    Je ne vois pas ce qui ne va pas merci de m'aider...

  7. #7
    Membre Expert

    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 278
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 278
    Par défaut
    Peux-tu poster la source html produite (intégralement, y compris le <head>) ?

  8. #8
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    818
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Drôme (Rhône Alpes)

    Informations forums :
    Inscription : Avril 2005
    Messages : 818
    Par défaut
    Voici la source intégrale:
    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
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
     
    <style type="text/css">
    <!--
    .Style2 {
    	font-family: Geneva, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    }
    .Style4 {font-size: 10px}
    .Style7 {color: #666666}
    .Style9 {font-size: 12px; color: #000000; }
    .Style10 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; }
    .cache {display: none;}
    -->
    </style>
     
    <script type="text/javascript">
    <!--
    function afficher_cacher(id) {
       if (document.getElementById(id).style.display=='block')
          {document.getElementById(id).style.display='none';
          }
          else
             {document.getElementById(id).style.display='block';
             }
       }
     
    //-->
    </script>
     
    <br> 
    <span class="Style2">Urbanshot Back2office&trade; v1.0<br>
    <span class="Style4">gestion client<br>
    <br></span></span>
    <span class="Style2">
    <form name="goCustomer<? echo"$i"; ?>" action="" enctype="multipart/form-data" method="post">
    <?
     
    $limit=20;
    $et_ou="or";
    $mot=client;
     
    /******************************************************************
    *	PROGRAMME PRINCIPAL
    ******************************************************************/
     
    $db_link = mysql_connect("$sql_serveur","$sql_user","$sql_passwd");
     
    $mot=strtolower($mot);
    $mots=split(" ",$mot);
    $nombre_mots=count($mots);
     
    $z=1;
    $texte="Pages contenant <b>&quot;$mots[0]&quot;</b>";
    $phrase="'%$mots[0]%'";
    while($z<$nombre_mots)
    	{
    	$phrase.=" ".$et_ou." mots like '%$mots[$z]%'";
    	$texte.=" ";
    	if($et_ou=="and"){$texte.="et";}else{$texte.="ou";}
    	$texte.=" <b>&quot;$mots[$z]&quot;</b>";
    	$z++;
    	}
     
    if($debut==""){$debut=0;}
    $debut=$pages*$limit;
     
    // NOMBRE TOTAL D'ENREGISTREMENTS REPONDANT A LA REQUETE
    $requete=mysql_db_query("$sql_bdd","select count(*) from clients where id = $customer",$db_link);
    $nb_total=mysql_result($requete,0,"count(*)");
     
    $requete=mysql_db_query("$sql_bdd","select * from clients where id = $customer limit $debut,$limit",$db_link);
    $num=mysql_num_rows($requete);
     
    // DEFINITION DU MESSAGE A AFFICHER
    if ($num==0) {echo "<br>Aucun client trouvé."; exit;}
    else if ($mot=="") 	{echo "Données manquantes. Impossible d'exploiter la base.";}
    else if (strlen($mot)<2) {echo "Données insuffisantes pour exploiter la base.";}
     
    // AFFICHAGE DES RESULTATS
    else {
     
    echo "<br><b>$nb_total</b> client"; if ($nb_total>1) {echo "s";} echo" trouvé"; if ($nb_total>1) {echo "s";} echo" dans la base de données.<br><br>";
    // echo "<br>$texte";
     
    $i=0;
    while($i<$num)
    	{ 
    	$idc=mysql_result($requete,$i,"id");
    	$nom=mysql_result($requete,$i,"nom");
    	$prenom=mysql_result($requete,$i,"prenom");
    	$societe=mysql_result($requete,$i,"societe");
    	$adresse=mysql_result($requete,$i,"adresse");
    	$cp=mysql_result($requete,$i,"cp");
    	$ville=mysql_result($requete,$i,"ville");
    	$club=mysql_result($requete,$i,"club");
    	$reference=mysql_result($requete,$i,"reference");
    	$tel=mysql_result($requete,$i,"tel");
    	$mail=mysql_result($requete,$i,"mail");
    	$methode=mysql_result($requete,$i,"methode");
    	$carte=mysql_result($requete,$i,"carte");
    	$passe=mysql_result($requete,$i,"passe");
    	$reduc=mysql_result($requete,$i,"reduc");
    	$laposte=mysql_result($requete,$i,"laposte");
    	$notes=mysql_result($requete,$i,"notes");
    	?>
     
      <? $i++;
    	}
     
    echo "<tr><table border=0><tr class=Style2>";
     
    // AFFICHAGE DU LIEN PRECEDENT SI BESOIN EST
    // (LA PREMIERE PAGES EST 0)
    if ($pages>0)
    	{
    	$precedent=$pages-1;
    	echo"<td width=\"50\"><form name=\"previousPage\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<a href=\"javascript:previousPage.submit()\">PRECEDENT</a>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"3\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"3\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$precedent\">
        </form></td>";
    	}
     
     
    // AFFICHAGE DES NUMEROS DE PAGE
    $i=0;$j=1;
    if($nb_total>$limit)
    	{
    	while($i<($nb_total/$limit))
    		{
    		if($i!=$pages){echo "<td width=\"20\"><form name=\"goToPage$j\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	(<a href=\"javascript:goToPage$j.submit()\">$j</a>)
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"3\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"3\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$i\">
        </form></td>";}
    		else {echo "<td width=\"20\"><form name=\"goToPage$j\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<b>(<a>$j</a>)</b>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"3\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"3\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$i\">
        </form></td>";}
    		$i++;$j++;
    		}
    	}
     
     
    // AFFICHAGE DU LIEN SUIVANT SI BESOIN EST
    if($debut+$limit<$nb_total)
    	{
    	$suivant=$pages+1;
    	echo"<td width=\"50\"><form name=\"nextPage\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<a href=\"javascript:nextPage.submit()\">SUIVANT</a>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"3\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"3\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$suivant\">
        </form></td>";
    	}
    }
     
    // DECONNEXION DE LA BASE DE DONNEE
    mysql_close($db_link);
     
    ?>
    <span class="Style2">
      <table width="770" border="0">
        <tr>
          <td width="171"><div align="right" class="Style10">customer ID</div></td>
          <td class="Style2"><span class="Style9"><? echo"$idc"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">nom      </div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$nom"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">pr&eacute;nom</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$prenom"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">soci&eacute;t&eacute;</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$societe"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">adresse</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$adresse"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">code postal </div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$cp"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">ville</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$ville"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">club</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$club"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">r&eacute;f&eacute;rence</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$reference"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">t&eacute;l&eacute;phone</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$tel"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">mail</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$mail"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">adh&eacute;sion carte (&euro;) </div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$carte"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">r&eacute;duction prochain achat (%) </div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$reduc"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">Laposte inet </div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$laposte"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">Notes</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"$notes"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">mot de passe</div></td>
          <td width="589" class="Style2"><span class="Style9"><? echo"****"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style7"><span class="Style2">methode pr&eacute;f&eacute;r&eacute;e</span></div></td>
          <td class="Style2"><span class="Style9"><? echo"$methode"; ?></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right"><br>
                <span class="Style2">
              <input name="idc" type="hidden" id="idc" value="<? echo"$idc"; ?>">
              <input name="cat" type="hidden" id="cat" value="3">
              <input name="q" type="hidden" id="q" value="33">
              <input name="imageField" type="image" src="img/modifier.gif" width="80" height="25" border="0">
              </span></div></td>
          <td width="589" class="Style2">&nbsp;</td>
        </tr>
      </table>
    </form>
     
     
     
     
     
     
    <br>
     
    <span class="Style2">
    <table width="770" border="0">
      <tr class="Style2" bgcolor=#DEDEDE>
        <td width="180">N&deg; de la commande </td>
    	<td width="180">Date</td>
        <td width="180">&Eacute;tat</td>
        <td width="50">Action</td>
      </tr>
    <?
     
    $limit=20;
    $et_ou="or";
    $mot=client;
     
    /******************************************************************
    *	PROGRAMME PRINCIPAL
    ******************************************************************/
     
    $db_link = mysql_connect("$sql_serveur","$sql_user","$sql_passwd");
     
    $mot=strtolower($mot);
    $mots=split(" ",$mot);
    $nombre_mots=count($mots);
     
    $z=1;
    $texte="Pages contenant <b>&quot;$mots[0]&quot;</b>";
    $phrase="'%$mots[0]%'";
    while($z<$nombre_mots)
    	{
    	$phrase.=" ".$et_ou." mots like '%$mots[$z]%'";
    	$texte.=" ";
    	if($et_ou=="and"){$texte.="et";}else{$texte.="ou";}
    	$texte.=" <b>&quot;$mots[$z]&quot;</b>";
    	$z++;
    	}
     
    if($debut==""){$debut=0;}
    $debut=$pages*$limit;
     
    // NOMBRE TOTAL D'ENREGISTREMENTS REPONDANT A LA REQUETE
    $requete2=mysql_db_query("$sql_bdd","select count(*) from orders where client = $idc order by commande DESC",$db_link);
    $nb_total2=mysql_result($requete2,0,"count(*)");
     
    $requete2=mysql_db_query("$sql_bdd","select * from orders where client = $idc order by commande DESC limit $debut,$limit",$db_link);
    $num2=mysql_num_rows($requete2);
     
    // DEFINITION DU MESSAGE A AFFICHER
    if ($num2==0) {echo " Aucune commande trouvée."; exit;}
    else if ($mot=="") 	{echo " Données manquantes. Impossible d'exploiter la base."; exit;}
    else if (strlen($mot)<2) {echo " Données insuffisantes pour exploiter la base."; exit;}
     
    // AFFICHAGE DES RESULTATS
    else {
     
    echo " <b>$nb_total2</b> résultat"; if ($nb_total>1) {echo "s";} echo" trouvé"; if ($nb_total>1) {echo "s";}
    // echo "<br>$texte";
     
    $i=0;
    while($i<$num2)
    	{
    	$commande=mysql_result($requete2,$i,"commande");
    	$client=mysql_result($requete2,$i,"client");
    	$date=mysql_result($requete2,$i,"date");
    	$adrliv=mysql_result($requete2,$i,"adrliv");
    	$adrfac=mysql_result($requete2,$i,"adrfac");
    	$regmod=mysql_result($requete2,$i,"regmod");
    	$regdetails=mysql_result($requete2,$i,"regdetails");
    	$statut=mysql_result($requete2,$i,"statut");
    	$plus=mysql_result($requete2,$i,"plus");	
     
    	?>
            <tr class=Style2 bgcolor=#<? if ($i % 2 == 0) echo "FFFFFF"; else echo "F6F6F6"; ?>>
    		<td width=180><? echo"$commande"; ?></td>
    		<td width=180><? echo"$date"; ?></td>
            <td width=180><? echo"$statut"; ?></td>
    		<td width=50><input type="radio" onClick="MM_goToURL('parent','./?cat=2&q=22&commande=<? echo"$commande"; ?>');return document.MM_returnValue" name="commande" value="<? echo"$commande"; ?>"></td>
            </tr>
    	<?
     
    	$i++;
    	}
     
    echo "<table><tr class=Style2>";
     
    echo"<td width=\"5\"><form name=\"previousPage\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<a href=\"javascript:previousPage.submit()\"></a>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"2\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"2\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$precedent\">
        </form></td>";
     
     
    // AFFICHAGE DU LIEN PRECEDENT SI BESOIN EST
    // (LA PREMIERE PAGES EST 0)
    if ($pages>0)
    	{
    	$precedent=$pages-1;
    	echo"<td width=\"50\"><form name=\"previousPage\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<a href=\"javascript:previousPage.submit()\">PRECEDENT</a>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"2\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"2\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$precedent\">
        </form></td>";
    	}
     
     
     
    // AFFICHAGE DES NUMEROS DE PAGE
    $i=0;$j=1;
    if($nb_total>$limit)
    	{
    	while($i<($nb_total/$limit))
    		{
    		if($i!=$pages){echo "<td width=\"20\"><form name=\"goToPage$j\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	(<a href=\"javascript:goToPage$j.submit()\">$j</a>)
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"2\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"2\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$i\">
        </form></td>";}
    		else {echo "<td width=\"20\"><form name=\"goToPage$j\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<b>(<a>$j</a>)</b>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"2\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"2\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$i\">
        </form></td>";}
    		$i++;$j++;
    		}
    	}
     
     
    // AFFICHAGE DU LIEN SUIVANT SI BESOIN EST
    if($debut+$limit<$nb_total)
    	{
    	$suivant=$pages+1;
    	echo"<td width=\"50\"><form name=\"nextPage\" action=\"\" enctype=\"multipart/form-data\" method=\"post\">
    	<a href=\"javascript:nextPage.submit()\">SUIVANT</a>
        <input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"2\">
    	<input name=\"q\" type=\"hidden\" id=\"q\" value=\"2\">
    	<input name=\"pages\" type=\"hidden\" id=\"pages\" value=\"$suivant\">
        </form></td>";
    	}
    }
     
    echo"</tr></table>";
     
    // DECONNEXION DE LA BASE DE DONNEE
    mysql_close($db_link);
     
    ?></table>
    <table width="770" border="0">
      <tr>
        <td></td>
      </tr>
    </table>
    </form>
    </span>

  9. #9
    Membre Expert

    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 278
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 278
    Par défaut
    Non, je te demandais la source html, celle que tu obtiens dans ton navigateur en faisant "Code source de la page" ou "Afficher la source".

  10. #10
    Membre éprouvé
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    818
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Drôme (Rhône Alpes)

    Informations forums :
    Inscription : Avril 2005
    Messages : 818
    Par défaut
    Ah ok désolé...
    Voici:
    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
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
     
     <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    a:link {
    	color: #666666;
    	text-decoration: none;
    }
    a:visited {
    	text-decoration: none;
    	color: #666666;
    }
    a:hover {
    	text-decoration: underline;
    	color: #000000;
    }
    a:active {
    	text-decoration: none;
    	color: #000000;
    }
    -->
    </style></head>
    <body>
    <script type="text/JavaScript">
    <!--
    function MM_goToURL() { //v3.0
      var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }
    //-->
    </script>
    <table width="800"  border="0" align="center">
      <tr>
        <td><img src="img/top1.gif" width="159" height="102"><br>
        <img src="img/top.gif" width="779" height="27"></td>
      </tr>
     
    </table>
    <table width="781" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><form action="" enctype="multipart/form-data" method="post">
    		<input type="image" src="img/menu_acc.gif" width="100" height="25">
            <input name="cat" type="hidden" id="cat" value="1">
    		<input name="q" type="hidden" id="q" value="1">
        	</form>
    	</td>
        <td><form action="" enctype="multipart/form-data" method="post">
     
          	<input type="image" src="img/menu_comm.gif" width="100" height="25">
            <input name="cat" type="hidden" id="cat" value="2">
    		<input name="q" type="hidden" id="q" value="2">
        	</form>
    	</td>
        <td><form action="" enctype="multipart/form-data" method="post">
          	<input type="image" src="img/menu_clien2.gif" width="100" height="25">
            <input name="cat" type="hidden" id="cat" value="3">
    		<input name="q" type="hidden" id="q" value="3">
     
        	</form>
    	</td>
        <td><form action="" enctype="multipart/form-data" method="post">
         	<input type="image" src="img/menu_email.gif" width="100" height="25">
            <input name="cat" type="hidden" id="cat" value="4">
    		<input name="q" type="hidden" id="q" value="4">
        	</form>
    	</td>
        <td><form action="" enctype="multipart/form-data" method="post">
     
            <input name="cat" type="hidden" id="cat" value="5">
    		<input name="q" type="hidden" id="q" value="5">
        	</form>
    	</td>
        <td><form action="" enctype="multipart/form-data" method="post">
            <input name="cat" type="hidden" id="cat" value="6">
    		<input name="q" type="hidden" id="q" value="6">
        	</form>
    	</td>
     
        <td><form action="" enctype="multipart/form-data" method="post">
            <input name="cat" type="hidden" id="cat" value="7">
    		<input name="q" type="hidden" id="q" value="7">
        	</form>
    	</td>
      </tr>
      <tr>
        <td colspan="7"><table width="781" border="0" cellpadding="0" cellspacing="0">
          <tr>
     
            <td width="768">
     
     
     
    		<!--
    		**********
    		DEBUT INCLUDE
    		**********
    		-->
     
     
     
    		<style type="text/css">
    <!--
    .Style2 {
    	font-family: Geneva, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    }
    .Style4 {font-size: 10px}
    .Style7 {color: #666666}
    .Style9 {font-size: 12px; color: #000000; }
    .Style10 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; }
    .cache {display: none;}
    -->
    </style>
     
    <script type="text/javascript">
    <!--
    function afficher_cacher(id) {
    var monElement = document.getElementById(id);
    if(monElement.style.display == 'none')
     monElement.style.display = 'block';
     else
     monElement.style.display = 'none';
    }
     
    //-->
    </script>
     
    <br> 
    <span class="Style2">Urbanshot Back2office&trade; v1.0<br>
    <span class="Style4">gestion client<br>
     
    <br></span></span>
    <span class="Style2">
    <form name="goCustomer" action="" enctype="multipart/form-data" method="post">
    <br><b>1</b> client trouvé dans la base de données.<br><br>
      <tr><table border=0><tr class=Style2><span class="Style2">
      <table width="770" border="0">
        <tr>
          <td width="171"><div align="right" class="Style10">customer ID</div></td>
          <td class="Style2"><span class="Style9">201816</span></td>
     
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">nom      </div></td>
          <td width="589" class="Style2"><span class="Style9">barrere</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">pr&eacute;nom</div></td>
     
          <td width="589" class="Style2"><span class="Style9">maeva</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">soci&eacute;t&eacute;</div></td>
          <td width="589" class="Style2"><span class="Style9"></span></td>
        </tr>
        <tr>
     
          <td width="171"><div align="right" class="Style10">adresse</div></td>
          <td width="589" class="Style2"><span class="Style9">359 chemin de plan sarrain</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">code postal </div></td>
          <td width="589" class="Style2"><span class="Style9">06370</span></td>
        </tr>
     
        <tr>
          <td width="171"><div align="right" class="Style10">ville</div></td>
          <td width="589" class="Style2"><span class="Style9">mouans sartoux</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">club</div></td>
          <td width="589" class="Style2"><span class="Style9">ferme d'anais</span></td>
     
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">r&eacute;f&eacute;rence</div></td>
          <td width="589" class="Style2"><span class="Style9">sur google</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">t&eacute;l&eacute;phone</div></td>
     
          <td width="589" class="Style2"><span class="Style9">0623381484</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">mail</div></td>
          <td width="589" class="Style2"><span class="Style9">maev_06@hotmail.com</span></td>
        </tr>
        <tr>
     
          <td width="171"><div align="right" class="Style10">adh&eacute;sion carte (&euro;) </div></td>
          <td width="589" class="Style2"><span class="Style9">148</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">r&eacute;duction prochain achat (%) </div></td>
          <td width="589" class="Style2"><span class="Style9"></span></td>
     
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">Laposte inet </div></td>
          <td width="589" class="Style2"><span class="Style9"></span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">Notes</div></td>
          <td width="589" class="Style2"><span class="Style9"></span></td>
     
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style10">mot de passe</div></td>
          <td width="589" class="Style2"><span class="Style9">****</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right" class="Style7"><span class="Style2">methode pr&eacute;f&eacute;r&eacute;e</span></div></td>
     
          <td class="Style2"><span class="Style9">Carte Bancaire</span></td>
        </tr>
        <tr>
          <td width="171"><div align="right"><br>
                <span class="Style2">
              <input name="idc" type="hidden" id="idc" value="201816">
              <input name="cat" type="hidden" id="cat" value="3">
              <input name="q" type="hidden" id="q" value="33">
     
              <input name="imageField" type="image" src="img/modifier.gif" width="80" height="25" border="0">
              </span></div></td>
          <td width="589" class="Style2">&nbsp;</td>
        </tr>
      </table>
    </form>
     
     
     
     
     
     
    <br>
     
    <span class="Style2">
    <table width="770" border="0">
      <tr class="Style2" bgcolor=#DEDEDE>
        <td width="180">N&deg; de la commande </td>
    	<td width="180">Date</td>
        <td width="180">&Eacute;tat</td>
     
        <td width="50">Action</td>
      </tr>
     <b>4</b> résultat trouvé        <tr class=Style2 bgcolor=#FFFFFF>
    		<td width=180>105836</td>
    		<td width=180>20060116</td>
            <td width=180>Annulee</td>
     
    		<td width=50><input type="radio" onClick="MM_goToURL('parent','./?cat=2&q=22&commande=105836');return document.MM_returnValue" name="commande" value="105836"></td>
            </tr>
    	        <tr class=Style2 bgcolor=#F6F6F6>
    		<td width=180>105835</td>
    		<td width=180>20060116</td>
            <td width=180>Expediee</td>
    		<td width=50><input type="radio" onClick="MM_goToURL('parent','./?cat=2&q=22&commande=105835');return document.MM_returnValue" name="commande" value="105835"></td>
     
            </tr>
    	        <tr class=Style2 bgcolor=#FFFFFF>
    		<td width=180>105811</td>
    		<td width=180>20060109</td>
            <td width=180>Annulee</td>
    		<td width=50><input type="radio" onClick="MM_goToURL('parent','./?cat=2&q=22&commande=105811');return document.MM_returnValue" name="commande" value="105811"></td>
            </tr>
     
    	        <tr class=Style2 bgcolor=#F6F6F6>
    		<td width=180>105806</td>
    		<td width=180>20060108</td>
            <td width=180>Expediee</td>
    		<td width=50><input type="radio" onClick="MM_goToURL('parent','./?cat=2&q=22&commande=105806');return document.MM_returnValue" name="commande" value="105806"></td>
            </tr>
    	<table><tr class=Style2><td width="5"><form name="previousPage" action="" enctype="multipart/form-data" method="post">
     
    	<a href="javascript:previousPage.submit()"></a>
        <input name="cat" type="hidden" id="cat" value="2">
    	<input name="q" type="hidden" id="q" value="2">
    	<input name="pages" type="hidden" id="pages" value="">
        </form></td></tr></table></table>
    <table width="770" border="0">
      <tr>
        <td></td>
      </tr>
     
    </table>
    </form>
    </span>
     
     
     
     
    		<!--
    		**********
    		FIN INCLUDE
    		**********
    		-->
     
     
    		</td>
            <td width="13">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table>
    </body>
     
    </html>

  11. #11
    Membre Expert

    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 278
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 278
    Par défaut
    Je veux bien t'aider, mais tu n'as ni bouton, ni texte caché, ni l'appel à la fonction dans la source que tu m'as envoyée...

Discussions similaires

  1. Nombre de jours entre 2 dates + liste déroulante
    Par benavril dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 15/05/2009, 09h36
  2. Menu avec boutons déroulants
    Par xanatos dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 16/07/2008, 12h46
  3. [BOUTON] - Boutons déroulants
    Par cicolas dans le forum AWT/Swing
    Réponses: 2
    Dernier message: 21/08/2007, 16h48
  4. [Dates] Liste déroulante date et années bissextiles
    Par Jiraiya42 dans le forum Langage
    Réponses: 7
    Dernier message: 03/07/2007, 00h04
  5. [Dates] chaine déroulante date
    Par kitty2006 dans le forum Langage
    Réponses: 26
    Dernier message: 30/09/2006, 11h00

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