PHP Classes

File: templates/example.tpl

Recommend this page to a friend!
  Classes of Anderson A. Meggiolaro   Paginator Iterator   templates/example.tpl   Download  
File: templates/example.tpl
Role: Auxiliary data
Content type: text/plain
Description: Example 1 - tpl
Class: Paginator Iterator
Iterate over listings split in page using Smarty
Author: By
Last change:
Date: 15 years ago
Size: 2,132 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <title>Paginator Iterator</title> <style type="text/css"> {literal} body { font: 12px verdana; } .paginator span { border: 1px solid #336699; padding: 8px 16px; color: white; background-color: black; } .paginator a { border: 1px solid #FF9999; padding: 3px 7px; text-decoration: none; color: blue; } .paginator a:hover { color: #F00000; background-color: #CCCCCC; } a.first-last, a.first-last:hover { color: #FFFFFF; background-color: #CCC; } {/literal} </style> </head> <body> <br/><br/> {p_iterator id="rec" ds=$ds numrows=$numrows rowsperpage=6 pageno=$smarty.get.pageno} {p_header} <div class="paginator" align="center"> {if $rec.is_first_page} <a class="first-last">First</a> <a class="first-last">Prev</a> {else} <a href="example.php?pageno={$rec.first}">First</a> <a href="example.php?pageno={$rec.prev}">Prev</a> {/if} {section name="i" loop=$rec.pages} {if $rec.pages[i] ne $rec.pageno} <a href="example.php?pageno={$rec.pages[i]}">{$rec.pages[i]}</a> {else} <span>{$rec.pages[i]}</span> {/if} {/section} {if $rec.is_last_page} <a class="first-last">Next</a> <a class="first-last">Last</a> {else} <a href="example.php?pageno={$}">Next</a> <a href="example.php?pageno={$rec.last}">Last</a> {/if} </div> <br/><br/> <table width="100%" border="1"> {/p_header} {p_item} <tr> <td>{$}</td> <td>{$}</td> </tr> {/p_item} {p_alternating} <tr style="background-color:#FFFF99;"> <td>{$}</td> <td>{$}</td> </tr> {/p_alternating} {p_empty} <tr> <td>No records found</td> </tr> {/p_empty} {p_footer} </table> {/p_footer} {/p_iterator} </body> </html>