irm/include/functions.php
/*
string usersDropdown(string ddname[, string ddvalue])
	Returns an HTML SELECT dropdown of all users in the
	database.

	ddname: The name attribute for the SELECT
	ddvalue (optional): The default value of the SELECT
*/
string usersDropdown(string ddname[, string ddvalue])
Returns an HTML SELECT dropdown of all users in the
database.

The name attribute for the SELECT
ddvalue (optional): The default value of the SELECT
string usersDropdown ( string ddname [ string ddvalue ] ) Returns an HTML SELECT dropdown of all users in the database . The name attribute for the SELECT ddvalue ( optional ) : The default value of the SELECT
function usersDropdown($ddname, $ddvalue = '')
{
	$dropdown = '';
	$DB = Config::Database();
	$query = "SELECT `name`,fullname FROM users ORDER BY fullname";
	$result = $DB->getAll($query);
	if (!MDB::isError($result))
	{
		$dropdown = "<select name=\"$ddname\">\n";
		$dropdown .= "<option value=\"\">None</option>\n";
		foreach ($result as $row)
		{
			$dropdown .= "<option value=\"" . $row['name'] . "\"";
			if (($ddvalue <> '') && ($ddvalue == $row['name']))
			{
				$dropdown .= " selected";
			}
			$dropdown .= ">" . $row['fullname'] . " (" . $row['name'] .
									 ")</option>\n";
		}
	}
	return $dropdown;
}
function usersDropdown ( $ ddname , $ ddvalue = '' ) { $ dropdown = '' ; $ DB = Config :: Database ( ) ; $ query = " SELECT `name`,fullname FROM users ORDER BY fullname " ; $ result = $ DB -> getAll ( $ query ) ; if ( ! MDB :: isError ( $ result ) ) { $ dropdown = " <select name= \" $ ddname \" > \n " ; $ dropdown .= " <option value= \" \" >None</option> \n " ; foreach ( $ result as $ row ) { $ dropdown .= " <option value= \" " . $ row [ 'name' ] . " \" " ; if ( ( $ ddvalue <> '' ) && ( $ ddvalue == $ row [ 'name' ] ) ) { $ dropdown .= "  selected " ; } $ dropdown .= " > " . $ row [ 'fullname' ] . "  ( " . $ row [ 'name' ] . " )</option> \n " ; } } return $ dropdown ; }
string usersDropdown(string ddname[, string ddvalue])
Returns an HTML SELECT dropdown of all users in the
database.
string usersDropdown ( string ddname [ string ddvalue ] ) Returns an HTML SELECT dropdown of all users in the database .
// Include a blank