<?php
/**
* (c) 2000, 2001, 2002, 2003 Remistech Sdn Bhd. All Rights Reserved.
*  Developed by John Lim
*  Licensed to Natsoft (M) Sdn Bhd to distribute and support. Refer to LICENSE document.
*/

#
# Note: testphplens.php and testtext.php are identical
#
error_reporting(63);
ini_set('display_errors','1');
include_once('./phplens.inc.php');

session_start();


/* 
 * This setup test retrieves data from an array so we don't have
 * so many database configuration errors to deal with.
 *
 * You might still get database connection errors because you
 * didn't configure PHPLENS_SESSION_* variables in 
 *           phplens/config/phplens.config.inc.php.
 */

$rt = array('Rec','FirstName','LastName','Num');
$r0 = array(1,'John ','Lim','1');
$r1 = array(2,'Harry','Zee','2');
$r2 = array(3,'Larry','Aaron','3');
$r3 = array(4,'Baddy','Lim','4');
$r4 = array(5,'John','Lee','5');
$r5 = array(6,'Yee','Dee','16');
$rend = array(7,'Last','Record','1000');

/* Create the 2 dimensional array */
$arr= array($r0,$r1,$r2,$r3,$r4,$r5,$rend);

/* load the 2D array into a text database */	
$lens = PHPLensArray('textphplens',$arr,false,false);//array('1stName','Surname','ID'));
//$lens->fileSessionPath = '/tmp';

// always prevent dynamic editing for security reasons
$lens->dynEdit = 0;

$lens->Render();
$lens->Close();
include_once('./phplens-dynedit.inc.php');
$e = PHPLENS_DynEdit($lens);
if ($e) print $e->PrintV();

?>