* @package AgileBill
* @version 1.4.93
*/
function list_radio($input_id, $name, $table, $field, $id, $class)
{
global $C_translate;
$db = &DB();
$sql= "SELECT id, $field FROM ".AGILE_DB_PREFIX."$table WHERE site_id = '" . DEFAULT_SITE . "' ORDER BY $field";
$result = $db->Execute($sql);
if ($result === false)
{
global $C_debug;
$C_debug->error('list.inc.php','radio', $db->ErrorMsg());
}
if($result->RecordCount() >= 5)
{
$count = 5;
}else{
$count = $result->RecordCount();
}
if($id == "all")
$return .= ' All
';
$i = 0;
while (!$result->EOF) {
if($id == $result->fields["id"])
{
$return .= ' ' . $result->fields["$field"] . '
';
}
else
{
$return .= ' ' . $result->fields["$field"] . '
';
}
$i++;
$result->MoveNext();
}
if($i==0)
$return .= ''. $C_translate->translate('lists_none_defined','CORE','');
return $return;
}
?>