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 :

Ligne en fonction d'un champ


Sujet :

Langage PHP

  1. #1
    Membre actif Avatar de kevinf
    Profil pro
    Développeur informatique
    Inscrit en
    Juin 2005
    Messages
    863
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2005
    Messages : 863
    Points : 225
    Points
    225
    Par défaut Ligne en fonction d'un champ
    Salut,
    j'ai ce code :
    if($rs['bannim']<60)
    $listeconnecte.="
    <tr>

    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"#\" onClick=\"window.open('ecrire.php?pseudo=".$rs[pseudo]."','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=500');return(false)\"><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr>";
    else
    $listeconnecte.="
    <tr>

    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"javascript:alert('$rs[pseudo] a été banni de messagerie')\" ><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr>" ;


    }
    echo"";
    echo "$listeconnecte";
    Ce code m'affiche la premiere $listeconnecte si le champ bannim est inférieur à 60 sinon la deuxième.
    Je voudrais rajouter dans chaque liste une ligne qui s'afficherai seulement si le champ rang est à 100 et deux ligne de plus dans chaque liste si rang est à 150.

    Pouvez vous m'aidez, car je sèche.

    Merci
    KevinF

  2. #2
    Membre actif Avatar de kevinf
    Profil pro
    Développeur informatique
    Inscrit en
    Juin 2005
    Messages
    863
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2005
    Messages : 863
    Points : 225
    Points
    225
    Par défaut
    J'ai trouvé tout seul.
    KevinF

  3. #3
    Membre actif Avatar de kevinf
    Profil pro
    Développeur informatique
    Inscrit en
    Juin 2005
    Messages
    863
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juin 2005
    Messages : 863
    Points : 225
    Points
    225
    Par défaut
    Je réouvre~~

    J'ais fais ce code, mais le problème c'est qu'il affiche selon le pseudo de la personne connecté et moi je voudrais qu'il affiche selon le champ rang du membre qui visionne la page :
    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
    <? session_start(); 
    include("config.php"); 
     include("include/variable.php"); 
     
    include"include/config.php";
    include"include/variable.php";
    $db = mysql_connect($serveur, $login, $password); 
    mysql_select_db($base,$db); 
     
    $req = mysql_query("SELECT *  FROM membres WHERE (UNIX_TIMESTAMP() - online) < 600");
    $result=mysql_query($sql); 
    $rs=mysql_fetch_array($result); 
    $pseudo=$rs["pseudo"]; 
    $xp=$rs["xp"]; 
    $result = mysql_query("SELECT * FROM membres WHERE (UNIX_TIMESTAMP() - online) < 600"); 
    while($rs=mysql_fetch_array($result))
     
     { 
     
    if($rs['bannim']<60 And $rs['rang']>60 && $rs['rang']<110) // non banni modo
     $listeconnecte.=" 
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>";
    else if($rs['bannim']<60 And $rs['rang']>120 ) // non banni admin
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>INFO</font></center></strong></td> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ; 
    else if($rs['bannim']<60) // non banni membres
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ;
    else if($rs['bannim']>60 And $rs['rang']>60 && $rs['rang']<110) // banni modo
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ;
    else if($rs['bannim']>60 And $rs['rang']>120 ) // banni admin
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ; 
    else if($rs['bannim']>60) //  banni membes
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ;
     
    else  // personne
     $listeconnecte.="  
    <center><table class=\"tablo\"  width=\"350\"> 
    <tbody><tr> 
    
    <td class=\"tédé\" ><strong><center><font class='main' color='green'>PSEUDO</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>XP</font></center></strong></td> 
    
    <td class=\"tédé\"><strong><center><font class='main' color='green'>ECRIRE</font></center></strong></td> 
    
    
    </tr>" ;
     
     
     
     
     
     
     
     
     
    if($rs['bannim']<60 And $rs['rang']>60 && $rs['rang']<110) // non banni modo
     $listeconnecte.=" 
    <tr>
    
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"#\" onClick=\"window.open('ecrire.php?pseudo=".$rs[pseudo]."','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=500');return(false)\"><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>";
    else if($rs['bannim']<60 And $rs['rang']>120 ) // non banni admin
     $listeconnecte.="  
    <tr>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"#\" onClick=\"window.open('info.php?email=".$rs[email]."','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=800, height=500');return(false)\"><img src='imagesite/info.jpg' border='0'></a> </font></center></td>
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"#\" onClick=\"window.open('ecrire.php?pseudo=".$rs[pseudo]."','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=500');return(false)\"><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>" ; 
    else if($rs['bannim']<60) //non banni membres
     $listeconnecte.="  
    <tr>
    
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"#\" onClick=\"window.open('ecrire.php?pseudo=".$rs[pseudo]."','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=500');return(false)\"><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>" ;
    else if($rs['bannim']>60 And $rs['rang']>60 && $rs['rang']<110) // banni modo
     $listeconnecte.="  
    <tr> 
    
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"javascript:alert('$rs[pseudo] a été banni de messagerie')\" ><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>" ;
    else if($rs['bannim']>60 And $rs['rang']>120 ) // banni admin
     $listeconnecte.="  
    <tr> 
    
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"javascript:alert('$rs[pseudo] a été banni de messagerie')\" ><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>" ; 
    else if($rs['bannim']>60) // banni membres
     $listeconnecte.="  
    <tr> 
    
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b>$rs[pseudo] </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><font class=\"main\"><b><center>$rs[xp]</center> </b></font></td> 
    <td class=\"tédé\" onMouseOut=\"javascript:this.style.background=''\" onMouseOver=\"javascript:this.style.background='#A9A9A9'\"><center><font class=\"main\"><A HREF=\"javascript:alert('$rs[pseudo] a été banni de messagerie')\" ><img src='imagesite/ecrire.gif' border='0'></a> </font></center></td>
    </tr></tbody> 
    </table></center>" ;
    else // personne
     $listeconnecte.="  
    " ;
     
     }
     echo""; 
    echo "$listeconnecte"; 
    print("
    
    ");
    ?>
    KevinF

Discussions similaires

  1. Réponses: 13
    Dernier message: 27/05/2015, 20h51
  2. Réponses: 1
    Dernier message: 15/03/2015, 17h44
  3. [Lazarus] Dans un DBGrid, modifier la police d'une ligne en fonction d'un champ
    Par Jon Shannow dans le forum Lazarus
    Réponses: 5
    Dernier message: 20/11/2014, 14h28
  4. incrémenter des lignes en fonction d'un champ "nombre"
    Par bookaro92 dans le forum Access
    Réponses: 2
    Dernier message: 01/12/2006, 15h05
  5. [VBA-E] Créer des lignes en fonction d'un champ
    Par antakini dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 18/04/2006, 20h23

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