<?php session_start();
	include_once("../../functions/init.php"); 

	$tmp = $thisUrl."adm1n/functions/access.php";
	include ($tmp);

	$tmp = $thisUrl."adm1n/functions/koneksi.php";
	include_once ($tmp);
	
	$sql7 = "SELECT * FROM form_element_sub ORDER BY elementSubID";
	if ($hasil7 = mysql_query($sql7)) {
		if (mysql_num_rows(mysql_query($sql7))){
			$product_name = array();
			while ($data7 = mysql_fetch_array($hasil7)) {
				$sql8 = "SELECT * FROM form_element_value WHERE elementSubParentID = '".$data7["elementSubID"]."'";
				//echo "<br>sql2: ".$sql2;
				if ($hasil8 = mysql_query($sql8)) {
					if (mysql_num_rows(mysql_query($sql8))){
						$product_name[$data7["elementSubID"]] = array();
						while ($data8 = mysql_fetch_array($hasil8)) {
							$product_name[$data7["elementSubID"]][$data8["valueID"]] = $data8["valueName"];
						}
					}
				}
			}
		}
	}

    print json_encode( $product_name[ $_POST[ 'product_category' ] ] );
	//var_dump($product_name);
	exit;	
	?>
