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

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

$Q301b_arr = array(1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 99);

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

$data = array();

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

$data['Q301b'] = $recordCounter->countRecords('A_Q301b_',range(1, 6),$airport);
$data['Q302b'] = $recordCounter->countRecords('A_Q302b_',$Q301b_arr,$airport);
$data['Q304b'] = $recordCounter->countRecords('A_Q304b_',range(1, 23),$airport);
$data['Q306b'] = $recordCounter2->countRecords2('Q306b',range(1, 4),$airport);

$data['Q401b'] = $recordCounter->countRecords('A_Q401b_',range(1, 14),$airport);
$data['Q405b'] = $recordCounter2->countRecords2('Q405b',range(1, 4),$airport);




echo json_encode($data);

?>