COS-Abfrage

This commit is contained in:
2026-08-07 23:56:02 +02:00
parent 30d8056919
commit 830cca355f
2 changed files with 25 additions and 0 deletions
+9
View File
@@ -23,6 +23,15 @@ class C3GovConnector
return $result->fetch_assoc();
}
public function getCos($testId){
$sql = "SELECT * FROM cos WHERE testId = ?";
$stmt = $this->dbConnection->prepare($sql);
$stmt->bind_param("s", $testId);
$stmt->execute();
$result = $stmt->get_result();
return $result->fetch_assoc();
}
public function __destruct() {
$this->dbConnection->close();
}
+16
View File
@@ -0,0 +1,16 @@
<?php
include("../lib/C3GovConnector.php");
use lib\C3GovConnector;
$testId = $_POST['testId'] ?? null;
//$refNo = $argv[1] ?? null;
if (!$testId) {
echo( json_encode( [ 'error' => 'No test id provided' ] ));
}
else {
$c3gov = new C3GovConnector();
echo( json_encode($c3gov->getCos($testId)));
}