Example #1
0
 function old(Request $request)
 {
     $id = $request['id'];
     if ($id == null) {
         $id = get_current_conference_id();
     }
     $conferences = Conference::where('id', '<>', get_current_conference_id())->orderBy('id', 'desc')->get();
     $chosen_conf = Conference::where('id', '=', $id)->first();
     $presentations = Presentation::where('conference_id', '=', $id)->where('status', '=', 'A')->orderBy('course_id')->get();
     return view('conferences.old', compact('conferences', 'chosen_conf', 'presentations'));
 }
 protected function deletePresentation($id, $presentationId)
 {
     if ($id == null || $presentationId == null) {
         return Response::json('invalid ids', 400);
     }
     $Presentation = Presentation::where('Project_FK', '=', $id)->where('id', '=', $presentationId)->first();
     if (empty($Presentation)) {
         return Response::json('presentation is empty', 400);
     }
     \File::Delete(public_path() . "\\presentations\\" . $Presentation->file);
     $Presentation->delete();
 }
Example #3
0
function count_presentations()
{
    $id = get_current_conference_id();
    return Presentation::where('conference_id', '=', $id)->count();
}
Example #4
0
 public function save_comment($id, Request $request)
 {
     $comments = $request->all();
     $presentation = Presentation::findOrFail($id);
     $presentation->status = 'D';
     $presentation->comments = $comments['comments'];
     $presentation->save();
     flash()->success('Your comments have being saved');
     return redirect()->route('presentation.status', 'pending');
 }
Example #5
0
 public function preview()
 {
     $rooms = Room::where("available", true)->get();
     $days = Timeslot::orderBy("id", 'desc')->first()->day;
     $presentations = Presentation::where('conference_id', '=', get_current_conference_id())->whereNotNull('timeslot')->get();
     $timeslots = Timeslot::where('conference_id', '=', get_current_conference_id())->get();
     return view('timeslots.preview', compact('timeslots', 'rooms', 'presentations', 'days'));
 }
Example #6
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $event = new Event();
     $event->uuid = Uuid::uuid1()->toString();
     // Time-based version1 string (for now)
     $event->title = $request->title;
     $event->intro = $request->intro;
     $event->description = $request->description;
     $event->vortex_url = $request->vortex_url;
     $event->facebook_id = $request->facebook_id;
     $event->start_date = new Carbon($request->start_date);
     $event->location = $request->location;
     if (!$request->youtube_playlist_id) {
         $event->youtube_playlist_id = null;
     } else {
         $youtubePlaylist = YoutubePlaylist::find($request->youtube_playlist_id);
         $event->youtube_playlist_id = $youtubePlaylist->id;
     }
     $event->save();
     // Organizers: TODO
     $presentation = new Presentation();
     $presentation->event_id = $event->id;
     $presentation->start_time = $request->p1_start_time;
     $presentation->end_time = $request->p1_end_time;
     // ...
     $presentation->save();
     if ($request->has('p1_person1')) {
         // TODO
     }
     if ($request->has('p1_youtube_id')) {
         $recording = Recording::where('youtube_id', '=', $request->p1_youtube_id)->first();
         if (is_null($recording)) {
             die("TODO: Video not found, redirect back with meaningful error message");
         }
         $recording->presentation_id = $presentation->id;
         $recording->save();
     }
     return redirect()->action('EventsController@show', $event->id)->with('status', 'Arrangementet ble opprettet.');
 }