<?php
session_start();
include_once("../db/db.php");

$opt_array=array();

if(isset($_REQUEST["ddata"])) {
	$ddata_array = explode(":",$_REQUEST["ddata"]);
	$dfld = $ddata_array[0];
	$dmkt = $ddata_array[1];
	$dtrg = $ddata_array[2];
	
	$rsql = 'select opt_id,opt_desc from mst_socio  where srv_mrkt = ' . $dmkt . ' and factorid = '. $dfld . ' order by 1';
	
	$rrslt = mysql_query($rsql);
	if(mysql_num_rows($rrslt) >0) {
		while($rrw=mysql_fetch_assoc($rrslt)) {
			$opt_array[$rrw['opt_id']]=$rrw['opt_desc'];
		}
	}
}

//echo "0: ;";
foreach($opt_array as $ky=>$opts) {
	echo $ky.":".$opts.";";
} 
?>