<?php
include_once "../../../config.php";
include_once "../../database1.php";
include_once "../../../validation.php";
include_once "../../../Helper.php";

require_once '../check_edit_page_ajax.php';

class getFilterValuesOfSubCategory extends database{
	public function index($id)
	{
		$where[] = $id;

		$sql = ' SELECT vp.*,  GROUP_CONCAT(CONCAT("<span><b>filter : ", vpf.cl_filter, "</b>", ", Value : ", vpfv.cl_name, "</span>")) AS filter_value FROM tb_variable_product vp INNER JOIN tb_variable_product_attributes vpa ON vp.cl_id=vpa.cl_variable_product_id INNER JOIN tb_variable_product_filter vpf ON vpa.cl_filter_id=vpf.cl_id inner join tb_variable_product_filter_values vpfv ON vpa.cl_value_id=vpfv.cl_id WHERE vp.cl_deleted_at IS NULL AND vp.cl_product_id=? GROUP BY vp.cl_id ';

		return $this->callQuery($sql, $where);
	}
}


$helper = new Helper();
$validation = new validation();

$obj = new getFilterValuesOfSubCategory();
$res = $obj->index($id);



http_response_code(200);
echo json_encode($res);
exit;