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

MkFramework Discussion :

comment ajouter une numerotation a la table de list pour avoir un tableau numerote


Sujet :

MkFramework

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2013
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Niger

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Septembre 2013
    Messages : 12
    Points : 13
    Points
    13
    Par défaut comment ajouter une numerotation a la table de list pour avoir un tableau numerote
    bonjour,
    comment avoir un tableau numerote de se gernre:
    Nom : tableau.PNG
Affichages : 628
Taille : 25,3 Ko


    là dans la colonne de numerotion j'ai juste aficher l'id de chaque personne.le probleme est que si on filtre le resultat on a des numerotations en desordre.
    donc l'idee c'est de declarer une variable qui sera incremente et afficher dans la colone des numeros mais commen faire?

    voici l'affichage des numero avec l'id:
    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
     
    <table class="tb_list">
    	<tr>
                    <th>N°</th>
    		<th>nom</th>
     
    		<th>prenom</th>
     
    		<th>matricule</th>
     
    		<th>niveau</th>
     
    		<th>filiere</th>
     
    		<th></th>
    	</tr>
    	<?php if($this->tAninscription):?>
    		<?php foreach($this->tAninscription as $oAninscription):?>
    		<tr <?php echo plugin_tpl::alternate(array('','class="alt"'))?>>
     
                    <td><?php echo $oAninscription->id ?></td>
    		<td><?php echo $oAninscription->nom ?></td>
     
    		<td><?php echo $oAninscription->prenom ?></td>
     
    		<td><?php echo $oAninscription->matricule ?></td>
     
    		<td><?php if(isset($this->tJoinmodel_niveau[$oAninscription->niveau])){ echo $this->tJoinmodel_niveau[$oAninscription->niveau];}else{ echo $oAninscription->niveau ;}?></td>
     
    		<td><?php if(isset($this->tJoinmodel_filiere[$oAninscription->filiere])){ echo $this->tJoinmodel_filiere[$oAninscription->filiere];}else{ echo $oAninscription->filiere ;}?></td>
     
    			<td>
     
    <?php if(_root::getACL()->can('access','rightsManager::index')): ?>
    		<a href="<?php echo $this->getLink('aninscription::edit',array(
    										'id'=>$oAninscription->getId()
    									)
    							)?>">Edit</a>
    			|
    	<a href="<?php echo $this->getLink('aninscription::delete',array(
    											'id'=>$oAninscription->getId()
    										)
    								)?>">Delete</a>	 
    	<?php endif;?>
     
    				|
    	<a href="<?php echo $this->getLink('aninscription::show',array(
    											'id'=>$oAninscription->getId()
    									)
    							)?>">Show</a>
     
     
     
    			</td>
    		</tr>
    		<?php endforeach;?>
    	<?php else:?>
    		<tr>
    			<td colspan="6">Aucune ligne</td>
    		</tr>
    	<?php endif;?>
    </table>

  2. #2
    Rédacteur
    Avatar de imikado
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    5 239
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Finance

    Informations forums :
    Inscription : Décembre 2006
    Messages : 5 239
    Points : 19 100
    Points
    19 100
    Billets dans le blog
    17
    Par défaut
    Vous pouvez tester ceci

    Code php : 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
     
    <table class="tb_list">
    	<tr>
                    <th>N°</th>
    		<th>nom</th>
     
    		<th>prenom</th>
     
    		<th>matricule</th>
     
    		<th>niveau</th>
     
    		<th>filiere</th>
     
    		<th></th>
    	</tr>
    	<?php if($this->tAninscription):?>
    		<?php foreach($this->tAninscription as $i => $oAninscription):?>
    		<tr <?php echo plugin_tpl::alternate(array('','class="alt"'))?>>
     
                    <td><?php echo $i ?></td>
    		<td><?php echo $oAninscription->nom ?></td>
     
    		<td><?php echo $oAninscription->prenom ?></td>
     
    		<td><?php echo $oAninscription->matricule ?></td>
     
    		<td><?php if(isset($this->tJoinmodel_niveau[$oAninscription->niveau])){ echo $this->tJoinmodel_niveau[$oAninscription->niveau];}else{ echo $oAninscription->niveau ;}?></td>
     
    		<td><?php if(isset($this->tJoinmodel_filiere[$oAninscription->filiere])){ echo $this->tJoinmodel_filiere[$oAninscription->filiere];}else{ echo $oAninscription->filiere ;}?></td>
     
    			<td>
     
    <?php if(_root::getACL()->can('access','rightsManager::index')): ?>
    		<a href="<?php echo $this->getLink('aninscription::edit',array(
    										'id'=>$oAninscription->getId()
    									)
    							)?>">Edit</a>
    			|
    	<a href="<?php echo $this->getLink('aninscription::delete',array(
    											'id'=>$oAninscription->getId()
    										)
    								)?>">Delete</a>	 
    	<?php endif;?>
     
    				|
    	<a href="<?php echo $this->getLink('aninscription::show',array(
    											'id'=>$oAninscription->getId()
    									)
    							)?>">Show</a>
     
     
     
    			</td>
    		</tr>
    		<?php endforeach;?>
    	<?php else:?>
    		<tr>
    			<td colspan="6">Aucune ligne</td>
    		</tr>
    	<?php endif;?>
    </table>
    Framework php sécurisé et simple à prendre en main avec générateur web http://mkframework.com/ (hebergé sur developpez.com)
    Mes cours/tutoriaux

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2013
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Niger

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Septembre 2013
    Messages : 12
    Points : 13
    Points
    13
    Par défaut
    merci pour la reponse rapide.c'est ok

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [EJB3 Entity] comment ajouter une table au BD et créé sa entity a chaud?
    Par Arctodus dans le forum Java EE
    Réponses: 7
    Dernier message: 18/07/2009, 19h48
  2. Comment Ajouter une valeur nulle a une table d'un dataset?
    Par baradoss dans le forum Windows Forms
    Réponses: 11
    Dernier message: 17/05/2009, 20h47
  3. comment ajouter une clé étrangère dans une table
    Par une_tite_question dans le forum Débuter
    Réponses: 6
    Dernier message: 09/05/2008, 07h14
  4. Comment ajouter une clé étrangère à une table
    Par beegees dans le forum Outils
    Réponses: 18
    Dernier message: 01/03/2008, 22h57
  5. [VB.NET] Comment ajouter une table dans une base Access ?
    Par Hakki dans le forum Accès aux données
    Réponses: 1
    Dernier message: 22/09/2006, 16h19

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