$extension = '../' . $extension; } require $extension . $pathFile; $template = new Template(); $agID = -1; $errorMessages = array(); $selected = -1; $sqlResult = new ReadOnlyResultSet(null); if (isset($_REQUEST['agID'])) { $errorMessages = process_Form($sqlResult, $template, $agID, $errorMessages); $selected = $_REQUEST['agID']; $errorMessages = get_AG($template, $errorMessages); show_Form($selected, $sqlResult, $template, $errorMessages); } else { $errorMessages = get_AG($template, $errorMessages); show_Form($selected, null, $template, $errorMessages); } function process_Form($sqlResult, $template, $agID, $errorMessages) { $agID = $_REQUEST['agID']; $viewerM = new RowManager_ViewerManager(); $viewerAccessGroupM = new RowManager_ViewerAccessGroupManager(); $join = new JoinPair($viewerM->getJoinOnFieldX('viewer_id'), $viewerAccessGroupM->getJoinOnFieldX('viewer_id')); $MTM = new MultiTableManager(); $MTM->addRowManager($viewerAccessGroupM); $MTM->addRowManager($viewerM, $join); $MTM->constructSearchCondition('accessgroup_id', '=', $agID, true); $MTM->addSortField('viewer_userID'); $sqlResult = $MTM->find(); if (!isset($sqlResult)) { $errorMessages = 'Failed to join database to get label';
$extension = ''; // Attempt to find proper directory from current page to Root ... while (!file_exists($extension . $pathFile)) { $extension = '../' . $extension; } require $extension . $pathFile; //set global variables needed during the program $template = new Template(); $errorMessages = array(); $sqlResult = new ReadOnlyResultSet(null); //check if we're searching for someone yet if (isset($_REQUEST['fName']) || isset($_REQUEST['lName'])) { $errorMessages = process_Form($sqlResult, $template, $errorMessages); show_Form($template, $errorMessages); } else { show_Form($template, $errorMessages); } function process_Form($sqlResult, $template, $errorMessages) { //get the names that are being searched $fName = $_REQUEST['fName']; $lName = $_REQUEST['lName']; //create the needed row managers $personM = new RowManager_PersonManager(); $accessM = new RowManager_AccessManager(); $viewerM = new RowManager_ViewerManager(); //setup the join pair needed $join = new JoinPair($personM->getJoinOnFieldX('person_id'), $accessM->getJoinOnFieldX('person_id')); //create the multi table manager and initialize it $MTM = new MultiTableManager(); $MTM->addRowManager($personM);