$mysqlDateString = formatMySQLDateString($dateString); $newHuntDetails = new hunt_details_info(); $newHuntDetails->setHuntId($huntId); $newHuntDetails->setStatus("EDIT"); $newHuntDetails->setHunterId($hunter->getId()); $newHuntDetails->setHunterCount($hunterCount); $newHuntDetails->setHuntDate($mysqlDateString); $newHuntDetails->setHuntHours($hours); $newHuntDetails->setCarCount($carCount); $newHuntDetails->setBlindId($blindNumber); $newHuntDetails->setAreaId($areaNumber); $newHuntDetails->setMultiBlind($isMultiBlind); $newHuntDetails->setJumpShoot($isJumpShoot); $newHuntDetails->setBagChecked($isBagChecked); $newHuntDetails->setCreated($createdDateString); $huntDetailsId = saveNewHuntDetails($newHuntDetails); $harvestCountList = collectHarvestCountList($createdDateString); saveNewHarvestCountList($huntId, $huntDetailsId, $harvestCountList); logTheUpdatingOfAHunt($newHuntDetails); sendUpdateHuntNotification($newHuntDetails); header("Location: /HuntingHarvest.php"); } catch (Exception $e) { // Unsuccessful login if ($e->getMessage() == 'no user found') { addError('login', 'We could not find you in our system'); header('Location: /index.php'); } else { if ($e->getMessage() == 'no results') { addError('login', 'Opps, looks like our system is down right now.'); header('Location: /index.php'); }
function markHuntDetailsDeleted($huntDetailsId) { $huntDetails = readHuntDetails($huntDetailsId); $huntDetails->setCreated(getNow()); $huntDetails->setStatus('DELETED'); saveNewHuntDetails($huntDetails); }