Location: PHPKode > projects > Science Lab Inventory & Order Management > sciencelabinv/roomsview.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 "roomsinfo.php" ?>
<?php include "useraccountsinfo.php" ?>
<?php include "userfn7.php" ?>
<?php

// Create page object
$rooms_view = new crooms_view();
$Page =& $rooms_view;

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

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

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

// page properties
rooms_view.PageID = "view"; // page ID
rooms_view.FormID = "froomsview"; // form ID
var EW_PAGE_ID = rooms_view.PageID; // for backward compatibility

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

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

//-->
</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 } ?>
<p><span class="phpmaker"><?php echo $Language->Phrase("View") ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $rooms->TableCaption() ?>
<br><br>
<?php if ($rooms->Export == "") { ?>
<a href="<?php echo $rooms_view->ListUrl ?>"><?php echo $Language->Phrase("BackToList") ?></a>&nbsp;
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $rooms_view->AddUrl ?>"><?php echo $Language->Phrase("ViewPageAddLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->CanEdit()) { ?>
<a href="<?php echo $rooms_view->EditUrl ?>"><?php echo $Language->Phrase("ViewPageEditLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $rooms_view->CopyUrl ?>"><?php echo $Language->Phrase("ViewPageCopyLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->CanDelete()) { ?>
<a href="<?php echo $rooms_view->DeleteUrl ?>"><?php echo $Language->Phrase("ViewPageDeleteLink") ?></a>&nbsp;
<?php } ?>
<a href="storeslist.php?<?php echo EW_TABLE_SHOW_MASTER ?>=rooms&id=<?php echo urlencode(strval($rooms->id->CurrentValue)) ?>"><?php echo $Language->Phrase("ViewPageDetailLink") ?><?php echo $Language->TablePhrase("stores", "TblCaption") ?>
</a>
&nbsp;
<?php if ($Security->AllowList('orders')) { ?>
<a href="orderslist.php?<?php echo EW_TABLE_SHOW_MASTER ?>=rooms&id=<?php echo urlencode(strval($rooms->id->CurrentValue)) ?>"><?php echo $Language->Phrase("ViewPageDetailLink") ?><?php echo $Language->TablePhrase("orders", "TblCaption") ?>
</a>
&nbsp;
<?php } ?>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$rooms_view->ShowMessage();
?>
<p>
<?php if ($rooms->Export == "") { ?>
<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($rooms_view->Pager)) $rooms_view->Pager = new cPrevNextPager($rooms_view->lStartRec, $rooms_view->lDisplayRecs, $rooms_view->lTotalRecs) ?>
<?php if ($rooms_view->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 ($rooms_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 ($rooms_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 $rooms_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($rooms_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 ($rooms_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 $rooms_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($rooms_view->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 } ?>
		</td>
	</tr>
</table>
</form>
<br>
<?php } ?>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<?php if ($rooms->id->Visible) { // id ?>
	<tr<?php echo $rooms->id->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $rooms->id->FldCaption() ?></td>
		<td<?php echo $rooms->id->CellAttributes() ?>>
<div<?php echo $rooms->id->ViewAttributes() ?>><?php echo $rooms->id->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($rooms->name->Visible) { // name ?>
	<tr<?php echo $rooms->name->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $rooms->name->FldCaption() ?></td>
		<td<?php echo $rooms->name->CellAttributes() ?>>
<div<?php echo $rooms->name->ViewAttributes() ?>><?php echo $rooms->name->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($rooms->description->Visible) { // description ?>
	<tr<?php echo $rooms->description->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $rooms->description->FldCaption() ?></td>
		<td<?php echo $rooms->description->CellAttributes() ?>>
<div<?php echo $rooms->description->ViewAttributes() ?>><?php echo $rooms->description->ViewValue ?></div></td>
	</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<?php if ($rooms->Export == "") { ?>
<br>
<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($rooms_view->Pager)) $rooms_view->Pager = new cPrevNextPager($rooms_view->lStartRec, $rooms_view->lDisplayRecs, $rooms_view->lTotalRecs) ?>
<?php if ($rooms_view->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 ($rooms_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 ($rooms_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 $rooms_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($rooms_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 ($rooms_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $rooms_view->PageUrl() ?>start=<?php echo $rooms_view->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 $rooms_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($rooms_view->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 } ?>
		</td>
	</tr>
</table>
</form>
<?php } ?>
<p>
<?php if ($rooms->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
$rooms_view->Page_Terminate();
?>
<?php

//
// Page class
//
class crooms_view {

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

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

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

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

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		global $rooms;
		if ($rooms->UseTokenInUrl) $PageUrl .= "t=" . $rooms->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, $rooms;
		if ($rooms->UseTokenInUrl) {
			if ($objForm)
				return ($rooms->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($rooms->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

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

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

		// Table object (rooms)
		$GLOBALS["rooms"] = new crooms();

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

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

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

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

		// Open connection
		$conn = ew_Connect();
	}

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

		// Security
		$Security = new cAdvancedSecurity();
		if (!$Security->IsLoggedIn()) $Security->AutoLogin();
		$Security->TablePermission_Loading();
		$Security->LoadCurrentUserLevel($this->TableName);
		$Security->TablePermission_Loaded();
		$Security->UserID_Loading();
		if ($Security->IsLoggedIn()) $Security->LoadUserID();
		$Security->UserID_Loaded();

		// 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();
	}
	var $lDisplayRecs = 1;
	var $lStartRec;
	var $lStopRec;
	var $lTotalRecs = 0;
	var $lRecRange = 10;
	var $lRecCnt;
	var $arRecKey = array();

	//
	// Page main
	//
	function Page_Main() {
		global $Language, $rooms;

		// Load current record
		$bLoadCurrentRecord = FALSE;
		$sReturnUrl = "";
		$bMatchRecord = FALSE;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET["id"] <> "") {
				$rooms->id->setQueryStringValue($_GET["id"]);
				$this->arRecKey["id"] = $rooms->id->QueryStringValue;
			} else {
				$bLoadCurrentRecord = TRUE;
			}

			// Get action
			$rooms->CurrentAction = "I"; // Display form
			switch ($rooms->CurrentAction) {
				case "I": // Get a record to display
					$this->lStartRec = 1; // Initialize start position
					if ($rs = $this->LoadRecordset()) // Load records
						$this->lTotalRecs = $rs->RecordCount(); // Get record count
					if ($this->lTotalRecs <= 0) { // No record found
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$this->Page_Terminate("roomslist.php"); // Return to list page
					} elseif ($bLoadCurrentRecord) { // Load current record position
						$this->SetUpStartRec(); // Set up start record position

						// Point to current record
						if (intval($this->lStartRec) <= intval($this->lTotalRecs)) {
							$bMatchRecord = TRUE;
							$rs->Move($this->lStartRec-1);
						}
					} else { // Match key values
						while (!$rs->EOF) {
							if (strval($rooms->id->CurrentValue) == strval($rs->fields('id'))) {
								$rooms->setStartRecordNumber($this->lStartRec); // Save record position
								$bMatchRecord = TRUE;
								break;
							} else {
								$this->lStartRec++;
								$rs->MoveNext();
							}
						}
					}
					if (!$bMatchRecord) {
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$sReturnUrl = "roomslist.php"; // No matching record, return to list
					} else {
						$this->LoadRowValues($rs); // Load row values
					}
			}
		} else {
			$sReturnUrl = "roomslist.php"; // Not page request, return to list
		}
		if ($sReturnUrl <> "")
			$this->Page_Terminate($sReturnUrl);

		// Render row
		$rooms->RowType = EW_ROWTYPE_VIEW;
		$this->RenderRow();
	}

	// Set up starting record parameters
	function SetUpStartRec() {
		global $rooms;
		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];
				$rooms->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;
					}
					$rooms->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $rooms->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
			$rooms->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
			$rooms->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
			$rooms->setStartRecordNumber($this->lStartRec);
		}
	}

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $rooms;
		$rooms->id->setDbValue($rs->fields('id'));
		$rooms->name->setDbValue($rs->fields('name'));
		$rooms->description->setDbValue($rs->fields('description'));
	}

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

		// Initialize URLs
		$this->ExportPrintUrl = $this->PageUrl() . "export=print&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->ExportHtmlUrl = $this->PageUrl() . "export=html&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->ExportExcelUrl = $this->PageUrl() . "export=excel&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->ExportWordUrl = $this->PageUrl() . "export=word&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->ExportXmlUrl = $this->PageUrl() . "export=xml&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->ExportCsvUrl = $this->PageUrl() . "export=csv&" . "id=" . urlencode($rooms->id->CurrentValue);
		$this->AddUrl = $rooms->AddUrl();
		$this->EditUrl = $rooms->EditUrl();
		$this->CopyUrl = $rooms->CopyUrl();
		$this->DeleteUrl = $rooms->DeleteUrl();
		$this->ListUrl = $rooms->ListUrl();

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

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

		$rooms->id->CellCssStyle = ""; $rooms->id->CellCssClass = "";
		$rooms->id->CellAttrs = array(); $rooms->id->ViewAttrs = array(); $rooms->id->EditAttrs = array();

		// name
		$rooms->name->CellCssStyle = ""; $rooms->name->CellCssClass = "";
		$rooms->name->CellAttrs = array(); $rooms->name->ViewAttrs = array(); $rooms->name->EditAttrs = array();

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

			// id
			$rooms->id->ViewValue = $rooms->id->CurrentValue;
			$rooms->id->CssStyle = "";
			$rooms->id->CssClass = "";
			$rooms->id->ViewCustomAttributes = "";

			// name
			$rooms->name->ViewValue = $rooms->name->CurrentValue;
			$rooms->name->CssStyle = "";
			$rooms->name->CssClass = "";
			$rooms->name->ViewCustomAttributes = "";

			// description
			$rooms->description->ViewValue = $rooms->description->CurrentValue;
			$rooms->description->CssStyle = "";
			$rooms->description->CssClass = "";
			$rooms->description->ViewCustomAttributes = "";

			// id
			$rooms->id->HrefValue = "";
			$rooms->id->TooltipValue = "";

			// name
			$rooms->name->HrefValue = "";
			$rooms->name->TooltipValue = "";

			// description
			$rooms->description->HrefValue = "";
			$rooms->description->TooltipValue = "";
		}

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

	// 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";

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