| 12345678910111213141516171819202122 |
- <?php
- /**
- * @var int $test_id
- */
- $user = Core::$user;
- $tests = $user->getCompletedTests();
- $tests = array_values(array_filter($tests, function(Test $test) use ($test_id) { return $test->id == $test_id; }));
- if(!$tests) {
- JSON::fail();
- }
- /** @var Test $test */
- $test = $tests[0];
- JSON::success([
- "invoiceGenerated" => $test->hasTesterInvoicePDF(),
- "travelCosts" => (float) $test->test_travel_cost,
- "travelCostDescription" => $test->test_travel_cost_description
- ]);
|