*
* Handles limiting number of rows displayed *
* Copyright (C) 2000, 2001 Joseph Engo *
* -------------------------------------------------------------------------*
* This library is part of the phpGroupWare API *
* http://www.phpgroupware.org/api *
* ------------------------------------------------------------------------ *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, *
* or any later version. *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
\**************************************************************************/
/* $Id$ */
class nextmatchs
{
// I split this up so it can be used in differant layouts.
function show($sn,$start,$total,$extra, $twidth, $bgtheme,
$search_obj=0,$filter_obj=1,$showsearch=1)
{
echo $this->tablestart($sn,$twidth, $bgtheme);
echo $this->left($sn,$start,$total,$extra);
if ($showsearch == 1)
{
echo $this->search($search_obj);
}
echo $this->filter($filter_obj);
echo $this->right($sn,$start,$total,$extra);
echo $this->tableend();
}
// --------------------------------------------------------------------
// same as show, only without direct output for use within templates
// *** the show function can be removed as soon as every program using
// nextmatch is converted to use template and show_tpl (loge)
// --------------------------------------------------------------------
function show_tpl($sn,$start,$total,$extra, $twidth, $bgtheme,
$search_obj=0,$filter_obj=1,$showsearch=1)
{
$var = $this->tablestart($sn,$twidth, $bgtheme);
$var .= $this->left($sn,$start,$total,$extra);
if ($showsearch == 1)
{
$var .= $this->search($search_obj);
}
$var .= $this->filter($filter_obj);
$var .= $this->right($sn,$start,$total,$extra);
$var .= $this->tableend();
return $var;
}
function tablestart($scriptname, $twidth="75%", $bgtheme="D3DCE3")
{
global $filter, $qfield, $start, $order, $sort, $query, $phpgw;
$str = "
\n";
if ($start != 0) {
// Changing the sorting order screaws up the starting number
if ( ($start - $maxmatchs) < 0)
$t_start = 0;
else
$t_start = ($start - $maxmatchs);
$str .= "