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 . ' : Add Date Criteria', 'content' => 'content/reportFormDate.php');
     // don't lose the db!
     $db = $_REQUEST['db'];
     // where are we?
     $userFinder = new UserFinder($db);
     $user = $userFinder->findById($_SESSION['userId']);
     $library = $user['library_short_name'];
     $libraryID = $user['library_id'];
     $result['library_id'] = $libraryID;
     $result['library'] = $library;
     $result['user'] = $user;
     $report_id = grwd('report_id');
     $result['report_id'] = $report_id;
     // get all the info on the reports
     $reportFinder = new ReportFinder($db);
     $reportCount = $reportFinder->getReportCount();
     $result['reportCount'] = $reportCount;
     // get the information for the chosen report by requiring Reports.php and all the reports
     $report_class_handle = new Report();
     $report_class_get = $report_class_handle->get();
     // declare the report class by using it's ID
     $report_info = new $report_id();
     $result['reportList'] = $report_info->info();
     $libraryFinder = new LibraryFinder($db);
     $result['libraryList'] = $libraryFinder->getAllLibraries();
     $locationFinder = new LocationFinder($db);
     $result['locationList'] = $locationFinder->getAllLocations();
     return $result;
 }
 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 . ' : Advanced Search', 'content' => 'content/advancedSearchForm.php');
     // don't lose the db!
     $db = $_REQUEST['db'];
     //var_dump($_REQUEST);
     // where are we?
     $userFinder = new UserFinder($db);
     $user = $userFinder->findById($_SESSION['userId']);
     $library = $user['library_short_name'];
     $libraryId = $user['library_id'];
     $result['library_id'] = $libraryId;
     $result['library'] = $library;
     $result['user'] = $user;
     // The library that got searched for last time, probably...
     $selLibId = grwd('search_library_id', $libraryId);
     $result['search_library_id'] = $selLibId;
     $libraryFinder = new LibraryFinder($db);
     $libraryList = $libraryFinder->getAllLibraries();
     array_unshift($libraryList, array('library_id' => $libraryId, 'short_name' => $user['library_short_name'], 'full_name' => $user['library_full_name']), array('library_id' => '0', 'short_name' => 'All Libraries', 'full_name' => 'All Libraries'), array('library_id' => '', 'short_name' => '----------------------------', 'full_name' => '----------------------------'));
     $result['libraryList'] = $libraryList;
     $locationFinder = new LocationFinder($db);
     $result['locationList'] = $locationFinder->getAllLocations();
     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;
 }
 function perform()
 {
     // set display requirements
     $result = array('renderer' => 'template_renderer.inc', 'pageTitle' => SITE_NAME . ' : User Admin', 'content' => 'content/admin/userAdminForm.php');
     // don't lose the db!
     $db = $_REQUEST['db'];
     // where are we?
     $uf = new UserFinder($db);
     $user = $uf->findById($_SESSION['userId']);
     $result['user'] = $user;
     // Find the list of users, and flag one as selected
     // If one isn't found, use "new" as the requester id
     $userList = $uf->findUsers();
     $result['userList'] = $userList;
     $result['selId'] = grwd('selUserId', -1);
     $result['selUser'] = $uf->findById($result['selId']);
     if (!is_numeric($result['selId'])) {
         $result['selUser']['user_id'] = 'new';
     }
     // Find libraries, and which library is selected
     $lf = new LibraryFinder($db);
     $result['libraryList'] = $lf->getAllLibraries();
     return $result;
 }