function perform() { // set display requirements $result = array('renderer' => 'template_renderer.inc', 'pageTitle' => SITE_NAME . ' : Library Admin ', 'content' => 'content/admin/libraryAdmin.php'); // don't lose the db! $db = $_REQUEST['db']; // where are we? $uf = new UserFinder($db); $user = $uf->findById($_SESSION['userId']); $result['user'] = $user; $lf = new LibraryFinder($db); $libraryList = $lf->getAllLibraries(); $result['libraryList'] = $libraryList; if (isset($_POST['library_id'])) { $libraryID = $_POST['library_id']; $library = $lf->getLibraryName($libraryID); } else { $library = $user['library_short_name']; $libraryID = $user['library_id']; } $result['library_id'] = $libraryID; $result['library'] = $library; $locationFinder = new LocationFinder($db); $result['locationList'] = $locationFinder->findByLibraryID($libraryID); $result['distinctLocationList'] = $locationFinder->getDistinctLocations(); $af = new AdminFinder($db); $adminTableList = $af->getAdminTables(); $result['adminTables'] = $adminTableList; return $result; }
function perform() { // set display requirements $result = array('renderer' => 'template_renderer.inc', 'pageTitle' => SITE_NAME . ' : Library Admin', 'content' => 'content/admin/libraryEditForm.php'); // don't lose the db! $db = $_REQUEST['db']; // where are we? $uf = new UserFinder($db); $user = $uf->findById($_SESSION['userId']); $result['user'] = $user; $af = new AdminFinder($db); $adminTableList = $af->getAdminTables(); $result['adminTables'] = $adminTableList; $lf = new LibraryFinder($db); $table = 'libraries'; $result['everything'] = $lf->getAllLibraries(); if (isset($_POST['library_id'])) { $libraryID = $_POST['library_id']; $library = $lf->getLibraryName($libraryID); } else { $library = $user['library_short_name']; $libraryID = $user['library_id']; } $af = new AdminFinder($db); $parent_table_data = $af->getAdminTableRow($table); $result['parent_table_data'] = $parent_table_data; return $result; }
function perform() { // set display requirements $result = array('renderer' => 'template_renderer.inc', 'pageTitle' => SITE_NAME . ' : Option Admin ', 'content' => 'content/admin/optionAdminForm.php'); // don't lose the db! $db = $_REQUEST['db']; // where are we? $uf = new UserFinder($db); $user = $uf->findById($_SESSION['userId']); $result['user'] = $user; $af = new AdminFinder($db); $adminTableList = $af->getAdminTables(); $result['adminTables'] = $adminTableList; if (isset($_GET['table'])) { $table = $_GET['table']; } //echo($table); $result['everything'] = $af->getTableFields($table); //var_dump($result['everything']); $lf = new LibraryFinder($db); $libraryList = $lf->getAllLibraries(); $result['libraryList'] = $libraryList; if (isset($_GET['library_id'])) { $libraryID = $_GET['library_id']; $library = $lf->getLibraryName($libraryID); } else { $library = $user['library_short_name']; $libraryID = $user['library_id']; } if (isset($table)) { $parent_table = $table; } else { $parent_table = 'locations'; } $af = new AdminFinder($db); $parent_table_data = $af->getAdminTableRow($parent_table); $result['library_id'] = $libraryID; $result['library'] = $library; $parentFinder = new $parent_table_data['parent_finder']($db); $result['bridgeTableList'] = $parentFinder->findByLibraryID($libraryID); $result['parentTableList'] = $parentFinder->getDistinctList(); $result['parent_table_data'] = $parent_table_data; return $result; }