Sample> Db Showrecords Array

<?php

// include TPLN
include('TPLN/TPLN.php');

$TPLN = new TPLN;
$TPLN->setNavColor('#FFFFFF','#FFFFC0'); // change colors of navigation

// you can create this array from a CSV file or a XML file...
$res[] = array('user'=> 'root''password'=> 'admin');
$res[] = array('user'=> 'linus''password'=> 'toox');
$res[] = array('user'=> 'richard''password'=> 'gnu');
$res[] = array('user'=> 'tpln''password'=> 'best ;-)');


$TPLN->open('Db_showrecords_array.html');
$TPLN->setUrl('?'); // optional take current page by default
$TPLN->showRecords($res2); // only 2 results by page
$TPLN->write();




?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>TPLN - DB function ShowResult Sample</title>
    <link href="../style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<bloc::data>



<table cellpadding="3" cellspacing="1" width="100%">
<caption>Results {_First} to {_Last} of {_Count}</b> (Page {_PageNumber} / {_PageCount})</caption>
<tr bgcolor="{_NavColor}">
    <th>#</th>
    <th>User</th>
    <th>Password</th>
</tr>

    <bloc::loop>
    <tr bgcolor="{_NavColor}">
        <td>{_Id}</td>
        <td>{user}</td>
        <td>{password}</td>
     </tr>
     </bloc::loop>

<tr>
    <th colspan="3" align="center">

        <!-- Add previous bloc button -->
        <bloc::previous>
               <a href="{_Url}"><img src="../previous.gif" alt="Go previous page" align="absbottom"></a>
        </bloc::previous>
        <!--------------------------->

        <!-- Add pager bloc -->
        <bloc::pager>
               <bloc::out> <a href="{_Url}">{_Page}</a> </bloc::out>
               <bloc::in> <font color="red">{_Page}</font> </bloc::in>
        </bloc::pager>
        <!--------------------------->

        <!-- Add next bloc button -->
        <bloc::next>
               <a href="{_Url}"><img src="../next.gif" border=0 alt="Go next page" align="absbottom"></a>
        </bloc::next>
        <!--------------------------->

    </th>
</tr>
</table>


    <bloc::norecord>No record</bloc::norecord>
</bloc::data>


<br>
<br>
{_Logo}<font size="1"> in {_Chrono} s<br>
Queries executed: {_QueryCount}</font>

</body>
</html>