<?php

namespace App\Http\Controllers;

use App\Services\ConferenceService;
use Illuminate\Http\Request;

class ConferenceSiteController extends Controller
{
    protected $conferenceService;

    public function __construct(ConferenceService $conferenceService)
    {
        $this->conferenceService = $conferenceService;
    }

    public function index($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.home', [
            'conference' => $conference
        ]);
    }

    public function callForPapers($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.call-for-papers', [
            'conference' => $conference
        ]);
    }
    public function abstractSubmission($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.abstract-submission', [
            'conference' => $conference
        ]);
    }
    public function registrationFees($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.registration-fees', [
            'conference' => $conference
        ]);
    }

    public function contactUs($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.contact-us', [
            'conference' => $conference
        ]);
    }

    public function accommodations($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.accommodations', [
            'conference' => $conference
        ]);
    }

    public function visa($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.visa', [
            'conference' => $conference
        ]);
    }

    public function tour($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.tour', [
            'conference' => $conference
        ]);
    }

    public function venueTravel($slug)
    {
        $conference = $this->conferenceService->getConferenceBySlug($slug);

        if (!$conference) {
            abort(404);
        }

        return view('conference.venue-travel', [
            'conference' => $conference
        ]);
    }
}
