Bei der Quotierung nach Geschlecht, Alter, Bildung und Wahlverhalten bekomme ich Fehlermeldungen.
Folgende PHP-Codes habe ich nach der Quotierung auf einer separaten Seite eingefügt:
Interne Variablen für die 4 Merkmale wurden erstellt.
PHP-Code 1:
$quotaAge = [
1 => 120,
2 => 95,
3 => 100,
4 => 110,
5 => 75
];
$quotaGender = [
1 => 250,
2 => 250
];
$quotaPolOrient = [
3 => 140,
2 => 115,
1 => 110,
4 => 53,
5 => 48,
6 => 35
];
$quotaEducation = [
1 => 85,
2 => 113,
3 => 120,
4 => 100,
5 => 80
];
PHP-Code 2:
$Gender = value('B002');
$Education = value('B003');
$PolOrient = value('B006');
$Age = value('B004');
if ($Age < 18) {
$AgeGroup = 1;
} elseif ($Age <= 30) {
$AgeGroup = 2;
} elseif ($Age <= 40) {
$AgeGroup = 3;
} elseif ($Age <= 50) {
$AgeGroup = 4;
} elseif ($Age <= 65) {
$AgeGroup = 5;
}
PHP Code 3:
$casesAge = statistic('count', 'B010_01', $AgeGroup);
$casesGender = statistic('count', 'B008_01', $Gender);
$casesEducation = statistic('count', 'B009_01', $Education);
$casesPolOrient = statistic('count', 'B011_01', $PolOrient);
if (!array_key_exists($AgeGroup, $quotaAge) || !array_key_exists($Gender, $quotaGender) || !array_key_exists($Education, $quotaEducation) || !array_key_exists($PolOrient, $quotaPolOrient)) {
redirect('https://survey.maximiles.com/quotasfull?p=110989_82167f6e&m=%reference%');
}
$maxPerAge = $quotaAge[$AgeGroup];
$maxPerGender = $quotaGender[$Gender];
$maxPerEducation = $quotaEducation[$Education];
$maxPerPolOrient = $quotaPolOrient[$PolOrient];
if (($casesAge >= $maxPerAge) || ($casesGender >= $maxPerGender) || ($casesEducation >= $maxPerEducation) || ($casesPolOrient >= $maxPerPolOrient)) {
redirect('https://survey.maximiles.com/quotasfull?p=110989_cc99914b&m=%reference%');
}
Und hier die Fehlermeldung:
