123456789101112131415161718192021 |
- <?php
- class ForgetUploadAction implements IAction {
- public function execute() {
- $projectId = $_POST['project_id'] ?? $_GET['project_id'];
- $userId = $_SESSION['user_id'];
- $database = SqliteDatabase::getSingleton();
- $sql = "DELETE FROM upload_logs WHERE user_id = :user_id AND project_id = :project_id;";
- $preparedQuery = $database->prepare($sql);
- $preparedQuery->bindValue(':user_id', $userId);
- $preparedQuery->bindValue(':project_id', $projectId);
- $result = $preparedQuery->execute();
- $data = array(
- "message" => "project deleted " . $projectId
- );
- return $data;
- }
- }
|