diff --git a/admin.php b/admin.php --- a/admin.php +++ b/admin.php @@ -18,7 +18,9 @@ * along with SlatePermutate. If not, see . */ - include_once 'inc/class.page.php'; +require_once('inc/class.page.php'); +require_once('inc/admin.inc'); + $scripts = array('jQuery','jQueryUI'); $adminpage = new page('Administration',$scripts,FALSE); @@ -79,7 +81,17 @@ $result = ''; if(isset($_GET['rehash'])) { // Run the rehash - $result = 'Rehash Complete'; + + $crawl_schools = NULL; + if (isset($_REQUEST['rehash_school'])) + $crawl_schools = array($_REQUEST['rehash_school']); + + if (school_cache_recreate($crawl_schools)) + $result = 'Rehash Failed'; + else + $result = 'Rehash Successful'; + if ($crawl_schools !== NULL) + $result .= ': ' . implode(', ', $crawl_schools); } else if(isset($_GET['purgetodate'])) { // Purge saved schedule cache up to date @@ -102,28 +114,15 @@ return date("F j, Y, g:i a", $stats[9]); } - function getSchools() { - if(!stat("cache/schools")){ - return false; - } - $schoolsArr = unserialize(file_get_contents("cache/schools")); - return $schoolsArr; - } - - function schoolsDropList(){ - $schools = getSchools(); - echo ''; - foreach($schools['list'] as $school){ - if(!$school['name'] != "Generic College") { - echo ''; - echo $school['name']; - echo ""; + function schoolsDropList() + { + $school_ids = school_list(); + echo ''; + foreach($school_ids as $school_id) + { + $school = school_load($school_id); + echo ' ' . $school['name'] . '' . "\n"; } - } echo ""; } @@ -158,12 +157,19 @@ } ?> - Rehash All Institutions - Rehash schedules for + + Rehash All Institutions + + + Rehash schedules for + + + + Purge -The cache currently contains schedules. +The saved schedule fs-db currently contains schedules. Purge Entire Cache Purge cache up to
The cache currently contains schedules.
The saved schedule fs-db currently contains schedules.