Location: PHPKode > projects > DataDivisions > includes/funcDisplaySetup.php
<?
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# DataDivisions, Build 1.0, 12/11/2003                                      #
# FileName: funcDisplaySetup.php                                            #
# File Description:                                                         #
#   Provides functions for setting up main and view details display pages   #
#   (back-end, middle and front-end functionality)                          #
#   Functions Included In This File:                                        #
#     genDropDownArchive(), switchDropDownArchiveText()                     #
#     genRelatedDisplaysOptions(), genSavedDisplaysInfo()                   #
#     startDataDisplay(), startDataDisplayViewDetails()                     #
#     defDisplayInfoSelected(), defDisplayTemplate()                        #
#     genDisplayFormatAndJS(), genMainDisplayHTMLDisplay()                  #
#     genViewDetailsHTMLDisplay()                                           #
#                                                                           #
# +-----------------------------------------------------------------------+ #
# | DataDivisions - Website Statistic Visualization Software              | #
# | Copyright (c) 2003, Brian Willison                                    | #
# +-----------------------------------------------------------------------+ #
# | The contents of this file are subject to the GNU General Public       | #
# | License version 2 (June 1991). This file and all its contents (incl.  | #
# | functions, methods, etc.) are free for general use within any         | #
# | community. This software is distributed with the intent to allow      | #
# | developers the opportunity to copy, manipulate and revamp this        | #
# | application in part or whole for best use cases.                      | #
# |                                                                       | #
# | This software is distributed "AS-IS" with no warranties of any kind   | #
# | either expressed or implied.                                          | #
# |                                                                       | #
# | Please refer to the GPL license document for more information:        | #
# | (_docs/gplLicense.pdf)                                                | #
# +-----------------------------------------------------------------------+ #
# | Developer, Designer, Initial Creator:                                 | #
# | Brian Willison (hide@address.com)                       | #
# +-----------------------------------------------------------------------+ #
# | Initial Download Reference:                                           | #
# | http://datadivisions.sourceforge.net                                  | #
# +-----------------------------------------------------------------------+ #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

require(funcDisplayLogFile); 									// functions to handle log-file info parsing/display
require(funcDisplayDirFile); 									// functions to handle directory info parsing/display
require(funcDisplayErrorFile);									// functions to handle error info parsing/display

// Function: Generate Drop Down Menu Of Archived Db Log Files
function genDropDownArchive($whichPage,$username) {
	$fileArray = array();
	// Read Db File Directory For Log Files
	$dirToRead = opendir(pathToRoot."_logDb");
	while ($file = readdir($dirToRead)) {
		if ($file != "." && $file != ".." && ereg("dataDivisionsLogger",$file) && (!ereg("tmp",$file))) {
			array_push($fileArray,$file);
		}
	}
	closedir($dirToRead);
	printf("<select name=\"monthView\" class=\"monthViewDropDown\" onchange=\"window.location.href = this.options[this.selectedIndex].value;\">\n\t\t");
	printf("<option value=\"\">Select Month</option>\n\t\t");
	for ($i=0; $i<sizeof($fileArray); $i++) {
		// Develop Just MonthYear From Db File Name
		$fileArray[$i] = ereg_replace("dataDivisionsLogger","",$fileArray[$i]);
		$fileArray[$i] = ereg_replace("\.txt","",$fileArray[$i]);
		if (isset($_SERVER['QUERY_STRING'])) {
			if (ereg("monthView",$_SERVER['QUERY_STRING'])) {
				$parsedQueryString = ereg_replace("monthView=[0-9]{6}","monthView=".$fileArray[$i],$_SERVER['QUERY_STRING']);
			} else {
				$parsedQueryString = $_SERVER['QUERY_STRING']."&monthView=".$fileArray[$i];
			}
		} else {
			$parsedQueryString = "&monthView=".$fileArray[$i];
		}
		printf("<option value=\"%s\">%s</option>\n\t\t",displayPage."?".$parsedQueryString,switchDropDownArchiveText($fileArray[$i]));
	}
	printf("</select>\n");
}

