Updated report system to analyse subsets
This commit is contained in:
40
db.php
40
db.php
@@ -130,10 +130,50 @@ $stmt = $pdo->prepare("
|
||||
'text' => $text,
|
||||
'value' => $value
|
||||
]);
|
||||
|
||||
if ($qid == "QID68"){
|
||||
updateResponseQ1($pdo, $value, $responseId);
|
||||
}
|
||||
if ($qid == "QID69"){
|
||||
updateResponseQ2($pdo, $value, $responseId);
|
||||
}
|
||||
if ($qid == "QID70"){
|
||||
updateResponseQ3($pdo, $value, $responseId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateResponseQ1(PDO $pdo, int $q1Value, string $responseId): bool {
|
||||
$sql = "UPDATE Responses SET Q1 = :q1 WHERE id = :responseId";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->bindParam(':q1', $q1Value, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':responseId', $responseId, PDO::PARAM_STR);
|
||||
|
||||
return $stmt->execute();
|
||||
}
|
||||
|
||||
function updateResponseQ2(PDO $pdo, int $q2Value, string $responseId): bool {
|
||||
$sql = "UPDATE Responses SET Q2 = :q2 WHERE id = :responseId";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->bindParam(':q2', $q2Value, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':responseId', $responseId, PDO::PARAM_STR);
|
||||
|
||||
return $stmt->execute();
|
||||
}
|
||||
|
||||
function updateResponseQ3(PDO $pdo, int $q3Value, string $responseId): bool {
|
||||
$sql = "UPDATE Responses SET Q3 = :q3 WHERE id = :responseId";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->bindParam(':q3', $q3Value, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':responseId', $responseId, PDO::PARAM_STR);
|
||||
|
||||
return $stmt->execute();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user