<?php class crm_picklist
	{
	   
	   var $picklist_id = null;
	    var $parent_id= null;
		 var $picklist_title= null;
		  var $status = null;
		  
 		public function crm_picklist()  
		{
		 
		}
		   function  GetPicklist_ItemData($title,$catid,$subcatid,$selval='' )
		   { 
		   
 			 		global $db;
				//	echo "SELECT * FROM crm_picklist_itemdata where   mst_pl_catid ='".$catid."' and status='1' and mst_pl_subcatid=$subcatid";
 					$sql=DB_query("SELECT * FROM crm_picklist_itemdata where   mst_pl_catid ='".$catid."' and status='1' and mst_pl_subcatid=$subcatid",$db);		
					if(!$sql)
					{
					   die('Error.'.DB_error_msg($db));
					}
 		echo "<select name='".$title."'  style='width:150px;' >";
					echo "<option value='000'>---</option>";
					while($row=DB_fetch_array($sql))
					{
					   $p='';
					   if($row['id']==$selval)
					   $p='selected';
					  echo "<option value='".$row['id']."' $p >".$row['picklist_title']."</option>";
					}
					echo "</select>";
					 
			}
	
	}
	
	$CRMPickList=new crm_picklist();
	?>
