<?php

			//Grab history for this property.
			$id = findassetbyname($assetname);
			if ($id <= 0)
			{				
				//echo "] }\r\n";		
				continue;
			}
			
			$ass = new Asset($id);
			$prx = $ass->GetProperties();
			$foundprop = 0;
								
			$data = array();
						
			foreach($prx as $d)
			{
				if ($propertyname == "all analog")
				{
					switch($d->type)
					{
						case 'MEASUREMENT':						
							$data[] = $d;
					}
				}
				if ($propertyname == "all discrete")
				{
					switch($d->type)
					{						
						case 'STATUS':
						case 'ENUM':
						case 'LOOKUP':
							$data[] = $d;
					}
				}
				
				if (strtolower($propertyname) == strtolower($d->name))
				{
					$data[] = $d;
				}
			}
			
			//$data = $ass->GetProperties();			
			
			$ass->GetValues($data);
			
			$assnm = $ass->name;
			if ($ass->ern != "")
			{
				$assnm = $ass->ern;
			}
			
			//echo 'Boo!';
?>
	{
		"columns": [
			{
				"text": "Property",
				"type": "string",
				"sort": true,
				"desc": false
			},
			{ "text": "Value" }
			<?php
		/*foreach($data as $prp)
		{
			echo ', { "text": "'.$prp->name.'" }';
		}*/?>
		],
		"rows": [
		<?php
		$first = true;		
		foreach($data as $prp)
		{
			switch ($prp->type)
			{
				case "ARMARKER":
				case "LOCATION":
				case "SYMBOL":
				case "AROFFSET":
				case "ARID":
				case "MODEL":
				  continue;
			}
			
			if ($first == true)
				$first = false;
			else
				echo ',';
			$ex = ExtractValue($prp,true);
			
			echo ' [ "'.$assnm.' '.$prp->name.'","'.$ex.'" ]';
		}
		?>
		],
		"type": "table"
	}
