COS-Abfrage
This commit is contained in:
@@ -23,6 +23,15 @@ class C3GovConnector
|
|||||||
return $result->fetch_assoc();
|
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() {
|
public function __destruct() {
|
||||||
$this->dbConnection->close();
|
$this->dbConnection->close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)));
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user