bonjour,
comment avoir un tableau numerote de se gernre:
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>
Partager