<?php
include "../config.php";
include "classes.php";

$condX = $_REQUEST['condX'];
$conX = $_REQUEST['conX'];
$tblX = $_REQUEST['tblX'];

if($conX==1)
{    
    $condX="1=1";   
}

$data = array();

$recordCounter = new RecordCounter($conn,$condX,$tblX);
$recordCounter2 = new RecordCounter2($conn,$condX,$tblX);

$data['Q501'] = $recordCounter->countRecords('A_Q501_',range(1, 10),$airport);
$data['Q502'] = $recordCounter2->countRecords2('Q502',range(1, 5),$airport);
$data['Q503'] = $recordCounter2->countRecords2('Q503',range(1, 7),$airport);
$data['Q504'] = $recordCounter->countRecords('A_Q504_',range(1, 6),$airport);
$data['Q504a'] = $recordCounter2->countRecords2('Q504a',range(1, 5),$airport);
$data['Q505'] = $recordCounter->countRecords('A_Q505_',range(1, 8),$airport);
$data['Q506'] = $recordCounter2->countRecords2('Q506',range(1, 5),$airport);
$data['Q507'] = $recordCounter->countRecords('A_Q507_',range(1, 8),$airport);
$data['Q508'] = $recordCounter->countRecords('A_Q508_',range(1, 14),$airport);
$data['Q509'] = $recordCounter->countRecords('A_Q509_',range(1, 15),$airport);
$data['Q510'] = $recordCounter->countRecords('A_Q510_',range(1, 10),$airport);
$data['Q511'] = $recordCounter->countRecords('A_Q511_',range(1, 15),$airport);
$data['Q512'] = $recordCounter2->countRecords2('Q512',range(1, 2),$airport);
$data['Q513'] = $recordCounter->countRecords('A_Q511_',range(1, 4),$airport);

$data['Q601'] = $recordCounter->countRecords('A_Q601_',range(1, 10),$airport);
$data['Q602'] = $recordCounter2->countRecords2('Q602',range(1, 2),$airport);
$data['Q602a'] = $recordCounter2->countRecords2('Q602a',range(1, 2),$airport);
$data['Q603'] = $recordCounter->countRecords('A_Q603_',range(1, 17),$airport);
$data['Q604'] = $recordCounter->countRecords('A_Q604_',range(1, 16),$airport);
$data['Q605'] = $recordCounter->countRecords('A_Q605_',range(1, 19),$airport);





echo json_encode($data);

?>