0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www.OLD
/
adminnlp
/
[
Home
]
File: listing.php
<?php include_once(realpath(dirname(__FILE__)) . "/../fonctions/authplugins.php"); autorisation("contact"); include_once(realpath(dirname(__FILE__)) . "/../client/plugins/contact/Contact.class.php"); if(isset($_REQUEST["action"]) && $_REQUEST["action"] == "supprimer"){ $contact = new Contact(); $contact->charger($_REQUEST["id"]); $contact->delete(); } ?> <?php function SetNonlu($row,$where){ // var_dump($row->lu); if(!$row && $where == "start" ){ return "<strong>"; } elseif(!$row && $where == "end") { return "</strong>"; } else { return ""; } } ?> <script type="text/javascript"> function supprimer(id){ if(confirm("Voulez-vous vraiment supprimer ce message?")) location="module.php?nom=contact&id=" + id + "&action=supprimer"; } </script> <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table"> <thead> <tr> <th class="table-header-repeat line-left minwidth-1">Sujet</th> <th class="table-header-repeat line-left minwidth-1">Nom</th> <th class="table-header-repeat line-left minwidth-1">Prénom</th> <th class="table-header-repeat line-left minwidth-1">E-mail</th> <th class="table-header-repeat line-left minwidth-1">Visualiser</th> <th class="table-header-repeat line-left minwidth-1">Lu</th> <th class="table-header-repeat line-left minwidth-1">Action</th> </tr> </thead> <tfoot> <tr> <td colspan="7"> <div class="pagination"> <?php if($page>1){ ?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=<?php echo($pageprec); ?>"><< Page précédente </a> <?php } ?> <?php if($totnbpage > $nbpage){?> <?php if($page>1) {?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=1">...</a> <?php } ?> <?php if($page+$nbpage-1 > $totnbpage){ $max = $totnbpage; $min = $totnbpage-$nbpage;} else{$min = $page-1; $max=$page+$nbpage-1; }?> <?php for($i=$min; $i<$max; $i++){ ?> <?php if($page != $i+1){ ?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=<?php echo($i+1); ?>&classement=<?php echo($classement); ?>"><?php echo($i+1); ?></a> <?php } else {?> <a class="number current"><?php echo($i+1); ?></a> <?php } ?> <?php } ?> <?php if($page < $totnbpage){?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=<?php echo $totnbpage; ?>">...</a> <?php } ?> <?php } else{ for($i=0; $i<$totnbpage; $i++){ ?> <?php if($page != $i+1){ ?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=<?php echo($i+1); ?>&classement=<?php echo($classement); ?><?php echo $lien_voir; ?>"><?php echo($i+1); ?></a> <?php } else {?> <a class="number current"><?php echo($i+1); ?></a> <?php } ?> <?php } ?> <?php } ?> <?php if($page < $totnbpage){ ?> <a class="number" href="<?php echo($_SERVER['PHP_SELF']); ?>?page=<?php echo($pagesuiv); ?>">Page suivante >></a> <?php } ?> </div> <div class="clear"></div></td> </tr> </tfoot> <tbody> <?php $contact = new Contact(); $query = "select * from $contact->table ORDER BY id DESC"; $resul = mysql_query($query,$contact->link); $nb_contact = mysql_num_rows($resul); $i=0; while($row = mysql_fetch_object($resul)){ if(!($i%2)) $fond="ligne_claire_rub"; else $fond="ligne_fonce_rub"; $i++; ?> <tr style="font-weight:bold"> <td><?php echo SetNonlu($row->lu,"start"); ?><?php echo $row->sujet; ?><?php echo SetNonlu($row->lu,"end"); ?></td> <td><?php echo SetNonlu($row->lu,"start"); ?><?php echo $row->nom; ?><?php echo SetNonlu($row->lu,"end"); ?></td> <td><?php echo SetNonlu($row->lu,"start"); ?><?php echo $row->prenom; ?><?php echo SetNonlu($row->lu,"end"); ?></td> <td><?php echo SetNonlu($row->lu,"start"); ?><?php echo $row->email; ?><?php echo SetNonlu($row->lu,"end"); ?></td> <td><a href="module.php?nom=contact&vue=view&id=<?php echo $row->id; ?>">Visualiser</a></td> <td><?php if($row->lu) echo "oui"; else echo "non"; ?></td> <td><a href="javascript:supprimer(<?php echo $row->id; ?>);" title="Supprimer"><img src="images/icons/cross.png" alt="Delete" /></a></td> </tr> <?php } ?> <?php if($nb_contact <= 0){?> <tr> <td colspan="7"> <p>Aucun messages pour l'instant</p> </td> </tr> <?php } ?> </tbody> </table>
©
2018.