public function deleteMovie($id) { $starBD = new StarsBD(); $starBD->deleteRateMovie($_POST['id']); $req = $this->bdd->prepare("DELETE FROM movie WHERE mov_id = :id;"); $result = $req->execute(array("id" => $id)); return $result; }
<?php session_start(); include_once "stars_bd.php"; if (isset($_POST['valeur'])) { if (isset($_POST)) { $starBD = new StarsBD(); $star = new Star(-1, $_POST['utilisateur'], $_POST['film'], $_POST['valeur']); if ($starBD->getUserMovieStars($star->getUser(), $star->getMovie()) == null) { $starBD->addRateMovie($star); } else { $starBD->updateRateMovie($star); } } header('Location: ../movie.php?id=' . $star->getMovie()); } ?>
<?php include_once "includes/include.php"; $starsBD = new StarsBD(); $categoriesBD = new CategoriesBD(); if (isset($_GET['id'])) { $movies = new MoviesBD(); $mymovie = $movies->getMovie($_GET['id']); if ($mymovie == null) { header('Location: index.php'); } } else { header('Location: index.php'); } ?> <!doctype html> <html> <head> <?php include "includes/head.php"; ?> </head> <body> <?php include_once "includes/navbar.php"; ?> <div class="container"> <div class="jumbotron"> <div class="row">