<?php
/**
 * TermsController controlls the actions for the terms and conditions page
 */
class TermsController{
    private $model;

    function __construct(){
        $this->model = new TermsModel();
    }

    /**
     * output file content for pdf verison of terms and conditions
     * @return file pdf file content
     */
    public function pdfTerms(){
        header("Content-type: application/pdf");
        $idTerms = isset($_REQUEST['idTerms']) ? $_REQUEST['idTerms'] : 0;
        echo $this->model->pdfTerms($idTerms);
    }

    /**
     * open shop page
     */
    public function showPage(){
        $idTerms = isset($_REQUEST['idTerms']) ? $_REQUEST['idTerms'] : 0;
        $terms = $this->model->getTermsHTML($idTerms);
        require_once('TermsPage.php');
    }
}
