. * * Version 0.1 * Author: Octavio Benedi Sanchez */ function make_select($name,$options,$selected_option="",$onclick_js="") { // This will make a select html tag with the name and optios defined. if (!empty($onclick_js)) { $select=''; } foreach($options as $option) { if((string)$option==$selected_option) { $selected='selected="yes"'; } else { $selected=''; } $select.=''; } $select.=""; return $select; } function make_select_detailed($name,$options,$selected_option="",$onclick_js="") { if ($onclick_js!='') { $select=''; } foreach($options as $value=>$option) { if((string)$value==$selected_option) { $selected='selected="yes"'; } else { $selected=''; } $select.=''; } $select.=""; return $select; } function convert_to_table($data,$id) { // Given an array it will convert the array to a table using each component as row // and space or tabs as column separator. $pattern_text = '/[\ \t]+/'; $return=''; foreach ($data as $line) { // Remove \n an not desired separators. $line=trim($line); $return.=''; } $return.='
'.preg_replace($pattern_text,'',$line).'
'; return $return; } ?>