diff options
Diffstat (limited to 'include/assignments-edit.php')
-rw-r--r-- | include/assignments-edit.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/assignments-edit.php b/include/assignments-edit.php index d2f5a6c..b51eab6 100644 --- a/include/assignments-edit.php +++ b/include/assignments-edit.php @@ -21,6 +21,7 @@ require_once('./conf.php'); require_once('./login-ajax.php'); $response = new Response(); +$response->success = true; try { $assignment = new Assignment($_pdo, $_REQUEST['pk']); @@ -29,19 +30,19 @@ try { $what_to_edit = $name[count($name) - 1]; switch ($what_to_edit) { case 'title': - $response->success = $assignment->setTitle($_REQUEST['value']); + $assignment->title = $_REQUEST['value']; break; case 'hours': - $response->success = $assignment->setHours($_REQUEST['value']); + $assignment->hours = $_REQUEST['value']; break; case 'price_per_hour': - $response->success = $assignment->setPricePerHour($_REQUEST['value']); + $assignment->price_per_hour = $_REQUEST['value']; break; case 'vat': - $response->success = $assignment->setVAT($_REQUEST['value']); + $assignment->VAT_percentage = $_REQUEST['value']; break; case 'description': - $response->success = $assignment->setDescription($_REQUEST['value']); + $assignment->description = $_REQUEST['value']; break; default: $response->http_response_code(404); |