<?php
// Q25_1_1	Q25_1_2	Q25_1_3	Q25_2_1	Q25_2_2	Q25_2_3	Q25_3_1	Q25_3_2	Q25_3_3

// Prefix_Attribute_Brand
include "../config.php";
include "classes.php";

$data = array();
$finalNPS = array();
$condX = $_REQUEST['condX'];
$conX = $_REQUEST['conX'];
$normalmonthX = $_REQUEST['normalmonthX'];

$domainDropCvalX = $_REQUEST['domainDropCvalX'];

$column_name = '';
$range_arr = array();

if($conX==1)
{    
    // $condX=" sys_RespStatus = 5 AND sys_RespRemoved = 0";   
}

if($domainDropCvalX == "2")
{
    $column_name = 'Q21_';
    $range_arr = array(1,2,3,4,5,6,7,8);
}
else if($domainDropCvalX == "3")
{
    $column_name = 'Q22_';
    $range_arr = array(1,2,3);
}
else if($domainDropCvalX == "4")
{
    $column_name = 'Q23_';
    $range_arr = array(1,2,3,4,5,6,7);
}
else if($domainDropCvalX == "5")
{
    $column_name = 'Q24_';
    $range_arr = array(1,2,3,4);
}
else if($domainDropCvalX == "6")
{
    $column_name = 'Q25_';
    $range_arr = array(1,2,4,5);
}
else if($domainDropCvalX == "7")
{
    $column_name = 'Q26_';
    $range_arr = array(1,2,3,4,5);
}
else if($domainDropCvalX == "8")
{
    $column_name = 'Q27_';
    $range_arr = array(1,2,3,4,5,6);
}
else if($domainDropCvalX == "9")
{
    $column_name = 'Q28_';
    $range_arr = array(1,2,3,4,5,6,7,8,9,10,11,12,13);
}
else if($domainDropCvalX == "10")
{
    $column_name = 'Q30_';
    $range_arr = array(1,2,3);
}
else if($domainDropCvalX == "11")
{
    $column_name = 'Q29_';
    $range_arr = array(1,2,3,4,5,6,7,8,9);
}
else if($domainDropCvalX == "12")
{
    $column_name = 'Q31_';
    $range_arr = array(1,2);
}

$nps2 = new NPS2($conn,$condX);

$finalNPS['PreviousNPS'] = $nps2->npsCalculate2($column_name,$range_arr,$brandX2,$normalmonthX[0]);
$finalNPS['CurrentNPS'] = $nps2->npsCalculate2($column_name,$range_arr,$brandX2,$normalmonthX[1]);

array_push($data,$finalNPS);

echo json_encode($data);

?>