aboutsummaryrefslogtreecommitdiff
path: root/include/assignments-edit.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 18:46:36 +0200
committerCamil Staps2016-07-27 20:48:46 +0200
commite73a0078128cc3154c8c70d57fd3c9c8112087b9 (patch)
treea2e0151c8c924af53b77115f53e964993cebe1f0 /include/assignments-edit.php
parentUser: use Model (diff)
Assignment: use Model
Diffstat (limited to 'include/assignments-edit.php')
-rw-r--r--include/assignments-edit.php11
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);