function baselineHarvestData($baselineYear) { $season = getSeasonByYear($baselineYear); echo "<h1>Remove hunts from report tables for this season.</h1>"; flush(); // Get all Hunt report data for this season $allHuntReports = getAllHuntReportsForASeason($baselineYear); if (isset($allHuntReports)) { // Remove all harvest counts for the hunts for this season. $numberOfHuntCountsRemoved = removeAllBaselineCounts($allHuntReports); echo $numberOfHuntCountsRemoved . " Hunt Counts Removed!<br>"; // Remove all the hunts for this season. $numberOfHuntsRemoved = removeAllHuntReportsForASeason($season); echo $numberOfHuntsRemoved . " Hunts Removed!<br>"; } else { echo "<br/><br/>No HuntReports for the Season.</p>"; } echo "<h1>Process hunt versions for this season.</h1>"; flush(); $huntsForAYear = getSeasonHunts($season); echo count($huntsForAYear) . " Hunts with any hunt date within the season<br>"; flush(); // Find the final state of each hunt. $currentHuntDetailsList = getCurrentHuntDetailsList($huntsForAYear); echo count($currentHuntDetailsList) . " Hunts that are not deleted<br>"; flush(); $inSeasonHunts = 0; foreach ($currentHuntDetailsList as $oneHuntDetails) { if (withinSeason($oneHuntDetails, $season)) { $inSeasonHunts++; //echo("In Season Hunt Details"); //print_r($oneHuntDetails); //echo("<br>"); // Insert hunt report $newHuntReportId = saveNewHuntReportFromHuntDetails($baselineYear, $oneHuntDetails); $countList = getHarvetsListByHuntDetailsId($oneHuntDetails->getId()); foreach ($countList as $oneCount) { saveNewHuntCountReport($newHuntReportId, $oneCount); } } } echo $inSeasonHunts . " Hunts that are not deleted and are in season<br>"; flush(); }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php /* * Created on Aug 19, 2010 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once 'php/piute_includes.php'; session_start(); redirectIfNotInRole('hunter', '../not-allowed.php'); $blindCount = getBlindCount(); $speciesList = getAllSpecies(); $hundDetailsId = $_GET['hunt_details_id']; $huntDetails = readHuntDetails($hundDetailsId); $harvestList = getHarvetsListByHuntDetailsId($huntDetails->getId()); $areaList = getDisplay('areas'); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Piute Ponds Edit Hunt</title> <SCRIPT LANGUAGE="JavaScript" SRC="calendar/CalendarPopup.js"></SCRIPT> <SCRIPT LANGUAGE="JavaScript">document.write(getCalendarStyles());</SCRIPT> <STYLE> .CALcpYearNavigation, .CALcpMonthNavigation { background-color:#6677DD;