// Function: Switch Drop Down Archive Text To Full Month Name
function switchDropDownArchiveText($whichText) {
	$month = substr($whichText,0,2);
	$year = substr($whichText,2,4);
	switch ($month) {
		case "01":$month = "January";break;
		case "02":$month = "February";break;
		case "03":$month = "March";break;
		case "04":$month = "April";break;
		case "05":$month = "May";break;
		case "06":$month = "June";break;
		case "07":$month = "July";break;
		case "08":$month = "August";break;
		case "09":$month = "September";break;
		case "10":$month = "October";break;
		case "11":$month = "November";break;
		case "12":$month = "December";break;
	}
	return $month.", ".$year;
}

// Function: Generate Related Displays DropDown Options For View Details Pages
function genRelatedDisplaysOptions($monthView,$username) {
global $_GET;
	$htmlReturn = "<option value=\"".viewDetailsPage."?refNum1=".$_GET['refNum1']."&refNum1DisplayType=text&refNum1DisplayParam=square&displayParams=square&displayTemplate=viewDetailsSquare&popUpWidth=0&monthView=".$monthView."&username=".$username."\">View Related Information</option>\n\t\t\t";
	$dbOpen = dbConnect();
	$query = "SELECT * FROM ".dbTableDisplayInfo;
	$result = mysql_query($query);
	$numRows = mysql_num_rows($result);
	for ($i=0; $i<$numRows; $i++) {
		$array = mysql_fetch_array($result);
		if (!ereg("5",$array[2]))
			$htmlReturn .= "<option value=\"".viewDetailsPage."?refNum1=".$array[0]."&refNum1DisplayType=text&refNum1DisplayParam=".$_GET['refNum1DisplayParam']."&displayParams=".$_GET['refNum1DisplayParam']."&displayTemplate=".$_GET['displayTemplate']."&popUpWidth=0&monthView=".$monthView."&username=".$username."\">".$array[6]."</option>\n\t\t\t";
	}
	dbClose($dbOpen);
	return $htmlReturn;
}

// Function: Get Info Of Saved Displays And Print To Screen
function genSavedDisplaysInfo($whichPage,$username) {
	$savedDisplaysArray = array();
	$savedDisplaysHTMLHolder = "";
	$dbOpen = dbConnect();
	$query = "SELECT * FROM ".dbTableSavedDisplays." WHERE username='$username' ORDER BY timeStamp DESC";
	$result = mysql_query($query);
	$numRows = mysql_num_rows($result);
	if ($numRows == 0) {
		printf("<tr>\n\t\t\t<td></td>\n\t\t\t<td valign=\"top\"><p class=\"savedDisplay\">&#149;</td>\n\t\t\t<td valign=\"top\"><p class=\"savedDisplay\">You do not have any saved displays at this time.</td>\n\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t");
	} else {
		for ($i=$numRows; $i>0; $i--) {
			$array = mysql_fetch_array($result);
			printf("<tr onmouseover=\"setPointer(this, %d, 'over', '%s', '%s', '%s');\" onmouseout=\"setPointer(this, %d, 'out', '%s', '%s', '%s');\">\n\t\t\t",$i,savedDisplayContentColor,savedDisplayRowOverColor,appContentColor,$i,savedDisplayContentColor,savedDisplayRowOverColor,appContentColor);
			printf("<td></td>\n\t\t\t<td valign=\"top\"><p class=\"savedDisplay\">&#149;</td>\n\t\t\t<td valign=\"top\"><p class=\"savedDisplay\"><a href=\"%s\" class=\"savedDisplayLinks\">%s</a><br>\n\t\t\t<span class=\"savedDisplaySmall\">",displayPage."?".$array[2],$array[1]);
			printf("\n\t\t\t<a href=\"javascript:popWin('%s?displayUrl=(%s)&username=%s',%d,%d);\" class=\"savedDisplaySmallLinks\">Email</a> - ",emailDisplayPage,(ereg_replace("&","_",$array[2])),$array[0],appPopUpWinWidth,appEmailPopUpWinHeight);
			printf("\n\t\t\t<a href=\"javascript:popWin('%s?displayUrl=(%s)&username=%s',%d,%d);\" class=\"savedDisplaySmallLinks\">Edit</a> - ",editDisplayPage,(ereg_replace("&","_",$array[2])),$array[0],appPopUpWinWidth,appEditPopUpWinHeight);
			printf("\n\t\t\t<a href=\"javascript:popWin('%s?displayUrl=(%s)&username=%s&description=%s',%d,%d);\" class=\"savedDisplaySmallLinks\">Delete</a>",deleteDisplayPage,(ereg_replace("&","_",$array[2])),$array[0],(ereg_replace(" ","_",$array[1])),appPopUpWinWidth,appDeletePopUpWinHeight);
			printf("\n\t\t\t</span>\n\t\t\t</td>\n\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t");
			printf("<tr>\n\t\t\t<td valign=\"top\" colspan=\"4\"><img src=\"".imgUrl."spacer.gif\" width=\"1\" height=\"5\" border=\"0\"></td></tr>\n");
			if ($i != 1)
				printf("\t\t\t");
		}
	}
	dbClose($dbOpen);
}

