<?php error_reporting(E_ALL); header("Content-type: text/javascript;"); if (isset($_GET['date'])) { die(date("d-M-Y", time() - 10 * 86400)); } require 'connect.php'; if (!__DEV__) { header('Location: ./index.php'); die; } // DEV ONLY $db = CourseRoadDB::getDB(); $filename = '../../../cron_scripts/output.html'; $file = file_get_contents($filename); if (isset($_GET['verbose'])) { echo preg_replace("/\\s*[\r\n]\\s*/", '', $file); } $test_mode = isset($_GET['test']); if ($test_mode) { echo "Running in TEST mode:\n\n"; } preg_match_all("/<td[^>]*>\n(.*?)\n<\\/td>/s", $file, $matches); $matches = $matches[1]; if (!count($matches)) { file_put_contents($filename, ''); die("No matches/changes\n"); } $headers = explode(',', 'Academic Year,Subject Id,Subject Code,Subject Number,Source Subject Id,' . 'Print Subject Id,Is Printed In Bulletin,Department Code,Department Name,' . 'Effective Term Code,Subject Short Title,Subject Title,Is Variable Units,' . 'Lecture Units,Lab Units,Preparation Units,Total Units,Design Units,' . 'Grade Type,Grade Type Desc,Grade Rule,Grade Rule Desc,Hgn Code,Hgn Desc,' . 'Hgn Except,Gir Attribute,Gir Attribute Desc,Comm Req Attribute,' . 'Comm Req Attribute Desc,Tuition Attribute,Tuition Attribute Desc,' . 'Write Req Attribute,Write Req Attribute Desc,Supervisor Attribute,' . 'Supervisor Attribute Desc,Prerequisites,Subject Description,' . 'Joint Subjects,School Wide Electives,Meets With Subjects,' . 'Equivalent Subjects,Is Offered This Year,Is Offered Fall Term,' . 'Is Offered Iap,Is Offered Spring Term,Is Offered Summer Term,' . 'Fall Instructors,Spring Instructors,Status Change,Last Activity Date,' . 'Warehouse Load Date,Master Subject Id,Hass Attribute,Hass Attribute Desc,' . 'Term Duration,Global Regions,Global Countries,On Line Page Number'); foreach ($headers as &$header) {