xdb->iterRow($sql);
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
$html = "";
if ($pad) {
$html.= '\n";
}
while (list($my_id,$my_text) = $res->next()) {
$html .= sprintf("\n",$my_id,($valeur==$my_id?$sel:""),$my_text);
}
return $html;
}
function smarty_function_select_db_table($params, &$smarty) {
if(empty($params['table']))
return;
if(empty($params['champ']))
$params['champ'] = 'text';
if(empty($params['pad']) || !($params['pad']))
$pad = false;
else
$pad = true;
if(empty($params['where']))
$params['where'] = '';
return select_options($params['table'], $params['valeur'], $params['champ'], $pad, $params['where']);
}
?>