public function add() {
$title = 'Добавить фильм';
$filmsModel = new Film();
$producers = $filmsModel->getProducers();
include_once('./views/films/add.php');
if (isset($_POST['film_name'])) {
$film_name = htmlentities($_POST['film_name']);
$film_producer_id = $_POST['film_producer_id'];
$film_production_year = htmlentities($_POST['film_production_year']);
$data = compact('film_name', 'film_producer_id', 'film_production_year');
$filmsModel->addFilm($data);
header('Location: ./list');
}
}
public function add() {
$title = 'Добавить персонажа';
$personsModel = new Person();
$actors = $personsModel->getActors();
include_once('./views/persons/add.php');
if (isset($_POST['person_pseudo'])) {
$person_name = htmlentities($_POST['person_name']);
$person_pseudo = $_POST['person_pseudo'];
$person_biography = htmlentities($_POST['person_biography']);
$data = compact('person_name', 'person_pseudo', 'person_biography');
$personsModel->addPerson($data);
header('Location: ./list');
}
}