public function saveTrip($itineraryKey, $pitstops) { if (isset($_POST['itineraryKey']) && isset($_POST['pitstops'])) { $itineraryKey = $_POST['itineraryKey']; $pitstops = json_encode($_POST['pitstops']); } $itineraryKey = Hash::make($itineraryKey); $checkItineraryKey = Trip::checkKey($itineraryKey); if ($checkItineraryKey) { return 0; } return Trip::saveTrip($itineraryKey, $pitstops); }
public function checkKey($itineraryKey) { if (isset($_GET['itineraryKey'])) { $itineraryKey = $_GET['itineraryKey']; } $itineraryKey = Hash::make($itineraryKey); $checkItineraryKey = Trip::checkKey($itineraryKey); if ($checkItineraryKey) { return 0; } return "Valid Key"; }