PEAR::Page issue (with Smarty)
| From: | Robert | Date: | Fri, 11 Feb 2005 15:07:44 +0000 |
| Subject: | PEAR::Page issue (with Smarty) | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17509@lists.php.net to get a copy of this message | ||
I am getting two blank rows on the last page of my selection. The same query
using Perl works fine. A secondary issue is that no matter what I put in the
"per page" I get 6 lines. I am using Oracle (9.2.0.2) and that might be an
issue (though I am not sure). I am new to PHP (trying to move my stuff from
Perl).
Robert
[PHP]
require 'config.inc.php';
require_once 'DB.php';
require_once 'Pager/Pager.php';
require_once 'Pager/Pager_Wrapper.php';
// Connect and use the ELLPRD database
define("DSN",'oci8://*****:*****@*****');
$dbh = DB::connect(DSN);
if (DB::isError($dbh)) {
die($dbh->getMessage());
}
$dbh->setFetchMode(DB_FETCHMODE_ASSOC);
$sql = "
SELECT surname, first_name, msf810.employee_id AS userid,
msf020.global_profile AS profile, msf878.position_id AS position
FROM msf810, msf020, msf829, msf878
WHERE msf810.employee_id = msf020.employee_id
AND msf810.employee_id = msf829.employee_id
AND msf810.employee_id = msf878.employee_id
AND msf020.dstrct_code = 'MATA' AND physical_loc = '02'
AND msf020.global_profile != 'JRADMIN'
AND msf878.position_id != 'SUSP'
AND msf878.pos_stop_date = '00000000'
ORDER BY surname
";
$pagerOptions = Array(
'mode' => 'Jumping',
'delta' => 10,
'perPage' => 6,
);
// new page object
$page = new Page();
// assign standard stuff
$page->assign('pagetitle','Ellipse Reports » Testing 1-2-3');
$page->assign('pageheader', '» Information');
$page->assign('tableheader', '» Testing 1-2-3');
$page->assign('pageinfo', 'Only a testing page...');
$page->assign('pageData', Pager_Wrapper_DB($dbh, $sql, $pagerOptions));
// Display it
$page->display('test.tpl');
[TPL]
{include file="header.tpl"}
<body onload="initListGroup('chainedmenu', document.listmenu0.firstlevel,
document.listmenu0.secondlevel, document.listmenu0.thirdlevel,
'savestate')">
<h1 class="header">
{include file="menu.tpl"}
</h1>
<div class="title">{$pageheader}</div>
<div class="content">
<p class="nomargin">{$pageinfo}</p>
</div>
<div class="title">{$tableheader}</div>
<div class="content">
<div align="center">
<table width="90%" cellspacing="0" cellpadding="2"
class="content">
<tr>
<th>LAST NAME</th>
<th>FIRST NAME</th>
<th>EMPLOYEE ID</th>
<th>PROFILE</th>
<th>POSITION</th>
</tr>
{section name=item loop=$pageData}
<tr class="{cycle values="trcol1,trcol2"}">
<td>{$pageData.data[item].SURNAME}</td>
<td>{$pageData.data[item].FIRST_NAME}</td>
<td>{$pageData.data[item].USERID}</td>
<td>{$pageData.data[item].PROFILE}</td>
<td>{$pageData.data[item].POSITION}</td>
</tr>
{/section}
</table>
<br>
<div align="center">
<table width="90%" cellspacing="0" cellpadding="2"
class="content">
<tr>
<th class="center">{$pageData.links}</th>
</tr>
</table>
</div>
<br>
</div>
</div>
{include file="footer.tpl"}