Model/TaskModel.php gelöscht

This commit is contained in:
Mohammad Reda Mohammad 2025-09-05 12:07:39 +02:00
parent 4efea20fae
commit 4ed905762a

View File

@ -1,37 +0,0 @@
<?php
namespace ppb\Model;
use ppb\Library\Msg;
class TaskModel extends Database {
public function insertTask($data) {
$pdo = $this->linkDB();
try {
$sql = "INSERT INTO task (id, userId, projectId, title, expense, dueDate, priorityId, done )
VALUES (:id,:userId,:projectId, :title, :expense, :dueDate, :priorityId, :done)";
$sth = $pdo->prepare($sql);
$sth-> execute([
':id' => $this->createUUID(),
':userId' => '4f141df7-3c0a-11e8-b046-2c4d544f8fe0',
':projectId' => $data['projectId'],
':title' => $data['title'],
':expense' => str_replace("," , "." ,$data['expense']),
':dueDate' => date("Y-m-d", strtotime($data['dueDate'])),
':priorityId' => $data['priorityId'],
':done' => 0
]);
$pdo = null;
new Msg(false, "Task erfolgreich eingefügt.");
} catch (\PDOException $e) {
new Msg(true, 'Fehler beim Einfügen des Tasks', $e);
}
}
}