<?php
/**
 * JE GroupBuy package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2011 - 2012 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/


defined('JPATH_BASE') or die;

jimport('joomla.html.html');
jimport('joomla.form.formfield');
JFormHelper::loadFieldClass('list');

/**
 * Supports an HTML select list of contacts
 */
class JFormFieldUserlist extends JFormFieldList
{
	/**
	 * The form field type.
	 */
	protected $type				= 'Userlist';

	/**
	 *  Method to get the field input markup.
	 */
	protected function getOptions()
	{
		// Initialise variables.
		$options		= array();
		$db				= & JFactory::getDbo();
		$query			= $db->getQuery(true);

		$query->select('id');
		$query->from('#__users');
		$db->setQuery($query);

		$prod			= $db->loadObjectList();

		foreach ( $prod as $key=>$value ) {
			$options[]	= JHTML::_('select.option',  $value->id, $value->id);
		}

		return $options;

	}

}
?>