<?php

namespace App\Http\Controllers;

use App\Paper\CinemaCinemaCity;
use App\Paper\CinemaGdynskieCentrumFilmowe;
use App\Paper\CinemaHelios;
use App\Paper\CinemaMultikino;
use App\Paper\Paper;

class Repertoire extends Controller
{

    private $main;
    private $icon = 'film';

    public function __construct()
    {
        $this->main = new Paper();
    }


    public function today_cinemacity()
    {
        $cinemacity = new CinemaCinemaCity();
        $cinemacity->setCinemaId(1010912);
        $cinemacity->setDay(date('Y-m-d'));
        $repertuarText = $cinemacity->convertToPrint();

        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }


    public function tomorrow_cinemacity()
    {
        $cinemacity = new CinemaCinemaCity();
        $cinemacity->setCinemaId(1010912);
        $cinemacity->setDay(date_create()->modify('+1 day')->format('Y-m-d'));
        $repertuarText = $cinemacity->convertToPrint();

        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }


    public function today_multikino()
    {
        $multikino = new CinemaMultikino();

        $multikino->setCinemaId(4);
        $multikino->setDay(date('Y-m-d'));

        $repertuarText = $multikino->convertToPrint();
        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }

    public function tomorrow_multikino()
    {
        $multikino = new CinemaMultikino();
        $multikino->setDay(date_create()->modify('+1 day')->format('Y-m-d'));
        $multikino->setCinemaId(4);

        $repertuarText = $multikino->convertToPrint();
        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }


    public function tomorrow_gdynskiecentrumfilmowe()
    {
        $gdynskieCentrumFilmowe = new CinemaGdynskieCentrumFilmowe();
        $gdynskieCentrumFilmowe->setDay(date_create()->modify('+1 day')->format('d_m_Y'));
        $repertuarText = $gdynskieCentrumFilmowe->convertToPrint();

        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }

    public function today_gdynskiecentrumfilmowe()
    {
        $gdynskieCentrumFilmowe = new CinemaGdynskieCentrumFilmowe();
        $gdynskieCentrumFilmowe->setDay(date('d_m_y'));
        $repertuarText = $gdynskieCentrumFilmowe->convertToPrint();

        $this->main->sendPrint('', $repertuarText, $this->icon);
        return back();
    }

    public function today_helios()
    {
        $helios = new CinemaHelios();
        $helios->setDay(0);
        $helios->setCinemaId([2, 49]);
        $helios->convertToPrint();

        $repertuarText = $helios->convertToPrint();
        $this->main->sendPrint('', $repertuarText, $this->icon);

        return back();
    }

    public function tomorrow_helios()
    {
        $helios = new CinemaHelios();
        $helios->setDay(1);
        $helios->setCinemaId([2, 49]);
        $helios->convertToPrint();

        $repertuarText = $helios->convertToPrint();
        $this->main->sendPrint('', $repertuarText, $this->icon);

        return back();
    }

    public function today_repertoire()
    {
        $this->today_multikino();
        $this->today_cinemacity();
        $this->today_helios();
        $this->today_gdynskiecentrumfilmowe();
    }

    public function tomorrow_repertoire()
    {
        $this->tomorrow_multikino();
        $this->tomorrow_cinemacity();
        $this->tomorrow_helios();
        $this->tomorrow_gdynskiecentrumfilmowe();
    }

}
