<?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['Q301a'] = $recordCounter->countRecords('A_Q301a_', range(1, 17),$airport);
$data['Q303a'] = $recordCounter2->countRecords2('Q303a', range(1, 4),$airport);
$data['Q308a'] = $recordCounter2->countRecords2('Q308a', range(1, 4),$airport);

$data['Q401a'] = $recordCounter->countRecords('A_Q401a_', range(1, 18),$airport);
$data['Q404a'] = $recordCounter2->countRecords2('Q404a', range(1, 4),$airport);
$data['Q409b'] = $recordCounter2->countRecords2('Q409b', range(1, 4),$airport);


echo json_encode($data);

?>