function PrintData($Indx, $Condition) { // Get Data from DB $SQL = 'SELECT ' . $this->FieldList . ' FROM ' . $this->TableList . ' WHERE ' . $Condition; if (isset($this->OrderByList) == true) { $SQL .= ' ORDER BY ' . $this->OrderByList; } else { $SQL .= ' ORDER BY ' . $this->FieldList; } $DataDB = new Database_MySQL(); $DataDB->ConnectToDB($this->DatabaseName, DB_PATH, DB_USER, DB_PWORD); $DataDB->RunSQL($SQL); // if this is an HTML report ... if ($this->isExcelSheet == false) { // Set Color to RowColorOn... $BGColor = $this->RowColorOn; } else { // Set Format to EXCEL_FORMAT_TEXT_COLOR_ON $BGColor = EXCEL_FORMAT_TEXT_COLOR_ON; } // Add Leading Spacers for ($SpacerIndx = 0; $SpacerIndx < $Indx; $SpacerIndx++) { $this->AddSpacer(); } // For each Field in List for ($FieldIndx = 0; $FieldIndx < count($this->aFields); $FieldIndx++) { // Add Heading for Field $Heading = $this->ReturnFieldHeading($this->aFields[$FieldIndx]); $this->WriteHeading($Heading, $BGColor); // if this is an HTML report ... /* if ( $this->isExcelSheet == false ) { // Add Header to output table... $this->OutputTable->AddTableCell( '<strong>'.$Heading.'</strong>', $BGColor.' class="modify" valign="bottom" '); } else { // Add Header to Excel Workbook $this->ExcelWorkBook->AddCell( $Heading, EXCEL_FORMAT_HEADING ); } */ } // Next Field // For each value returned while ($this->Row = $DataDB->RetrieveRow()) { $BGColor = $this->ToggleColor($BGColor); // Add Leading Spacers for ($SpacerIndx = 0; $SpacerIndx < $Indx; $SpacerIndx++) { $this->AddSpacer(); } // For each Field in List for ($FieldIndx = 0; $FieldIndx < count($this->aFields); $FieldIndx++) { // Output Value $TempValue = $this->ReturnFieldValue($this->aFields[$FieldIndx]); // if this is an HTML report ... if ($this->isExcelSheet == false) { // Add Data to output table... $this->OutputTable->AddTableCell($TempValue, $BGColor . ' class="modify" valign="top" '); } else { // Add Data to Excel Workbook $this->ExcelWorkBook->AddCell($TempValue, $BGColor); } } // Next Field } // next // if this is an HTML report ... if ($this->isExcelSheet == false) { for ($SpacerIndx = 0; $SpacerIndx < $Indx; $SpacerIndx++) { $this->AddSpacer(); } // Add a Row of Spacers ... $this->OutputTable->AddTableCell('<hr width="100%" size="1" noshade color="#223450">', $this->SpacerCell, DISPLAYOBJECT_TYPE_HTML, $this->NumColumns - $SpacerIndx); } else { // Add 2 Rows of Spaces for ($SpacerIndx = 0; $SpacerIndx < $this->NumColumns * 2; $SpacerIndx++) { $this->AddSpacer(); } // // Add Data to Excel Workbook // $this->ExcelWorkBook->AddCell( '-----------------------', '' ,$this->NumColumns - $SpacerIndx ); } }
function CreateBar() { $this->Labels = new MultiLingual_Labels('AI', 'NavBar', 'NavBar', $this->LanguageID); // Get List of User's Groups as a Group Clause $SQL = 'SELECT * FROM login.logingroups WHERE login_ViewerID=' . $this->ViewerID; if ($this->DB->RunSQL($SQL) == true) { $GroupClause = ''; while ($Row = $this->DB->RetrieveRow()) { if ($GroupClause != '') { $GroupClause .= ' OR grouplist_id=' . $Row['grouplist_id']; } else { $GroupClause = 'grouplist_id=' . $Row['grouplist_id']; } } // make sure "All" Group (Group ID = 0) is included ... if ($GroupClause != '') { $GroupClause = '(' . $GroupClause . ' OR grouplist_id=0)'; } else { $GroupClause = 'grouplist_id=0'; } // Now Get List of Menu's $SQL = 'SELECT * FROM login.navbarmenu WHERE ' . $GroupClause . ' OR viewer_id=' . $this->ViewerID; $SQL .= ' ORDER BY navbarmenu_order'; if ($this->DB->RunSQL($SQL) == true) { // Begin Main Menu $MenuList = "with(milonic=new menuname(\"Main Menu\")){\n"; $MenuList .= " style=barStyle;\n"; $MenuList .= " alwaysvisible=1;\n"; $MenuList .= " orientation=\"horizontal\";\n"; $MenuList .= " overfilter=\"\";\n"; $MenuList .= " position=\"relative\";\n"; $MenuListCounter = 1; // Prep a DB Object for working with MenuEntries $MenuEntryDB = new Database_MySQL(); $MenuEntryDB->ConnectToDB('login', DB_PATH, DB_USER, DB_PWORD); $MenuEntryList = ''; // For Each Menu Item while ($Row = $this->DB->RetrieveRow()) { $CurrentMenuEntries = array(); // Get MenuEntries Related To this MenuItem $SQL = 'SELECT * FROM login.navbarentries WHERE navbarmenu_id=' . $Row['navbarmenu_id']; $SQL .= ' AND (' . $GroupClause . ' OR viewer_id=' . $this->ViewerID . ') '; $SQL .= ' ORDER BY navbarentries_order '; if ($MenuEntryDB->RunSQL($SQL) == true) { $TempMenuEntry = "with(milonic=new menuname(\"menu" . $MenuListCounter . "\")){\n"; $TempMenuEntry .= " style=menuStyle;\n"; $TempMenuEntry .= " overflow=\"scroll\";\n"; $MenuEntryCounter = 1; while ($EntryRow = $MenuEntryDB->RetrieveRow()) { if (array_key_exists($EntryRow['navbarentries_cmd'], $CurrentMenuEntries) == false) { $Temp = $this->Labels->Label($EntryRow['navbarentries_label']); // if link is local to this site then if ($EntryRow['navbarentries_islocal'] == 1) { // add an entry with the site root path appended... $TempMenuEntry .= "aI(\"text=" . $Temp . ";url=" . NAVBAR_PATH . $EntryRow['navbarentries_cmd'] . ";title=" . $EntryRow['navbarentries_title'] . ";\");\n"; } else { // else add an entry with http:// appended... $TempMenuEntry .= "aI(\"text=" . $Temp . ";url=http://" . $EntryRow['navbarentries_cmd'] . ";title=" . $EntryRow['navbarentries_title'] . ";\");\n"; } $MenuEntryCounter++; $CurrentMenuEntries[$EntryRow['navbarentries_cmd']] = 0; } } $TempMenuEntry .= "}\n\n"; } else { echo 'NavBar::CreateBar:Unable to get Sub List of Main MenuList [' . $Row['navbarmenu_id'] . '] [' . $SQL . ']<br>'; } // Add Current Main Menu Entry $Temp = $this->Labels->Label($Row['navbarmenu_label']); $MenuList .= " aI(\"text=" . $Temp . ";showmenu=menu" . $MenuListCounter . "\");\n"; // Save Current Menu Entry List $MenuEntryList .= $TempMenuEntry; $MenuListCounter++; } $MenuList .= "}\n\ndrawMenus();\n"; // Now Save all this data in NavBarData ... $this->NavBarData['MainMenu'] = $MenuList; $this->NavBarData['SubMenus'] = $MenuEntryList; } else { echo 'NavBar::CreateBar:Unable to get Main MenuList [' . $SQL . ']<br>'; } } else { echo 'NavBar::CreateBar: Unable to get Viewer\'s List Of Groups.<br>'; } }