<?php

	include_once('../config1.php');  
    $Data = json_encode($_POST);  
    mysql_query("insert into test (name) values('$Data')");  
        
	if($_POST['city'])
	{
		$result = mysql_query("select * from city_lacations where city_id=$_POST[id] ");  
		if(mysql_num_rows($result) > 0)
		{
		$option = '<label>Select City Locations</label> <select name=location_id>'; 
		while($dt = mysql_fetch_object($result)) 
		  $option .='<option value='.$dt->id.'>'.$dt->location_name.'</option>';   
		 
		$option .='</select>'; 
		echo $option;
		}else
		{
			echo 'No Location Available';
		}
		die; 
	} 
	
	
	if($_POST['main_service'])
	{ 
		$result = mysql_query("select * from sub_service_categories where category_id = $_POST[id] ");   
		if(mysql_num_rows($result) > 0)
		{
			$option = '<label>Select Service</label> <select name=sub_category_id>'; 
			while($dt = mysql_fetch_object($result)) 
			  $option .='<option value='.$dt->id.'>'.$dt->name.'</option>';   
			 
			$option .='</select>'; 
			echo $option;
			die;
		}else
		{
			echo 'No Sub Service Available';
		}
		die;
	
	}   
?>