// Function: Get Info Arrays For Display
function startDataDisplay($whichPage,$username,$_GET) {
	// Display RefNum Holder Arrays
	$dataInfoArray_1 = array(); 									// initialize array to hold refNum of display info
	$dataInfoArray_2 = array(); 									// initialize array to hold refNum of display info (for mult. display sizes)
	// If No Query String / Inaccurate Query String So Generate Random Display
	if (!isset($_GET['displayTemplate']) || !isset($_GET['displayParams']) || !isset($_GET['refNum1'])) {
		$numScreens = rand(1,4);									// randomly decide number of displays
		$dbOpen = dbConnect();										// open db connection
		$query = "SELECT * FROM ".dbTableDisplayInfo;				// define looking for all display possibilities from db
		$result = mysql_query($query);								// perform query on db to get all display possibilites
		$numRows = mysql_num_rows($result);							// get total number of display possibilites (for loop later)
		if ($numScreens != 3) {										// for all displays with same size (1,2,4)
			for ($i=0; $i<$numRows; $i++) {							//
				$array = mysql_fetch_array($result);				// initialize array to hold display possibility info.
				if (ereg($numScreens,$array[2])) {					// check if display possibility can work in a symmetrical display
					array_push($dataInfoArray_1,$array[0]); 		// push refNum of display onto data array for later use
				}
			}
		} else {													// for displays with diff. sizes (ie vert/horiz & 2 square)
			for ($i=0; $i<$numRows; $i++) {
				$array = mysql_fetch_array($result);
				if (ereg("2",$array[2])) {
					array_push($dataInfoArray_1,$array[0]); 		// push refNum onto data array for later use
				}
				if (ereg("4",$array[2])) {
					array_push($dataInfoArray_2,$array[0]); 		// push refNum onto data array for later use
				}
			}
		}
		dbClose($dbOpen);
		// Send Total Arrays To Defining/Minimizing Function (selects to continue for display)
		defDisplayInfoSelected($whichPage,$numScreens,$dataInfoArray_1,$dataInfoArray_2,$username);
	} else { // Displays Determined From Query String - Bypass Functions Until Generate Display Function
		// Get Reference Numbers From Query String
		$displayTypeArray = array();
		if (isset($_GET['refNum1'])) array_push($dataInfoArray_1,$_GET['refNum1']);
		if (isset($_GET['refNum2'])) array_push($dataInfoArray_1,$_GET['refNum2']);
		if (isset($_GET['refNum3'])) array_push($dataInfoArray_1,$_GET['refNum3']);
		if (isset($_GET['refNum4'])) array_push($dataInfoArray_1,$_GET['refNum4']);
		if (isset($_GET['refNum1DisplayType'])) array_push($displayTypeArray,$_GET['refNum1DisplayType']);
		if (isset($_GET['refNum2DisplayType'])) array_push($displayTypeArray,$_GET['refNum2DisplayType']);
		if (isset($_GET['refNum3DisplayType'])) array_push($displayTypeArray,$_GET['refNum3DisplayType']);
		if (isset($_GET['refNum4DisplayType'])) array_push($displayTypeArray,$_GET['refNum4DisplayType']);
		// Convert DisplayParams From Query String To Array
		$displayParams = explode(",",$_GET['displayParams']);
		genDisplayFormatAndJS($whichPage,$dataInfoArray_1,$displayTypeArray,$_GET['displayTemplate'],$displayParams,$username);
	}
}
// Function: Get Info Arrays For View Details Page Display
function startDataDisplayViewDetails($whichPage,$username,$_GET) {
	$dataInfoArray = array();
	$displayTypeArray = array();
	if (isset($_GET['refNum1'])) array_push($dataInfoArray,$_GET['refNum1']);
	if (isset($_GET['refNum2'])) array_push($dataInfoArray,$_GET['refNum2']);
	if (isset($_GET['refNum3'])) array_push($dataInfoArray,$_GET['refNum3']);
	if (isset($_GET['refNum4'])) array_push($dataInfoArray,$_GET['refNum4']);
	if (isset($_GET['refNum1DisplayType'])) array_push($displayTypeArray,$_GET['refNum1DisplayType']);
	if (isset($_GET['refNum2DisplayType'])) array_push($displayTypeArray,$_GET['refNum2DisplayType']);
	if (isset($_GET['refNum3DisplayType'])) array_push($displayTypeArray,$_GET['refNum3DisplayType']);
	if (isset($_GET['refNum4DisplayType'])) array_push($displayTypeArray,$_GET['refNum4DisplayType']);
	// Convert DisplayParams From Query String To Array
	// Displays Determined From Query String - Bypass Functions Until Generate Display Function
	$displayParams = explode(",",$_GET['displayParams']);
	genDisplayFormatAndJS($whichPage,$dataInfoArray,$displayTypeArray,$_GET['displayTemplate'],$displayParams,$username);
}
// Function: Define What Data To Display
function defDisplayInfoSelected($whichPage,$numScreens,$dataInfoArray_1,$dataInfoArray_2,$username) {
	$refNumArray = array();
	if ($numScreens != 3) {
		$refNumKeys = array_rand($dataInfoArray_1,$numScreens);
		if ($numScreens != 1) {
			for ($i=0; $i<$numScreens; $i++) {
				array_push($refNumArray,$dataInfoArray_1[$refNumKeys[$i]]);
			}
		} else {
			array_push($refNumArray,$dataInfoArray_1[$refNumKeys]);	// if $numScreens == 1, causes array error, so bypass
		}
	} else {
		$refNumKeys = array_rand($dataInfoArray_1,1);	// choose 1 @ vert/horiz
		array_push($refNumArray,$dataInfoArray_1[$refNumKeys]);
		$refNumKeys = array_rand($dataInfoArray_2,2);	// choose 2 @ square
		for ($j=0; $j< 2; $j++) {
			array_push($refNumArray,$dataInfoArray_2[$refNumKeys[$j]]);
		}
	}
	// Generate Template To Display Info
	defDisplayTemplate($whichPage,$refNumArray,$username);
}
// Function: Define Template To Display Info
function defDisplayTemplate($whichPage,$refNumArray,$username) {
	$template2Array = array(template2Horiz,template2Vert);
	$template3Array = array(template3LeftVert,template3RightVert,template3TopHoriz,template3BotHoriz);
	$numDisplays = sizeof($refNumArray);
	switch($numDisplays) {
		case 1:
			$displayTemplate = template1Full;
			$displayParamsInit = "1full";
		break;
		case 2:
			$templateNum = array_rand($template2Array);
			$displayTemplate = $template2Array[$templateNum];
			$displayParamsInit = (ereg("horiz",$displayTemplate)) ? "horiz,horiz" : "vert,vert";
		break;
		case 3:
			// Moves From Top-Left Clockwise
			$templateNum = array_rand($template3Array);
			$displayTemplate = $template3Array[$templateNum];
			if (ereg("bot",$displayTemplate))
				$displayParamsInit = "square,square,horiz";
			elseif (ereg("left",$displayTemplate))
				$displayParamsInit = "vert,square,square";
			elseif (ereg("right",$displayTemplate))
				$displayParamsInit = "square,vert,square";
			else
				$displayParamsInit = "horiz,square,square";
		break;
		case 4:
			$displayTemplate = template4Square;
			$displayParamsInit = "square,square,square,square";
		break;
	}
	// Convert DisplayParams To Array
	$displayParams = explode(",",$displayParamsInit);
	// Send References And Template Definition To Display Type/Raw Info. Function
	genDisplayFormatAndJS($whichPage,$refNumArray,"",$displayTemplate,$displayParams,$username);
}
// Function: Generate Display Type And Raw Info.
function genDisplayFormatAndJS($whichPage,$refNumArray,$displayTypeArray,$displayTemplate,$displayParams,$username) {
global $_GET;
	// Array To Hold All HTML Output
	$htmlForScreen = array();
	$displayTypeArrayForJS = array();
	$dbOpen = dbConnect();
	// Determine Individual Display Location Parameter (for JS:popWinViewDetails positioning)
	$numDisplays = sizeof($displayParams);
	$displayParamsString = implode(",",$displayParams);
	// Check If Display Types Already Set By Query String
	if (!is_array($displayTypeArray))
		$genRandomArray = TRUE;
	for ($i=0; $i<sizeof($refNumArray); $i++) {
		// Get All Available Display Types From Reference Number From Db
		$query = "SELECT * FROM ".dbTableDisplayInfo." WHERE refNum='$refNumArray[$i]'";
		$result = mysql_query($query);
		$array = mysql_fetch_array($result);
		// Determine Display Type (text,bar,plot)
		if ($whichPage != "viewDetails") {
			if (isset($genRandomArray)) {
				$displayTypeArray = explode(",",$array[3]);
				$displayType = $displayTypeArray[array_rand($displayTypeArray)];
			} else {
				$displayType = $displayTypeArray[$i];
			}
		// Handle View Details Text Type Display
		} else {
			$displayType = "text";
		}
		array_push($displayTypeArrayForJS,$displayType);
		switch ($displayParams[$i]) {
			case "1full":
				$displayIndivLoc = "1full";
			break;
			case "horiz":
				if ($i == 0) $displayIndivLoc = "botHoriz";
				elseif ($i == 1) $displayIndivLoc = "topHoriz";
				elseif ($i == 2) $displayIndivLoc = "topHoriz";
				else $displayIndivLoc = "center";					// default
			break;
			case "vert":
				if ($i == 0) $displayIndivLoc = "rightVert";
				elseif ($i == 1) $displayIndivLoc = "leftVert";
				else $displayIndivLoc = "center";					// default
			break;
			case "square":
				if ($i == 0) $displayIndivLoc = "rightSquare";
				elseif ($i == 1) {
					if ($displayParamsString == "square,square,square,square") $displayIndivLoc = "leftSquare";
					elseif ($displayParamsString == "square,square,horiz") $displayIndivLoc = "leftSquare";
					elseif ($displayParamsString == "horiz,square,square") $displayIndivLoc = "rightSquare";
					elseif ($displayParamsString == "vert,square,square") $displayIndivLoc = "leftSquare";
					else $displayIndivLoc = "center";				// default
				}
				elseif ($i == 2) {
					if ($displayParamsString == "square,square,square,square") $displayIndivLoc = "rightSquare";
					elseif ($displayParamsString == "vert,square,square") $displayIndivLoc = "leftSquare";
					elseif ($displayParamsString == "square,vert,square") $displayIndivLoc = "rightSquare";
					elseif ($displayParamsString == "horiz,square,square") $displayIndivLoc = "leftSquare";
					else $displayIndivLoc = "center";				// default
				}
				elseif ($i == 3) $displayIndivLoc = "leftSquare";
				else $displayIndivLoc = "center";					// default
			break;
		}
		// Main Call To Get Required Information And Generate HTML For Screen
		// Call User Function With: 			  pageName,refNum,displayType(text,bar,plot),displayParam(1full,sq...),individual display loc,limit (y/n),username
		$returnedHTML = @call_user_func($array[4],$whichPage,$array[0],$displayType,$displayParams[$i],$displayIndivLoc,$array[5],$username);
		// If refNum Is Not Valid - Generate Error Message In Individual Display Panel
		if (!$returnedHTML)
			printf("<p class=\"error\" align=\"center\"><br>%s",genErrorMsg(7));
		array_push($htmlForScreen,$returnedHTML);
	}
	// Write Javascript Variable For Save Display PopUp Window
	$jsDisplayUrl = "";
	for ($i=0; $i<sizeof($refNumArray); $i++) {
		$jsDisplayUrl .= "refNum".($i+1)."=".$refNumArray[$i]."_";
		$jsDisplayUrl .= "refNum".($i+1)."DisplayType=".$displayTypeArrayForJS[$i]."_";
		$jsDisplayUrl .= "refNum".($i+1)."DisplayParam=".$displayParams[$i]."_";
	}
	$jsDisplayUrl .= "displayTemplate=".$displayTemplate."_";
	$jsDisplayUrl .= "displayParams=";
	for ($i=0; $i<sizeof($displayParams); $i++) {
		$jsDisplayUrl .= $displayParams[$i];
		if ($i != sizeof($displayParams)-1)
			$jsDisplayUrl .= ",";
	}
	if (isset($_GET['monthView']) && $_GET['monthView'] != "")
		$jsDisplayUrl .= "_monthView=".$_GET['monthView'];
	printf("\t<script language=\"javascript\">var displayUrlForPopWin = '%s';</script>",$jsDisplayUrl);
	dbClose($dbOpen);
	// Send Formatted HTML Data To Screen Output Function
	if ($whichPage != "viewDetails")
		genMainDisplayHTMLDisplay($whichPage,$htmlForScreen,$displayTemplate,$username);
	else
		genViewDetailsHTMLDisplay($whichPage,$htmlForScreen,$displayTemplate,$username);
}
// Function: Generate HTML For Main Display Page
function genMainDisplayHTMLDisplay($whichPage,$htmlForScreen,$displayTemplate,$username) {
	$displayTemplate = templatePath.$displayTemplate.".tpl";
	$fp = fopen($displayTemplate, "r");
	if ($fp) {
		$htmlOutput = fread($fp,filesize($displayTemplate));
		// Replace Variables In HTML Template(s)
		$htmlOutput = ereg_replace("{appBorderColor}","".appBorderColor."",$htmlOutput);
		$htmlOutput = ereg_replace("{mainDisplayContentWidth}","".mainDisplayContentWidth."",$htmlOutput);
		$htmlOutput = ereg_replace("{mainDisplayContentWidthHalf}","".(int)(mainDisplayContentWidth/2)."",$htmlOutput);
		$htmlOutput = ereg_replace("{mainDisplayContentHeight}","".mainDisplayContentHeight."",$htmlOutput);
		$htmlOutput = ereg_replace("{mainDisplayContentHeightHalf}","".(int)(mainDisplayContentHeight/2)."",$htmlOutput);
		for ($i=0; $i<sizeof($htmlForScreen); $i++) {
			$htmlOutput = ereg_replace("{displayInfo_".$i."}",$htmlForScreen[$i],$htmlOutput);
		}
		fclose($fp);
	}
	// Finally...Print To Screen
	echo $htmlOutput;
}
// Function: Generate HTML For View Details Page
function genViewDetailsHTMLDisplay($whichPage,$htmlForScreen,$displayTemplate,$username) {
	$displayTemplate = templatePath.$displayTemplate.".htm";
	$fp = fopen($displayTemplate, "r");
	if ($fp) {
		$htmlOutput = fread($fp,filesize($displayTemplate));
		// Replace Variables In HTML Template(s)
		$htmlOutput = ereg_replace("{appBorderColor}","".appBorderColor."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentWidth}","".viewDetailsContentWidth."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentWidthHalf}","".(int)(viewDetailsContentWidth/2)."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentHeight}","".viewDetailsContentHeight."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentHeightHalf}","".(int)(viewDetailsContentHeight/2)."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentHeightForDiv}","".(viewDetailsContentHeight-26)."",$htmlOutput);
		$htmlOutput = ereg_replace("{viewDetailsContentHeightHalfForDiv}","".(int)((viewDetailsContentHeight/2)-26)."",$htmlOutput);
		$htmlOutput = ereg_replace("{imgUrl}","".imgUrl."",$htmlOutput);
		$htmlOutput = ereg_replace("{websiteName}","".websiteName."",$htmlOutput);
		$htmlOutput = ereg_replace("{funcJavaScrollViewDetailsFile}","".baseUrl.funcJavaScrollViewDetailsFile."",$htmlOutput);
		$htmlOutput = ereg_replace("{relatedDisplaysOptions}",genRelatedDisplaysOptions(monthViewForLog,$username),$htmlOutput);
		$htmlOutput = ereg_replace("{bottomNavRowColor}",savedDisplayHeaderColor,$htmlOutput);
		for ($i=0; $i<sizeof($htmlForScreen); $i++) {
			$htmlOutput = ereg_replace("{viewDetailsInfo_".$i."}",$htmlForScreen[$i],$htmlOutput);
		}
		fclose($fp);
	}
	// Finally...Print To Screen
	echo $htmlOutput;
}
?>
Return current item: DataDivisions