function agent_picker($name, $value = '', $filter = '', $onselect = '', $settings = '', $clientcompanyproperty = 0){
global $agent_picker_count;
$agent_picker_count += 1;
?>
if($agent_picker_count == 1){ // WE ONLY NEED ONE PICKER UI ?>
}
if($value){
$sql = "select *
from tblstaff
join tbllogin
using (staffid)
where staffid = " . db_col($value);
$staff = db_first($sql);
}
?>
if(!$settings['hide_input'])
{
?>
if($staff && file_exists($_SERVER['DOCUMENT_ROOT'] . '/loginprofileimages/' . $staff['loginid'] . '.jpg')){
$size = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/loginprofileimages/' . $staff['loginid'] . '.jpg');
if($size[0] > $size[1])
$orientation = 'landscape';
else
$orientation = 'portrait';
?>

.jpg' class=' echo $orientation; ?>' />
}else{ ?>

}
global $icnt;
?>
}
//$property_address = "$clientcompanyproperty[clientcompanypropertyaddress] $clientcompanyproperty[clientcompanypropertycity] $clientcompanyproperty[clientcompanypropertystate] $clientcompanyproperty[clientcompanypropertyzip]";
if ($clientcompanyproperty){
$property_thumb = get_photo_thumbnail_url($clientcompanyproperty[imageid], supertiny);
if ($property_thumb=="")
$property_thumb="images/noimage.jpg";
$property_address = htmlentities("Select Agent For:
$clientcompanyproperty[clientcompanypropertyaddress] $clientcompanyproperty[clientcompanypropertycity] $clientcompanyproperty[clientcompanypropertystate] $clientcompanyproperty[clientcompanypropertyzip]", ENT_QUOTES);
}
?>
'
class='agent_name'
data-instance=' echo $agent_picker_count; ?>'
readonly='readonly'
value=' echo $staff['stafffname'] . " " . $staff['stafflname']; ?>'
onclick="agent_picker_launch(this, echo phparray_to_jsarray($filter); ?>);"
data-onselect=' echo $onselect; ?>'
data-address=' echo $property_address ?>'
id=agent_picker_
/>
if($agent_picker_count == 1){
$cpid = $clientcompanyproperty;
if(is_array($clientcompanyproperty))
$cpid = $clientcompanyproperty[clientcompanypropertyid];
?>
}
}
?>