Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/admin_libs
In directory usw-pr-cvs1:/tmp/cvs-serv25748/chat/lib/admin_libs
Added Files:
navigation.lib.php3
Log Message:
First draft of the administration sheets
--- NEW FILE ---
<?php
//
// +--------------------------------------------------------------------------+
// | phpMyChat version 0.15.0 |
// +--------------------------------------------------------------------------+
// | Copyright (c) 2000-2001 The phpHeaven-team |
// +--------------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html |
// +--------------------------------------------------------------------------+
// | This library displays a navigation bar (begin, down, up and end buttons) |
// | to move among results of a SQL query. |
// | |
// | It is called by the 'chat/admin1.php3' and 'chat/admin2.php3' scripts. |
// +--------------------------------------------------------------------------+
// | From the phpMyChat project: |
// | http://www.phpheaven.net/projects/phpMyChat/ |
// | |
// | Authors: the phpHeaven-team <te...@ph...> |
// +--------------------------------------------------------------------------+
//
// $Id: navigation.lib.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $
//
// Navigation among results of a SQL query.
//
/**
* Displays the navigation bar
*
* @param integer total count of profiles to be displayed
*
* @global array the session data
* @global string the url to use on the click of an arrow
* @global string the cell alignment
* @global string the opposite cell alignment
* @global string the 'to the beginning' arrow gif
* @global string the 'next' arrow gif
* @global string the 'to the end' arrow gif
* @global string the 'previous' arrow gif
* @global integer the offset for the last page of data
*/
function pmcPagesNav($regCnt = 1)
{
global $dbSessionVars;
global $adminBodyNavigUrl;
global $cellAlign, $invertCellAlign;
global $navBeginImg, $navDownImg, $navEndImg, $navUpImg;
global $lastPageOffset;
echo("\t\t" . '<table border="0" cellpadding="5" cellspacing="0" class="tableTitle" width="100%">' . "\n");
echo("\t\t\t" . '<tr>' . "\n");
// Links to move some pages down
echo("\t\t\t\t" . '<td align="' . $cellAlign . '" valign="middle" width="70" height="20" class="tabTitle">' . "\n");
if ($dbSessionVars['offset'] > 0)
{
$pageDown = ($dbSessionVars['offset'] - 10 > 0)
? $dbSessionVars['offset'] - 10
: 0;
echo("\t\t\t\t\t" . ' <a href="' . $adminBodyNavigUrl . '0"><img src="images/admin_imgs/' . $navBeginImg . '" height="20" width="20" border="0" alt="start"/></a>' . "\n");
echo("\t\t\t\t\t" . ' <a href="' . $adminBodyNavigUrl . $pageDown . '"><img src="images/admin_imgs/' . $navDownImg .'" height="20" width="21" border="0" alt="down" /></a>' . "\n");
}
else // the first page is already displayed
{
echo("\t\t\t\t\t" . ' ' . "\n");
}
echo("\t\t\t\t" . '</td>' . "\n");
// Displays the current page number and the pages count
$pageNum = ceil(($dbSessionVars['offset'] + 1) / 10);
$pagesCnt = ceil($regCnt / 10);
echo("\t\t\t\t" . '<td align="center" valign="middle" height="20" class="tabTitle">' . "\n");
echo("\t\t\t\t\t" . '<span class="small">' . sprintf(A_PAGE_CNT, $pageNum, $pagesCnt) . '</span>' . "\n");
echo("\t\t\t\t" . '</td>' . "\n");
// Links to move some pages up
echo("\t\t\t\t" . '<td align="' . $invertCellAlign . '" valign="middle" width="70" height="20" class="tabTitle">' . "\n");
if ($dbSessionVars['offset'] < $lastPageOffset)
{
$pageUp = $dbSessionVars['offset'] + 10;
echo("\t\t\t\t\t" . ' <a href="' . $adminBodyNavigUrl . $pageUp . '"><img src="images/admin_imgs/' . $navUpImg .'" height="20" width="20" border="0" alt="up" /></a>' . "\n");
echo("\t\t\t\t\t" . ' <a href="' . $adminBodyNavigUrl . $lastPageOffset . '"><img src="images/admin_imgs/' . $navEndImg . '" height="20" width="21" border="0" alt="end" /></a>' . "\n");
}
else // the last page is already displayed
{
echo("\t\t\t\t\t" . ' ' . "\n");
}
echo("\t\t\t\t" . '</td>' . "\n");
echo("\t\t\t" . '</tr>' . "\n");
echo("\t\t\t" . '</table>' . "\n");
} // end of the function 'pmcPagesNav()'
?>
|