Location: PHPKode > projects > Science Lab Inventory & Order Management > sciencelabinv/useraccountslist.php
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "useraccountsinfo.php" ?>
<?php include "userfn7.php" ?>
<?php

// Create page object
$useraccounts_list = new cuseraccounts_list();
$Page =& $useraccounts_list;

// Page init
$useraccounts_list->Page_Init();

// Page main
$useraccounts_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($useraccounts->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var useraccounts_list = new ew_Page("useraccounts_list");

// page properties
useraccounts_list.PageID = "list"; // page ID
useraccounts_list.FormID = "fuseraccountslist"; // form ID
var EW_PAGE_ID = useraccounts_list.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
useraccounts_list.Form_CustomValidate =  
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
useraccounts_list.SelectAllKey = function(elem) {
	ew_SelectAll(elem);
	ew_ClickAll(elem);
}
<?php if (EW_CLIENT_VALIDATE) { ?>
useraccounts_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
useraccounts_list.ValidateRequired = false; // no JavaScript validation
<?php } ?>

//-->
</script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->

</script>
<?php } ?>
<?php if ($useraccounts->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$useraccounts_list->lTotalRecs = $useraccounts->SelectRecordCount();
	} else {
		if ($rs = $useraccounts_list->LoadRecordset())
			$useraccounts_list->lTotalRecs = $rs->RecordCount();
	}
	$useraccounts_list->lStartRec = 1;
	if ($useraccounts_list->lDisplayRecs <= 0 || ($useraccounts->Export <> "" && $useraccounts->ExportAll)) // Display all records
		$useraccounts_list->lDisplayRecs = $useraccounts_list->lTotalRecs;
	if (!($useraccounts->Export <> "" && $useraccounts->ExportAll))
		$useraccounts_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $useraccounts_list->LoadRecordset($useraccounts_list->lStartRec-1, $useraccounts_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $useraccounts->TableCaption() ?>
<?php if ($useraccounts->Export == "" && $useraccounts->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $useraccounts_list->ExportPrintUrl ?>"><?php echo $Language->Phrase("PrinterFriendly") ?></a>
&nbsp;&nbsp;<a href="<?php echo $useraccounts_list->ExportHtmlUrl ?>"><?php echo $Language->Phrase("ExportToHtml") ?></a>
&nbsp;&nbsp;<a href="<?php echo $useraccounts_list->ExportExcelUrl ?>"><?php echo $Language->Phrase("ExportToExcel") ?></a>
&nbsp;&nbsp;<a href="<?php echo $useraccounts_list->ExportWordUrl ?>"><?php echo $Language->Phrase("ExportToWord") ?></a>
&nbsp;&nbsp;<a href="<?php echo $useraccounts_list->ExportCsvUrl ?>"><?php echo $Language->Phrase("ExportToCsv") ?></a>
&nbsp;&nbsp;<a name="emf_useraccounts" id="emf_useraccounts" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_useraccounts',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fuseraccountslist,sel:false});"><?php echo $Language->Phrase("ExportToEmail") ?></a>
<?php } ?>
</span></p>
<?php if ($Security->CanSearch()) { ?>
<?php if ($useraccounts->Export == "" && $useraccounts->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(useraccounts_list);" style="text-decoration: none;"><img id="useraccounts_list_SearchImage" src="images/collapse.gif" alt="" width="9" height="9" border="0"></a><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("Search") ?></span><br>
<div id="useraccounts_list_SearchPanel">
<form name="fuseraccountslistsrch" id="fuseraccountslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="useraccounts">
<table class="ewBasicSearch">
	<tr>
		<td><span class="phpmaker">
			<input type="text" name="<?php echo EW_TABLE_BASIC_SEARCH ?>" id="<?php echo EW_TABLE_BASIC_SEARCH ?>" size="20" value="<?php echo ew_HtmlEncode($useraccounts->getSessionBasicSearchKeyword()) ?>">
			<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">&nbsp;
			<a href="<?php echo $useraccounts_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>&nbsp;
		</span></td>
	</tr>
	<tr>
	<td><span class="phpmaker"><label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value=""<?php if ($useraccounts->getSessionBasicSearchType() == "") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("ExactPhrase") ?></label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="AND"<?php if ($useraccounts->getSessionBasicSearchType() == "AND") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AllWord") ?></label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="OR"<?php if ($useraccounts->getSessionBasicSearchType() == "OR") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AnyWord") ?></label></span></td>
	</tr>
</table>
</form>
</div>
<?php } ?>
<?php } ?>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$useraccounts_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($useraccounts->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($useraccounts->CurrentAction <> "gridadd" && $useraccounts->CurrentAction <> "gridedit") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($useraccounts_list->Pager)) $useraccounts_list->Pager = new cPrevNextPager($useraccounts_list->lStartRec, $useraccounts_list->lDisplayRecs, $useraccounts_list->lTotalRecs) ?>
<?php if ($useraccounts_list->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($useraccounts_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($useraccounts_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $useraccounts_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($useraccounts_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($useraccounts_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $useraccounts_list->Pager->PageCount ?></span></td>
	</tr></table>
	</td>	
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td>
	<span class="phpmaker"><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $useraccounts_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $useraccounts_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $useraccounts_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($useraccounts_list->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php echo $Language->Phrase("RecordsPerPage") ?>&nbsp;</td><td>
<input type="hidden" id="t" name="t" value="useraccounts">
<select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();" class="phpmaker">
<option value="10"<?php if ($useraccounts_list->lDisplayRecs == 10) { ?> selected="selected"<?php } ?>>10</option>
<option value="25"<?php if ($useraccounts_list->lDisplayRecs == 25) { ?> selected="selected"<?php } ?>>25</option>
<option value="50"<?php if ($useraccounts_list->lDisplayRecs == 50) { ?> selected="selected"<?php } ?>>50</option>
<option value="ALL"<?php if ($useraccounts->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select></td></tr></table>
		</td>
<?php } ?>
	</tr>
</table>
</form>
<?php } ?>
<span class="phpmaker">
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $useraccounts_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>&nbsp;&nbsp;
<?php } ?>
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
<?php if ($Security->CanDelete()) { ?>
<a href="" onclick="ew_SubmitSelected(document.fuseraccountslist, '<?php echo $useraccounts_list->MultiDeleteUrl ?>');return false;"><?php echo $Language->Phrase("DeleteSelectedLink") ?></a>&nbsp;&nbsp;
<?php } ?>
<?php } ?>
</span>
</div>
<?php } ?>
<form name="fuseraccountslist" id="fuseraccountslist" class="ewForm" action="" method="post">
<div id="gmp_useraccounts" class="ewGridMiddlePanel">
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $useraccounts->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$useraccounts_list->RenderListOptions();

// Render list options (header, left)
$useraccounts_list->ListOptions->Render("header", "left");
?>
<?php if ($useraccounts->username->Visible) { // username ?>
	<?php if ($useraccounts->SortUrl($useraccounts->username) == "") { ?>
		<td><?php echo $useraccounts->username->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $useraccounts->SortUrl($useraccounts->username) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $useraccounts->username->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($useraccounts->username->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($useraccounts->username->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($useraccounts->password->Visible) { // password ?>
	<?php if ($useraccounts->SortUrl($useraccounts->password) == "") { ?>
		<td><?php echo $useraccounts->password->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $useraccounts->SortUrl($useraccounts->password) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $useraccounts->password->FldCaption() ?></td><td style="width: 10px;"><?php if ($useraccounts->password->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($useraccounts->password->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($useraccounts->userlevel->Visible) { // userlevel ?>
	<?php if ($useraccounts->SortUrl($useraccounts->userlevel) == "") { ?>
		<td><?php echo $useraccounts->userlevel->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $useraccounts->SortUrl($useraccounts->userlevel) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $useraccounts->userlevel->FldCaption() ?></td><td style="width: 10px;"><?php if ($useraccounts->userlevel->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($useraccounts->userlevel->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($useraccounts->zemail->Visible) { // email ?>
	<?php if ($useraccounts->SortUrl($useraccounts->zemail) == "") { ?>
		<td><?php echo $useraccounts->zemail->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $useraccounts->SortUrl($useraccounts->zemail) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $useraccounts->zemail->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($useraccounts->zemail->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($useraccounts->zemail->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($useraccounts->Activated->Visible) { // Activated ?>
	<?php if ($useraccounts->SortUrl($useraccounts->Activated) == "") { ?>
		<td><?php echo $useraccounts->Activated->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $useraccounts->SortUrl($useraccounts->Activated) ?>',1);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $useraccounts->Activated->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($useraccounts->Activated->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($useraccounts->Activated->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$useraccounts_list->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
if ($useraccounts->ExportAll && $useraccounts->Export <> "") {
	$useraccounts_list->lStopRec = $useraccounts_list->lTotalRecs;
} else {
	$useraccounts_list->lStopRec = $useraccounts_list->lStartRec + $useraccounts_list->lDisplayRecs - 1; // Set the last record to display
}
$useraccounts_list->lRecCount = $useraccounts_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$bSelectLimit && $useraccounts_list->lStartRec > 1)
		$rs->Move($useraccounts_list->lStartRec - 1);
}

// Initialize aggregate
$useraccounts->RowType = EW_ROWTYPE_AGGREGATEINIT;
$useraccounts_list->RenderRow();
$useraccounts_list->lRowCnt = 0;
while (($useraccounts->CurrentAction == "gridadd" || !$rs->EOF) &&
	$useraccounts_list->lRecCount < $useraccounts_list->lStopRec) {
	$useraccounts_list->lRecCount++;
	if (intval($useraccounts_list->lRecCount) >= intval($useraccounts_list->lStartRec)) {
		$useraccounts_list->lRowCnt++;

	// Init row class and style
	$useraccounts->CssClass = "";
	$useraccounts->CssStyle = "";
	$useraccounts->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
	if ($useraccounts->CurrentAction == "gridadd") {
		$useraccounts_list->LoadDefaultValues(); // Load default values
	} else {
		$useraccounts_list->LoadRowValues($rs); // Load row values
	}
	$useraccounts->RowType = EW_ROWTYPE_VIEW; // Render view

	// Render row
	$useraccounts_list->RenderRow();

	// Render list options
	$useraccounts_list->RenderListOptions();
?>
	<tr<?php echo $useraccounts->RowAttributes() ?>>
<?php

// Render list options (body, left)
$useraccounts_list->ListOptions->Render("body", "left");
?>
	<?php if ($useraccounts->username->Visible) { // username ?>
		<td<?php echo $useraccounts->username->CellAttributes() ?>>
<div<?php echo $useraccounts->username->ViewAttributes() ?>><?php echo $useraccounts->username->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($useraccounts->password->Visible) { // password ?>
		<td<?php echo $useraccounts->password->CellAttributes() ?>>
<div<?php echo $useraccounts->password->ViewAttributes() ?>><?php echo $useraccounts->password->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($useraccounts->userlevel->Visible) { // userlevel ?>
		<td<?php echo $useraccounts->userlevel->CellAttributes() ?>>
<div<?php echo $useraccounts->userlevel->ViewAttributes() ?>><?php echo $useraccounts->userlevel->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($useraccounts->zemail->Visible) { // email ?>
		<td<?php echo $useraccounts->zemail->CellAttributes() ?>>
<div<?php echo $useraccounts->zemail->ViewAttributes() ?>><?php echo $useraccounts->zemail->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($useraccounts->Activated->Visible) { // Activated ?>
		<td<?php echo $useraccounts->Activated->CellAttributes() ?>>
<?php if (ew_ConvertToBool($useraccounts->Activated->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $useraccounts->Activated->ListViewValue() ?>" checked="checked" onclick="this.form.reset();" disabled="disabled">
<?php } else { ?>
<input type="checkbox" value="<?php echo $useraccounts->Activated->ListViewValue() ?>" onclick="this.form.reset();" disabled="disabled">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$useraccounts_list->ListOptions->Render("body", "right");
?>
	</tr>
<?php
	}
	if ($useraccounts->CurrentAction <> "gridadd")
		$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php

// Close recordset
if ($rs)
	$rs->Close();
?>
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
<?php if ($useraccounts->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($useraccounts->CurrentAction <> "gridadd" && $useraccounts->CurrentAction <> "gridedit") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($useraccounts_list->Pager)) $useraccounts_list->Pager = new cPrevNextPager($useraccounts_list->lStartRec, $useraccounts_list->lDisplayRecs, $useraccounts_list->lTotalRecs) ?>
<?php if ($useraccounts_list->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($useraccounts_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($useraccounts_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $useraccounts_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($useraccounts_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($useraccounts_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $useraccounts_list->PageUrl() ?>start=<?php echo $useraccounts_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $useraccounts_list->Pager->PageCount ?></span></td>
	</tr></table>
	</td>	
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td>
	<span class="phpmaker"><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $useraccounts_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $useraccounts_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $useraccounts_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($useraccounts_list->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php echo $Language->Phrase("RecordsPerPage") ?>&nbsp;</td><td>
<input type="hidden" id="t" name="t" value="useraccounts">
<select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();" class="phpmaker">
<option value="10"<?php if ($useraccounts_list->lDisplayRecs == 10) { ?> selected="selected"<?php } ?>>10</option>
<option value="25"<?php if ($useraccounts_list->lDisplayRecs == 25) { ?> selected="selected"<?php } ?>>25</option>
<option value="50"<?php if ($useraccounts_list->lDisplayRecs == 50) { ?> selected="selected"<?php } ?>>50</option>
<option value="ALL"<?php if ($useraccounts->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select></td></tr></table>
		</td>
<?php } ?>
	</tr>
</table>
</form>
<?php } ?>
<?php //if ($useraccounts_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $useraccounts_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>&nbsp;&nbsp;
<?php } ?>
<?php if ($useraccounts_list->lTotalRecs > 0) { ?>
<?php if ($Security->CanDelete()) { ?>
<a href="" onclick="ew_SubmitSelected(document.fuseraccountslist, '<?php echo $useraccounts_list->MultiDeleteUrl ?>');return false;"><?php echo $Language->Phrase("DeleteSelectedLink") ?></a>&nbsp;&nbsp;
<?php } ?>
<?php } ?>
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($useraccounts->Export == "" && $useraccounts->CurrentAction == "") { ?>
<script type="text/javascript">
<!--
ew_ToggleSearchPanel(useraccounts_list); // Init search panel as collapsed

//-->
</script>
<?php } ?>
<?php if ($useraccounts->Export == "") { ?>
<script language="JavaScript" type="text/javascript">
<!--

// Write your table-specific startup script here
// document.write("page loaded");
//-->

</script>
<?php } ?>
<?php include "footer.php" ?>
<?php
$useraccounts_list->Page_Terminate();
?>
<?php

//
// Page class
//
class cuseraccounts_list {

	// Page ID
	var $PageID = 'list';

	// Table name
	var $TableName = 'useraccounts';

	// Page object name
	var $PageObjName = 'useraccounts_list';

	// Page name
	function PageName() {
		return ew_CurrentPage();
	}

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		global $useraccounts;
		if ($useraccounts->UseTokenInUrl) $PageUrl .= "t=" . $useraccounts->TableVar . "&"; // Add page token
		return $PageUrl;
	}

	// Page URLs
	var $AddUrl;
	var $EditUrl;
	var $CopyUrl;
	var $DeleteUrl;
	var $ViewUrl;
	var $ListUrl;

	// Export URLs
	var $ExportPrintUrl;
	var $ExportHtmlUrl;
	var $ExportExcelUrl;
	var $ExportWordUrl;
	var $ExportXmlUrl;
	var $ExportCsvUrl;

	// Update URLs
	var $InlineAddUrl;
	var $InlineCopyUrl;
	var $InlineEditUrl;
	var $GridAddUrl;
	var $GridEditUrl;
	var $MultiDeleteUrl;
	var $MultiUpdateUrl;

	// Message
	function getMessage() {
		return @$_SESSION[EW_SESSION_MESSAGE];
	}

	function setMessage($v) {
		if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
			$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
		} else {
			$_SESSION[EW_SESSION_MESSAGE] = $v;
		}
	}

	// Show message
	function ShowMessage() {
		$sMessage = $this->getMessage();
		$this->Message_Showing($sMessage);
		if ($sMessage <> "") { // Message in Session, display
			echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
			$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
		}
	}

	// Validate page request
	function IsPageRequest() {
		global $objForm, $useraccounts;
		if ($useraccounts->UseTokenInUrl) {
			if ($objForm)
				return ($useraccounts->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($useraccounts->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

	//
	// Page class constructor
	//
	function cuseraccounts_list() {
		global $conn, $Language;

		// Language object
		$Language = new cLanguage();

		// Table object (useraccounts)
		$GLOBALS["useraccounts"] = new cuseraccounts();

		// Initialize URLs
		$this->ExportPrintUrl = $this->PageUrl() . "export=print";
		$this->ExportExcelUrl = $this->PageUrl() . "export=excel";
		$this->ExportWordUrl = $this->PageUrl() . "export=word";
		$this->ExportHtmlUrl = $this->PageUrl() . "export=html";
		$this->ExportXmlUrl = $this->PageUrl() . "export=xml";
		$this->ExportCsvUrl = $this->PageUrl() . "export=csv";
		$this->AddUrl = $GLOBALS["useraccounts"]->AddUrl();
		$this->InlineAddUrl = $this->PageUrl() . "a=add";
		$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
		$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
		$this->MultiDeleteUrl = "useraccountsdelete.php";
		$this->MultiUpdateUrl = "useraccountsupdate.php";

		// Page ID
		if (!defined("EW_PAGE_ID"))
			define("EW_PAGE_ID", 'list', TRUE);

		// Table name (for backward compatibility)
		if (!defined("EW_TABLE_NAME"))
			define("EW_TABLE_NAME", 'useraccounts', TRUE);

		// Start timer
		$GLOBALS["gsTimer"] = new cTimer();

		// Open connection
		$conn = ew_Connect();

		// List options
		$this->ListOptions = new cListOptions();
	}

	// 
	//  Page_Init
	//
	function Page_Init() {
		global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
		global $useraccounts;

		// Security
		$Security = new cAdvancedSecurity();
		if (!$Security->IsLoggedIn()) $Security->AutoLogin();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
		$Security->TablePermission_Loading();
		$Security->LoadCurrentUserLevel($this->TableName);
		$Security->TablePermission_Loaded();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
		if (!$Security->CanList()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
		$Security->UserID_Loading();
		if ($Security->IsLoggedIn()) $Security->LoadUserID();
		$Security->UserID_Loaded();
		if ($Security->IsLoggedIn() && $Security->CurrentUserID() == "") {
			$_SESSION[EW_SESSION_MESSAGE] = $Language->Phrase("NoPermission");
			$this->Page_Terminate();
		}

		// Get export parameters
		if (@$_GET["export"] <> "") {
			$useraccounts->Export = $_GET["export"];
		} elseif (ew_IsHttpPost()) {
			if (@$_POST["exporttype"] <> "")
				$useraccounts->Export = $_POST["exporttype"];
		} else {
			$useraccounts->setExportReturnUrl(ew_CurrentUrl());
		}
		$gsExport = $useraccounts->Export; // Get export parameter, used in header
		$gsExportFile = $useraccounts->TableVar; // Get export file, used in header
		if (in_array($useraccounts->Export, array("html", "email", "excel", "word")))
			echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
		if ($useraccounts->Export == "excel") {
			header('Content-Type: application/vnd.ms-excel;charset=utf-8');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
		}
		if ($useraccounts->Export == "word") {
			header('Content-Type: application/vnd.ms-word;charset=utf-8');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
		}
		if ($useraccounts->Export == "csv") {
			header('Content-Type: application/csv;charset=utf-8');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.csv');
		}

		// Global Page Loading event (in userfn*.php)
		Page_Loading();

		// Page Load event
		$this->Page_Load();
	}

	//
	// Page_Terminate
	//
	function Page_Terminate($url = "") {
		global $conn;

		// Page Unload event
		$this->Page_Unload();

		// Global Page Unloaded event (in userfn*.php)
		Page_Unloaded();

		 // Close connection
		$conn->Close();

		// Go to URL if specified
		$this->Page_Redirecting($url);
		if ($url <> "") {
			if (!EW_DEBUG_ENABLED && ob_get_length())
				ob_end_clean();
			header("Location: " . $url);
		}
		exit();
	}

	// Class variables
	var $ListOptions; // List options
	var $lDisplayRecs = 10;
	var $lStartRec;
	var $lStopRec;
	var $lTotalRecs = 0;
	var $lRecRange = 10;
	var $sSrchWhere = ""; // Search WHERE clause
	var $lRecCnt = 0; // Record count
	var $lEditRowCnt;
	var $lRowCnt;
	var $lRowIndex; // Row index
	var $lRecPerRow = 0;
	var $lColCnt = 0;
	var $sDbMasterFilter = ""; // Master filter
	var $sDbDetailFilter = ""; // Detail filter
	var $bMasterRecordExists;	
	var $sMultiSelectKey;
	var $RestoreSearch;

	//
	// Page main
	//
	function Page_Main() {
		global $objForm, $Language, $gsSearchError, $Security, $useraccounts;

		// Search filters
		$sSrchAdvanced = ""; // Advanced search filter
		$sSrchBasic = ""; // Basic search filter
		$sFilter = "";
		if ($this->IsPageRequest()) { // Validate request

			// Set up records per page
			$this->SetUpDisplayRecs();

			// Handle reset command
			$this->ResetCmd();

			// Set up list options
			$this->SetupListOptions();

			// Get basic search values
			$this->LoadBasicSearchValues();

			// Restore search parms from Session
			$this->RestoreSearchParms();

			// Call Recordset SearchValidated event
			$useraccounts->Recordset_SearchValidated();

			// Set up sorting order
			$this->SetUpSortOrder();

			// Get basic search criteria
			if ($gsSearchError == "")
				$sSrchBasic = $this->BasicSearchWhere();
		}

		// Restore display records
		if ($useraccounts->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $useraccounts->getRecordsPerPage(); // Restore from Session
		} else {
			$this->lDisplayRecs = 10; // Load default
		}

		// Load Sorting Order
		$this->LoadSortOrder();

		// Build search criteria
		if ($sSrchAdvanced <> "")
			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchAdvanced . ")" : $sSrchAdvanced;
		if ($sSrchBasic <> "")
			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchBasic. ")" : $sSrchBasic;

		// Call Recordset_Searching event
		$useraccounts->Recordset_Searching($this->sSrchWhere);

		// Save search criteria
		if ($this->sSrchWhere <> "") {
			if ($sSrchBasic == "")
				$this->ResetBasicSearchParms();
			$useraccounts->setSearchWhere($this->sSrchWhere); // Save to Session
			if (!$this->RestoreSearch) {
				$this->lStartRec = 1; // Reset start record counter
				$useraccounts->setStartRecordNumber($this->lStartRec);
			}
		} else {
			$this->sSrchWhere = $useraccounts->getSearchWhere();
		}

		// Build filter
		$sFilter = "";
		if (!$Security->CanList())
			$sFilter = "(0=1)"; // Filter all records
		if ($this->sDbDetailFilter <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
		if ($this->sSrchWhere <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;

		// Set up filter in session
		$useraccounts->setSessionWhere($sFilter);
		$useraccounts->CurrentFilter = "";

		// Export data only
		if (in_array($useraccounts->Export, array("html","word","excel","xml","csv","email"))) {
			$this->ExportData();
			if ($useraccounts->Export <> "email")
				$this->Page_Terminate(); // Terminate response
			exit();
		}
	}

	// Set up number of records displayed per page
	function SetUpDisplayRecs() {
		global $useraccounts;
		$sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
		if ($sWrk <> "") {
			if (is_numeric($sWrk)) {
				$this->lDisplayRecs = intval($sWrk);
			} else {
				if (strtolower($sWrk) == "all") { // Display all records
					$this->lDisplayRecs = -1;
				} else {
					$this->lDisplayRecs = 10; // Non-numeric, load default
				}
			}
			$useraccounts->setRecordsPerPage($this->lDisplayRecs); // Save to Session

			// Reset start position
			$this->lStartRec = 1;
			$useraccounts->setStartRecordNumber($this->lStartRec);
		}
	}

	// Return basic search SQL
	function BasicSearchSQL($Keyword) {
		global $useraccounts;
		$sKeyword = ew_AdjustSql($Keyword);
		$sWhere = "";
		$this->BuildBasicSearchSQL($sWhere, $useraccounts->username, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $useraccounts->password, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $useraccounts->zemail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $useraccounts->Activated, $Keyword);
		return $sWhere;
	}

	// Build basic search SQL
	function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {
		$sFldExpression = ($Fld->FldVirtualExpression <> "") ? $Fld->FldVirtualExpression : $Fld->FldExpression;
		$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;
		if ($lFldDataType == EW_DATATYPE_NUMBER) {
			$sWrk = $sFldExpression . " = " . ew_QuotedValue($Keyword, $lFldDataType);
		} else {
			$sWrk = $sFldExpression . " LIKE " . ew_QuotedValue("%" . $Keyword . "%", $lFldDataType);
		}
		if ($Where <> "") $Where .= " OR ";
		$Where .= $sWrk;
	}

	// Return basic search WHERE clause based on search keyword and type
	function BasicSearchWhere() {
		global $Security, $useraccounts;
		$sSearchStr = "";
		if (!$Security->CanSearch()) return "";
		$sSearchKeyword = $useraccounts->BasicSearchKeyword;
		$sSearchType = $useraccounts->BasicSearchType;
		if ($sSearchKeyword <> "") {
			$sSearch = trim($sSearchKeyword);
			if ($sSearchType <> "") {
				while (strpos($sSearch, "  ") !== FALSE)
					$sSearch = str_replace("  ", " ", $sSearch);
				$arKeyword = explode(" ", trim($sSearch));
				foreach ($arKeyword as $sKeyword) {
					if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " ";
					$sSearchStr .= "(" . $this->BasicSearchSQL($sKeyword) . ")";
				}
			} else {
				$sSearchStr = $this->BasicSearchSQL($sSearch);
			}
		}
		if ($sSearchKeyword <> "") {
			$useraccounts->setSessionBasicSearchKeyword($sSearchKeyword);
			$useraccounts->setSessionBasicSearchType($sSearchType);
		}
		return $sSearchStr;
	}

	// Clear all search parameters
	function ResetSearchParms() {
		global $useraccounts;

		// Clear search WHERE clause
		$this->sSrchWhere = "";
		$useraccounts->setSearchWhere($this->sSrchWhere);

		// Clear basic search parameters
		$this->ResetBasicSearchParms();
	}

	// Clear all basic search parameters
	function ResetBasicSearchParms() {
		global $useraccounts;
		$useraccounts->setSessionBasicSearchKeyword("");
		$useraccounts->setSessionBasicSearchType("");
	}

	// Restore all search parameters
	function RestoreSearchParms() {
		global $useraccounts;
		$bRestore = TRUE;
		if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

			// Restore basic search values
			$useraccounts->BasicSearchKeyword = $useraccounts->getSessionBasicSearchKeyword();
			$useraccounts->BasicSearchType = $useraccounts->getSessionBasicSearchType();
		}
	}

	// Set up sort parameters
	function SetUpSortOrder() {
		global $useraccounts;

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$useraccounts->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$useraccounts->CurrentOrderType = @$_GET["ordertype"];
			$useraccounts->UpdateSort($useraccounts->username); // username
			$useraccounts->UpdateSort($useraccounts->password); // password
			$useraccounts->UpdateSort($useraccounts->userlevel); // userlevel
			$useraccounts->UpdateSort($useraccounts->zemail); // email
			$useraccounts->UpdateSort($useraccounts->Activated); // Activated
			$useraccounts->setStartRecordNumber(1); // Reset start position
		}
	}

	// Load sort order parameters
	function LoadSortOrder() {
		global $useraccounts;
		$sOrderBy = $useraccounts->getSessionOrderBy(); // Get ORDER BY from Session
		if ($sOrderBy == "") {
			if ($useraccounts->SqlOrderBy() <> "") {
				$sOrderBy = $useraccounts->SqlOrderBy();
				$useraccounts->setSessionOrderBy($sOrderBy);
				$useraccounts->username->setSort("ASC");
			}
		}
	}

	// Reset command
	// cmd=reset (Reset search parameters)
	// cmd=resetall (Reset search and master/detail parameters)
	// cmd=resetsort (Reset sort parameters)
	function ResetCmd() {
		global $useraccounts;

		// Get reset command
		if (@$_GET["cmd"] <> "") {
			$sCmd = $_GET["cmd"];

			// Reset search criteria
			if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall")
				$this->ResetSearchParms();

			// Reset sorting order
			if (strtolower($sCmd) == "resetsort") {
				$sOrderBy = "";
				$useraccounts->setSessionOrderBy($sOrderBy);
				$useraccounts->username->setSort("");
				$useraccounts->password->setSort("");
				$useraccounts->userlevel->setSort("");
				$useraccounts->zemail->setSort("");
				$useraccounts->Activated->setSort("");
			}

			// Reset start position
			$this->lStartRec = 1;
			$useraccounts->setStartRecordNumber($this->lStartRec);
		}
	}

	// Set up list options
	function SetupListOptions() {
		global $Security, $useraccounts;

		// "view"
		$this->ListOptions->Add("view");
		$item =& $this->ListOptions->Items["view"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->CanView();
		$item->OnLeft = FALSE;

		// "edit"
		$this->ListOptions->Add("edit");
		$item =& $this->ListOptions->Items["edit"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->CanEdit();
		$item->OnLeft = FALSE;

		// "copy"
		$this->ListOptions->Add("copy");
		$item =& $this->ListOptions->Items["copy"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->CanAdd();
		$item->OnLeft = FALSE;

		// "detail_orders"
		$this->ListOptions->Add("detail_orders");
		$item =& $this->ListOptions->Items["detail_orders"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->AllowList('orders');
		$item->OnLeft = FALSE;

		// "detail_orders_date_teacher"
		$this->ListOptions->Add("detail_orders_date_teacher");
		$item =& $this->ListOptions->Items["detail_orders_date_teacher"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = True;
		$item->OnLeft = FALSE;

		// "checkbox"
		$this->ListOptions->Add("checkbox");
		$item =& $this->ListOptions->Items["checkbox"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->CanDelete();
		$item->OnLeft = FALSE;
		$item->Header = "<input type=\"checkbox\" name=\"key\" id=\"key\" class=\"phpmaker\" onclick=\"useraccounts_list.SelectAllKey(this);\">";

		// Call ListOptions_Load event
		$this->ListOptions_Load();
		if ($useraccounts->Export <> "" ||
			$useraccounts->CurrentAction == "gridadd" ||
			$useraccounts->CurrentAction == "gridedit")
			$this->ListOptions->HideAllOptions();
	}

	// Render list options
	function RenderListOptions() {
		global $Security, $Language, $useraccounts;
		$this->ListOptions->LoadDefault();

		// "view"
		$oListOpt =& $this->ListOptions->Items["view"];
		if ($Security->CanView() && $this->ShowOptionLink() && $oListOpt->Visible)
			$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . $Language->Phrase("ViewLink") . "</a>";

		// "edit"
		$oListOpt =& $this->ListOptions->Items["edit"];
		if ($Security->CanEdit() && $this->ShowOptionLink() && $oListOpt->Visible) {
			$oListOpt->Body = "<a href=\"" . $this->EditUrl . "\">" . $Language->Phrase("EditLink") . "</a>";
		}

		// "copy"
		$oListOpt =& $this->ListOptions->Items["copy"];
		if ($Security->CanAdd() && $this->ShowOptionLink() && $oListOpt->Visible) {
			$oListOpt->Body = "<a href=\"" . $this->CopyUrl . "\">" . $Language->Phrase("CopyLink") . "</a>";
		}

		// "detail_orders"
		$oListOpt =& $this->ListOptions->Items["detail_orders"];
		if ($Security->AllowList('orders') && $this->ShowOptionLink()) {
			$oListOpt->Body = $Language->Phrase("DetailLink") . $Language->TablePhrase("orders", "TblCaption");
			$oListOpt->Body = "<a href=\"orderslist.php?" . EW_TABLE_SHOW_MASTER . "=useraccounts&username=" . urlencode(strval($useraccounts->username->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";
		}

		// "detail_orders_date_teacher"
		$oListOpt =& $this->ListOptions->Items["detail_orders_date_teacher"];
		if (True) {
			$oListOpt->Body = $Language->Phrase("DetailLink") . $Language->TablePhrase("orders_date_teacher", "TblCaption");
			$oListOpt->Body = "<a href=\"orders_date_teacherreport.php?" . EW_TABLE_SHOW_MASTER . "=useraccounts&username=" . urlencode(strval($useraccounts->username->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";
		}

		// "checkbox"
		$oListOpt =& $this->ListOptions->Items["checkbox"];
		if ($Security->CanDelete() && $this->ShowOptionLink() && $oListOpt->Visible)
			$oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" id=\"key_m[]\" value=\"" . ew_HtmlEncode($useraccounts->username->CurrentValue) . "\" class=\"phpmaker\" onclick='ew_ClickMultiCheckbox(this);'>";
		$this->RenderListOptionsExt();

		// Call ListOptions_Rendered event
		$this->ListOptions_Rendered();
	}

	function RenderListOptionsExt() {
		global $Security, $Language, $useraccounts;
	}

	// Set up starting record parameters
	function SetUpStartRec() {
		global $useraccounts;
		if ($this->lDisplayRecs == 0)
			return;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
				$this->lStartRec = $_GET[EW_TABLE_START_REC];
				$useraccounts->setStartRecordNumber($this->lStartRec);
			} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
				$this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
				if (is_numeric($this->nPageNo)) {
					$this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
					if ($this->lStartRec <= 0) {
						$this->lStartRec = 1;
					} elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
						$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
					}
					$useraccounts->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $useraccounts->getStartRecordNumber();

		// Check if correct start record counter
		if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
			$this->lStartRec = 1; // Reset start record counter
			$useraccounts->setStartRecordNumber($this->lStartRec);
		} elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
			$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
			$useraccounts->setStartRecordNumber($this->lStartRec);
		} elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
			$this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
			$useraccounts->setStartRecordNumber($this->lStartRec);
		}
	}

	// Load basic search values
	function LoadBasicSearchValues() {
		global $useraccounts;
		$useraccounts->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];
		$useraccounts->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];
	}

	// Load recordset
	function LoadRecordset($offset = -1, $rowcnt = -1) {
		global $conn, $useraccounts;

		// Call Recordset Selecting event
		$useraccounts->Recordset_Selecting($useraccounts->CurrentFilter);

		// Load List page SQL
		$sSql = $useraccounts->SelectSQL();
		if ($offset > -1 && $rowcnt > -1)
			$sSql .= " LIMIT $offset, $rowcnt";

		// Load recordset
		$rs = ew_LoadRecordset($sSql);

		// Call Recordset Selected event
		$useraccounts->Recordset_Selected($rs);
		return $rs;
	}

	// Load row based on key values
	function LoadRow() {
		global $conn, $Security, $useraccounts;
		$sFilter = $useraccounts->KeyFilter();

		// Call Row Selecting event
		$useraccounts->Row_Selecting($sFilter);

		// Load SQL based on filter
		$useraccounts->CurrentFilter = $sFilter;
		$sSql = $useraccounts->SQL();
		$res = FALSE;
		$rs = ew_LoadRecordset($sSql);
		if ($rs && !$rs->EOF) {
			$res = TRUE;
			$this->LoadRowValues($rs); // Load row values

			// Call Row Selected event
			$useraccounts->Row_Selected($rs);
			$rs->Close();
		}
		return $res;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $useraccounts;
		$useraccounts->username->setDbValue($rs->fields('username'));
		$useraccounts->password->setDbValue($rs->fields('password'));
		$useraccounts->userlevel->setDbValue($rs->fields('userlevel'));
		$useraccounts->zemail->setDbValue($rs->fields('email'));
		$useraccounts->Activated->setDbValue($rs->fields('Activated'));
	}

	// Render row values based on field settings
	function RenderRow() {
		global $conn, $Security, $Language, $useraccounts;

		// Initialize URLs
		$this->ViewUrl = $useraccounts->ViewUrl();
		$this->EditUrl = $useraccounts->EditUrl();
		$this->InlineEditUrl = $useraccounts->InlineEditUrl();
		$this->CopyUrl = $useraccounts->CopyUrl();
		$this->InlineCopyUrl = $useraccounts->InlineCopyUrl();
		$this->DeleteUrl = $useraccounts->DeleteUrl();

		// Call Row_Rendering event
		$useraccounts->Row_Rendering();

		// Common render codes for all row types
		// username

		$useraccounts->username->CellCssStyle = ""; $useraccounts->username->CellCssClass = "";
		$useraccounts->username->CellAttrs = array(); $useraccounts->username->ViewAttrs = array(); $useraccounts->username->EditAttrs = array();

		// password
		$useraccounts->password->CellCssStyle = ""; $useraccounts->password->CellCssClass = "";
		$useraccounts->password->CellAttrs = array(); $useraccounts->password->ViewAttrs = array(); $useraccounts->password->EditAttrs = array();

		// userlevel
		$useraccounts->userlevel->CellCssStyle = ""; $useraccounts->userlevel->CellCssClass = "";
		$useraccounts->userlevel->CellAttrs = array(); $useraccounts->userlevel->ViewAttrs = array(); $useraccounts->userlevel->EditAttrs = array();

		// email
		$useraccounts->zemail->CellCssStyle = ""; $useraccounts->zemail->CellCssClass = "";
		$useraccounts->zemail->CellAttrs = array(); $useraccounts->zemail->ViewAttrs = array(); $useraccounts->zemail->EditAttrs = array();

		// Activated
		$useraccounts->Activated->CellCssStyle = ""; $useraccounts->Activated->CellCssClass = "";
		$useraccounts->Activated->CellAttrs = array(); $useraccounts->Activated->ViewAttrs = array(); $useraccounts->Activated->EditAttrs = array();
		if ($useraccounts->RowType == EW_ROWTYPE_VIEW) { // View row

			// username
			$useraccounts->username->ViewValue = $useraccounts->username->CurrentValue;
			$useraccounts->username->CssStyle = "";
			$useraccounts->username->CssClass = "";
			$useraccounts->username->ViewCustomAttributes = "";

			// password
			$useraccounts->password->ViewValue = "********";
			$useraccounts->password->CssStyle = "";
			$useraccounts->password->CssClass = "";
			$useraccounts->password->ViewCustomAttributes = "";

			// userlevel
			if ($Security->CanAdmin()) { // System admin
			if (strval($useraccounts->userlevel->CurrentValue) <> "") {
				switch ($useraccounts->userlevel->CurrentValue) {
					case "-1":
						$useraccounts->userlevel->ViewValue = "Administrator";
						break;
					case "0":
						$useraccounts->userlevel->ViewValue = "Default";
						break;
					default:
						$useraccounts->userlevel->ViewValue = $useraccounts->userlevel->CurrentValue;
				}
			} else {
				$useraccounts->userlevel->ViewValue = NULL;
			}
			} else {
				$useraccounts->userlevel->ViewValue = "********";
			}
			$useraccounts->userlevel->CssStyle = "";
			$useraccounts->userlevel->CssClass = "";
			$useraccounts->userlevel->ViewCustomAttributes = "";

			// email
			$useraccounts->zemail->ViewValue = $useraccounts->zemail->CurrentValue;
			$useraccounts->zemail->CssStyle = "";
			$useraccounts->zemail->CssClass = "";
			$useraccounts->zemail->ViewCustomAttributes = "";

			// Activated
			if (ew_ConvertToBool($useraccounts->Activated->CurrentValue)) {
				$useraccounts->Activated->ViewValue = "Y";
			} else {
				$useraccounts->Activated->ViewValue = "N";
			}
			$useraccounts->Activated->CssStyle = "";
			$useraccounts->Activated->CssClass = "";
			$useraccounts->Activated->ViewCustomAttributes = "";

			// username
			$useraccounts->username->HrefValue = "";
			$useraccounts->username->TooltipValue = "";

			// password
			$useraccounts->password->HrefValue = "";
			$useraccounts->password->TooltipValue = "";

			// userlevel
			$useraccounts->userlevel->HrefValue = "";
			$useraccounts->userlevel->TooltipValue = "";

			// email
			$useraccounts->zemail->HrefValue = "";
			$useraccounts->zemail->TooltipValue = "";

			// Activated
			$useraccounts->Activated->HrefValue = "";
			$useraccounts->Activated->TooltipValue = "";
		}

		// Call Row Rendered event
		if ($useraccounts->RowType <> EW_ROWTYPE_AGGREGATEINIT)
			$useraccounts->Row_Rendered();
	}

	// Export data in HTML/CSV/Word/Excel/XML/Email format
	function ExportData() {
		global $useraccounts;
		$utf8 = TRUE;
		$bSelectLimit = EW_SELECT_LIMIT;

		// Load recordset
		if ($bSelectLimit) {
			$this->lTotalRecs = $useraccounts->SelectRecordCount();
		} else {
			if ($rs = $this->LoadRecordset())
				$this->lTotalRecs = $rs->RecordCount();
		}
		$this->lStartRec = 1;

		// Export all
		if ($useraccounts->ExportAll) {
			$this->lDisplayRecs = $this->lTotalRecs;
			$this->lStopRec = $this->lTotalRecs;
		} else { // Export one page only
			$this->SetUpStartRec(); // Set up start record position

			// Set the last record to display
			if ($this->lDisplayRecs < 0) {
				$this->lStopRec = $this->lTotalRecs;
			} else {
				$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
			}
		}
		if ($bSelectLimit)
			$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);
		if (!$rs) {
			header("Content-Type:"); // Remove header
			header("Content-Disposition:");
			$this->ShowMessage();
			return;
		}
		if ($useraccounts->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($useraccounts, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($useraccounts->username);
				$ExportDoc->ExportCaption($useraccounts->password);
				$ExportDoc->ExportCaption($useraccounts->userlevel);
				$ExportDoc->ExportCaption($useraccounts->zemail);
				$ExportDoc->ExportCaption($useraccounts->Activated);
				$ExportDoc->EndExportRow();
			}
		}

		// Move to first record
		$this->lRecCnt = $this->lStartRec - 1;
		if (!$rs->EOF) {
			$rs->MoveFirst();
			if (!$bSelectLimit && $this->lStartRec > 1)
				$rs->Move($this->lStartRec - 1);
		}
		while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
			$this->lRecCnt++;
			if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
				$this->LoadRowValues($rs);

				// Render row
				$useraccounts->CssClass = "";
				$useraccounts->CssStyle = "";
				$useraccounts->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($useraccounts->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('username', $useraccounts->username->ExportValue($useraccounts->Export, $useraccounts->ExportOriginalValue));
					$XmlDoc->AddField('password', $useraccounts->password->ExportValue($useraccounts->Export, $useraccounts->ExportOriginalValue));
					$XmlDoc->AddField('userlevel', $useraccounts->userlevel->ExportValue($useraccounts->Export, $useraccounts->ExportOriginalValue));
					$XmlDoc->AddField('zemail', $useraccounts->zemail->ExportValue($useraccounts->Export, $useraccounts->ExportOriginalValue));
					$XmlDoc->AddField('Activated', $useraccounts->Activated->ExportValue($useraccounts->Export, $useraccounts->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($useraccounts->username);
					$ExportDoc->ExportField($useraccounts->password);
					$ExportDoc->ExportField($useraccounts->userlevel);
					$ExportDoc->ExportField($useraccounts->zemail);
					$ExportDoc->ExportField($useraccounts->Activated);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($useraccounts->Export <> "xml")
			$ExportDoc->ExportFooter();

		// Close recordset
		$rs->Close();

		// Clean output buffer
		if (!EW_DEBUG_ENABLED && ob_get_length())
			ob_end_clean();

		// Write BOM if utf-8
		if ($utf8 && !in_array($useraccounts->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

		// Write debug message if enabled
		if (EW_DEBUG_ENABLED)
			echo ew_DebugMsg();

		// Output data
		if ($useraccounts->Export == "xml") {
			header("Content-Type: text/xml");
			echo $XmlDoc->XML();
		} elseif ($useraccounts->Export == "email") {
			$this->ExportEmail($ExportDoc->Text);
			$this->Page_Terminate($useraccounts->ExportReturnUrl());
		} else {
			echo $ExportDoc->Text;
		}
	}

	// Export email
	function ExportEmail($EmailContent) {
		global $Language, $useraccounts;
		$sSender = @$_GET["sender"];
		$sRecipient = @$_GET["recipient"];
		$sCc = @$_GET["cc"];
		$sBcc = @$_GET["bcc"];
		$sContentType = @$_GET["contenttype"];

		// Subject
		$sSubject = ew_StripSlashes(@$_GET["subject"]);
		$sEmailSubject = $sSubject;

		// Message
		$sContent = ew_StripSlashes(@$_GET["message"]);
		$sEmailMessage = $sContent;

		// Check sender
		if ($sSender == "") {
			$this->setMessage($Language->Phrase("EnterSenderEmail"));
			return;
		}
		if (!ew_CheckEmail($sSender)) {
			$this->setMessage($Language->Phrase("EnterProperSenderEmail"));
			return;
		}

		// Check recipient
		if (!ew_CheckEmailList($sRecipient, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperRecipientEmail"));
			return;
		}

		// Check cc
		if (!ew_CheckEmailList($sCc, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperCcEmail"));
			return;
		}

		// Check bcc
		if (!ew_CheckEmailList($sBcc, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperBccEmail"));
			return;
		}

		// Check email sent count
		if (!isset($_SESSION[EW_EXPORT_EMAIL_COUNTER]))
			$_SESSION[EW_EXPORT_EMAIL_COUNTER] = 0;
		if (intval($_SESSION[EW_EXPORT_EMAIL_COUNTER]) > EW_MAX_EMAIL_SENT_COUNT) {
			$this->setMessage($Language->Phrase("ExceedMaxEmailExport"));
			return;
		}
		if ($sEmailMessage <> "") {
			$sEmailMessage = ew_RemoveXSS($sEmailMessage);
			$sEmailMessage .= ($sContentType == "url") ? "\r\n\r\n" : "<br><br>";
		}
		if ($sContentType == "url") {
			$sUrl = ew_ConvertFullUrl(ew_CurrentPage() . "?" . $this->ExportQueryString());
			$sEmailMessage .= $sUrl; // send URL only
		} else {
			$sEmailMessage .= $EmailContent; // send HTML
		}

		// Send email
		$Email = new cEmail();
		$Email->Sender = $sSender; // Sender
		$Email->Recipient = $sRecipient; // Recipient
		$Email->Cc = $sCc; // Cc
		$Email->Bcc = $sBcc; // Bcc
		$Email->Subject = $sEmailSubject; // Subject
		$Email->Content = $sEmailMessage; // Content
		$Email->Format = ($sContentType == "url") ? "text" : "html";
		$Email->Charset = EW_EMAIL_CHARSET;
		$EventArgs = array();
		$bEmailSent = FALSE;
		if ($useraccounts->Email_Sending($Email, $EventArgs))
			$bEmailSent = $Email->Send();

		// Check email sent status
		if ($bEmailSent) {

			// Update email sent count
			$_SESSION[EW_EXPORT_EMAIL_COUNTER]++;

			// Sent email success
			$this->setMessage($Language->Phrase("SendEmailSuccess"));
		} else {

			// Sent email failure
			$this->setMessage($Email->SendErrDescription);
		}
	}

	// Export QueryString
	function ExportQueryString() {
		global $useraccounts;

		// Initialize
		$sQry = "export=html";

		// Build QueryString for search
		if ($useraccounts->getSessionBasicSearchKeyword() <> "") {
			$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $useraccounts->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $useraccounts->getSessionBasicSearchType();
		}

		// Build QueryString for pager
		$sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . $useraccounts->getRecordsPerPage() . "&" . EW_TABLE_START_REC . "=" . $useraccounts->getStartRecordNumber();
		return $sQry;
	}

	// Add search QueryString
	function AddSearchQueryString(&$Qry, &$Fld) {
		global $useraccounts;
		$FldParm = substr($Fld->FldVar, 2);
		$FldSearchValue = $useraccounts->GetAdvancedSearch("x_" . $FldParm);
		if (strval($FldSearchValue) <> "") {
			$Qry .= "&x_" . $FldParm . "=" . FldSearchValue .
				"&z_" . $FldParm . "=" . $useraccounts->GetAdvancedSearch("z_" . $FldParm);
		}
		$FldSearchValue2 = $useraccounts->GetAdvancedSearch("y_" . $FldParm);
		if (strval($FldSearchValue2) <> "") {
			$Qry .= "&v_" . $FldParm . "=" . $useraccounts->GetAdvancedSearch("v_" . $FldParm) .
				"&y_" . $FldParm . "=" . $FldSearchValue2 .
				"&w_" . $FldParm . "=" . $useraccounts->GetAdvancedSearch("w_" . $FldParm);
		}
	}

	// Show link optionally based on User ID
	function ShowOptionLink() {
		global $Security, $useraccounts;
		if ($Security->IsLoggedIn()) {
			if (!$Security->IsAdmin()) {
				return $Security->IsValidUserID($useraccounts->username->CurrentValue);
			}
		}
		return TRUE;
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

	// Page Redirecting event
	function Page_Redirecting(&$url) {

		// Example:
		//$url = "your URL";

	}

	// Message Showing event
	function Message_Showing(&$msg) {

		// Example:
		//$msg = "your new message";

	}

	// Form Custom Validate event
	function Form_CustomValidate(&$CustomError) {

		// Return error message in CustomError
		return TRUE;
	}

	// ListOptions Load event
	function ListOptions_Load() {

		// Example: 
		//$this->ListOptions->Add("new");
		//$this->ListOptions->Items["new"]->OnLeft = TRUE; // Link on left
		//$this->ListOptions->MoveItem("new", 0); // Move to first column

	}

	// ListOptions Rendered event
	function ListOptions_Rendered() {

		// Example: 
		//$this->ListOptions->Items["new"]->Body = "xxx";

	}
}
?>
Return current item: Science Lab Inventory & Order Management