* @package AgileBill * @version 1.4.93 */ function list_check($input_id, $name, $table, $field, $default, $class) { global $C_translate; # get default if(!isset($default)) { $default = Array(''); } else if (gettype($default) == 'array') { $default = $default; } else if (gettype($default) == 'string') { $default = unserialize($default); } else { $default = Array(''); } # get the records $db = &DB(); $sql= "SELECT id, $field FROM ".AGILE_DB_PREFIX."$table WHERE site_id = " . $db->qstr(DEFAULT_SITE) . " ORDER BY $field"; $result = $db->Execute($sql); # error handling if ($result === false) { global $C_debug; $C_debug->error('list.inc.php','check', $db->ErrorMsg()); } # loop through the records $i = 0; while (!$result->EOF) { # Create the return code for Smarty $checked = ''; for($ii=0; $iifields["id"] || $default[$i] == 'all') $checked = ' checked'; } $return .= ' ' . $result->fields["$field"] . '
'; $i++; $result->MoveNext(); } if($i==0) $return .= 'None Defined'; ### TRANSLATE echo $return; } ?>