<?php
// Version: 1.28beta  (D0.01).  Generated: 2001-Jun-17 17:48:42
// Visit http://www.phplens.com for more info & updates on PHPLens
		
//---------------------------------------------------------
// This initialization code needs to be declared only once
if (!defined('PHPLENS_DIR')) define('PHPLENS_DIR','d:/Inetpub/wwwroot/php/phplens/gridbuilder/..');
include_once(PHPLENS_DIR.'/phplens.inc.php');
session_start();
// Place code above before any HTML is sent to client
?>

<?php
//---------------------------------------------------
// Initialize the PHPLens class and then Render() it.
// You might want to change the id below from 4d617109 
// to ensure no conflicts with other phplens objects.

$lens = PHPLensPConnect('4d617109',"select * from lens_users",'mysql','localhost','root','','xphplens_2');
if (! $lens) die('PHPLens 4d617109 failed to start');
//-----------------------------------------------------
// to disable dynamic editing, uncomment the line below
//$lens->dynEdit = 0;

//----------------------------------------------------------
// Define Lens properties which cannot be defined through UI
$lens->password = '';	// Password to modify everything, including SQL
$lens->menuHide = '';	// Which menu items to hide. Eg. menuHide="ALL;NAV;FILTER" to hide ALL, NAV=hide next/prev btns, FILTER=hide search 
$lens->canEdit = true;	// Show Edit Button
$lens->canNew = true;	// Show New Record Button
$lens->canDelete = true;	// Show Delete Button

//--------------------------------------------------------
// Define Lens properties which can be set through the UI


$lens->keyTable = 'lens_users';	// Save Data Table
$lens->keyCol = 'USERNAME';	// Primary Key of Save Data Table
$lens->pageSize = 10;	// rows per page

$lens->nameLens = 'CREATED^CREATED^^^;LASTMOD^LASTMOD^^^;ISADMIN^ISADMIN^^^;EMAIL^EMAIL^^^;PROFILES^PROFILES^^^;COUNTRY^COUNTRY^^^';
$lens->gridLens = 'USERNAME;FIRSTNAME;LASTNAME;EMAIL';
$lens->detailLens = 'USERNAME;FIRSTNAME;LASTNAME;EMAIL;ADDRESS1;ADDRESS2;POSTCODE;CITY;STATE;COUNTRY;PROFILES;TELEPHONE;CREATED;LASTMOD;ISADMIN';
$lens->readOnlyLens = 'CREATED;LASTMOD';
$lens->defaultLens = 'CREATED^=time();LASTMOD^=time();COUNTRY^Malaysia';
$lens->validation = 'EMAIL^=email^';

$lens->lookupLens = 'PROFILES^select profile from lens_profile order by seq';
$lens->powerEditLens = 'LASTMOD^=time()';
$lens->mustFill = 'EMAIL;USERNAME;PASSWORD';
$lens->checkboxLens = 'ISADMIN;PROFILES';	// Show as checkbox
# Modify the samples to create your own stored procedures. Note: spNew does not include defaultLens values 
# $this->spNew = "spnew({USERNAME}, {PASSWORD}, {FIRSTNAME}, {LASTNAME}, {EMAIL}, {ADDRESS1}, {ADDRESS2}, {POSTCODE}, {CITY}, {STATE}, {COUNTRY}, {PROFILES}, {TELEPHONE}, {CREATED}, {LASTMOD}, {ISADMIN})";
# $this->spNew = "insert into lens_users(USERNAME, PASSWORD, FIRSTNAME, LASTNAME, EMAIL, ADDRESS1, ADDRESS2, POSTCODE, CITY, STATE, COUNTRY, PROFILES, TELEPHONE, CREATED, LASTMOD, ISADMIN) values ({USERNAME}, {PASSWORD}, {FIRSTNAME}, {LASTNAME}, {EMAIL}, {ADDRESS1}, {ADDRESS2}, {POSTCODE}, {CITY}, {STATE}, {COUNTRY}, {PROFILES}, {TELEPHONE}, {CREATED}, {LASTMOD}, {ISADMIN})";
# $this->spEdit = "spedit({USERNAME}, {PASSWORD}, {FIRSTNAME}, {LASTNAME}, {EMAIL}, {ADDRESS1}, {ADDRESS2}, {POSTCODE}, {CITY}, {STATE}, {COUNTRY}, {PROFILES}, {TELEPHONE}, {CREATED}, {LASTMOD}, {ISADMIN})";
# $this->spEdit= "update lens_users set USERNAME={USERNAME}, PASSWORD={PASSWORD}, FIRSTNAME={FIRSTNAME}, LASTNAME={LASTNAME}, EMAIL={EMAIL}, ADDRESS1={ADDRESS1}, ADDRESS2={ADDRESS2}, POSTCODE={POSTCODE}, CITY={CITY}, STATE={STATE}, COUNTRY={COUNTRY}, PROFILES={PROFILES}, TELEPHONE={TELEPHONE}, CREATED={CREATED}, LASTMOD={LASTMOD}, ISADMIN={ISADMIN} where USERNAME={USERNAME}";


//-----------------
// Generate HTML

$lens->Render();
$lens->Close();

?>
