public function execute() { $name = $_POST["name"]; $season = $_POST["season"]; $nb_epi_total = $_POST["nb_epi_total"]; $status = $_POST["status"]; ListDAO::addShow($name, $season, $nb_epi_total, $status); }
protected function executeAction() { $this->hash_shows[0] = ListDAO::getShows(1); $this->hash_shows[1] = ListDAO::getShows(2); $this->hash_shows[2] = ListDAO::getShows(0); if (isset($_POST["nb_epi_total"]) && isset($_POST["name"]) && isset($_POST["season"])) { if (!empty($_POST["nb_epi_total"]) && !empty($_POST["name"]) && !empty($_POST["season"])) { $status; $nb_epi_watched; $status = 0; if (isset($_POST["status"]) && !empty($_POST["status"])) { $status = $_POST["status"]; } if ($status == 2) { $nb_epi_watched = $_POST["nb_epi_total"]; } ListDAO::addShow($_POST["name"], $_POST["season"], $_POST["nb_epi_total"], $status); } } }