add a delete button to delete a video

This commit is contained in:
2020-10-03 07:06:27 +00:00
parent c2991bcd50
commit 13a980f161
4 changed files with 57 additions and 5 deletions

View File

@ -219,5 +219,18 @@ class Video extends RequestBase {
$this->commitMessage('{"result":"' . $this->conn->error . '"}');
}
});
$this->addActionHandler("deleteVideo", function () {
$movieid = $_POST['movieid'];
// delete video entry and corresponding tag infos
$query = "DELETE FROM videos WHERE movie_id=$movieid";
if ($this->conn->query($query) === TRUE) {
$this->commitMessage('{"result":"success"}');
} else {
$this->commitMessage('{"result":"' . $this->conn->error . '"}');
}
});
}
}