/** * Return the requested edit submission form as HTML * * @return Response */ public function getEditSubmissionForm($submission_id) { try { $data['submission'] = Submission::rideShareLogAdminGet($submission_id); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Failed to retrieve Submission ' . $submission_id . '.'); } try { $data['afs'] = AdditionalFieldSubmission::rideShareLogAdminGetBySubmissionId($submission_id); } catch (\Exception $e) { /*Do nothing because it may not exist*/ /*return $this->handleRideShareLogError($e, 'Failed to retrieve Additional Field Submission for Submission '.$submission_id.'.');*/ } try { $data['user'] = User::rideShareLogAdminGet($data['submission']->user_id); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Failed to retrieve User for Submission ' . $submission_id . '.'); } return View::make('admin.partials.update_submission', ['data' => $data, 's_options' => Submission::rideShareLogGetOptions()]); }
private function getParticipantFormValues() { $formValues = array(); try { $formValues['location'] = Location::rideShareLogGetUserLocation(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Location for form.'); } try { $formValues['methodTypes'] = MethodType::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Method Type for form.'); } try { $formValues['passengerTypes'] = PassengerType::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Passenger Type for form.'); } try { $formValues['lmpCombinations'] = LmpCombination::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve L.M.P. Combinations for form.'); } try { $formValues['additionalFields'] = AdditionalField::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Additional Field for form.'); } try { $formValues['additionalFieldDependencies'] = AdditionalFieldDependency::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Additional Field Dependency for form.'); } try { $formValues['submissions'] = Submission::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Submission for form.'); } try { $formValues['additionalFieldSubmissions'] = AdditionalFieldSubmission::rideShareLogGetAll(); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Additional Field Submission for form.'); } try { $formValues['user'] = User::rideShareLogGetField('display_name'); } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve User for form.'); } try { $formValues['today'] = date('Y-m-d'); /* Today = 2015-03-16 */ } catch (\Exception $e) { return $this->handleRideShareLogError($e, 'Unable to retrieve Date for form.'); } return json_encode($formValues, JSON_NUMERIC_CHECK); }
/** * Remove the specified additionalfieldsubmission from storage. * * @param int $id * @return Response */ public function destroy($id) { try { AdditionalFieldSubmission::deactivate($id); } catch (\Exception $e) { return $this->handleError($e); } return Redirect::route('additional_field_submissions.index'); }