public function sheet($leadership_event_id, $activity_id)
 {
     $event = LeadershipEvent::findOrFail($leadership_event_id);
     $activity = Activity::findOrFail($activity_id);
     $this->layout->with('subtitle', $event->name());
     $this->layout->content = View::make('signup.sheet')->with('event', $event)->with('activity', $activity);
 }
 public function edit($leadership_event_id, $id)
 {
     $event = LeadershipEvent::find($leadership_event_id);
     $activity = Activity::findOrFail($id);
     $this->layout->with('subtitle', $event->name());
     $this->layout->content = View::make('activities.edit')->with('activity', $activity);
 }
 public function edit($leadership_event_id, $id)
 {
     $event = LeadershipEvent::find($leadership_event_id);
     $booking = Booking::findOrFail($id);
     $this->layout->with('subtitle', $event->name());
     $this->layout->content = View::make('bookings.edit')->with('booking', $booking);
 }
 public function register($leadership_event_id, $booking_id)
 {
     $input = Input::all();
     $validator = Validator::make($input, Booking::$rules);
     if ($validator->passes()) {
         $booking = Booking::findOrFail($booking_id);
         $booking->registration_date = new Datetime();
         $booking->first = Input::get('first');
         $booking->last = Input::get('last');
         $booking->email = Input::get('email');
         $booking->contact_number = Input::get('contact_number');
         $booking->church = Input::get('church');
         $booking->role = Input::get('role');
         $booking->notes = Input::get('notes');
         $booking->save();
         return Redirect::route('registration', array($leadership_event_id))->with('info', 'Registration complete!');
     } else {
         $event = LeadershipEvent::find($leadership_event_id);
         $bookings = Booking::where('id', $booking_id)->get();
         $bookings->each(function ($booking) {
             // Should actually only be one...
             $booking->first = Input::get('first');
             $booking->last = Input::get('last');
             $booking->email = Input::get('email');
             $booking->contact_number = Input::get('contact_number');
             $booking->church = Input::get('church');
             $booking->role = Input::get('role');
             $booking->notes = Input::get('notes');
         });
         $this->layout->with('subtitle', $event->name());
         $this->layout->withErrors($validator);
         $this->layout->content = View::make('registration.index')->with('event', $event)->with('bookings', $bookings)->with('errors', $validator->messages());
     }
 }
Example #5
0
 public function open($id)
 {
     $event = LeadershipEvent::findOrFail($id);
     $event->closed = false;
     $event->save();
     return Redirect::route('event.show', $id)->with('info', 'This event has been reopened');
 }