/*
FUNCTION FUNCTION load_visit_type($field_name,$form_name,$curr_item,$add_blank=false,$auto_submit=false,$readonly='',$disabled='') {
$a_code = array();
$a_desc = array();
$a_code[]="1";
$a_code[]="2";
$a_code[]="3";
$a_code[]="4";
$a_desc[]="Initial Home Assessment";
$a_desc[]="Follow up Home Assessment";
$a_desc[]="Routine Home Visist Assessment";
$a_desc[]="Emergency";
$opt="";
if ($auto_submit==true) {
$opt="<select name='$field_name' onchange='document.".$form_name. ".submit();'>" ;
} else {
$opt="<select name='$field_name' ".$readonly." " .$disabled.">" ;
} if ($add_blank==true) {
$opt .= "<option value=''";
if ( $curr_item == '' ) {
$opt .= ' selected="selected" ';
}
$opt .= ' ></option>' ;
}
$no_of_element=count($a_code);
for ($i = 0; $i < $no_of_element; $i++) {
$opt .= "<option value='" . $a_code[$i] ."'";
if ( trim($curr_item) == $a_code[$i] ) {
$opt .= ' selected="selected"';
}
$opt .= ">". $a_desc[$i]. "</option>";
}
$opt .="</select>";
return $opt;
}
$add_blank=true;
$auto_submit=false;
call by :
$this->load_visit_type("visit_type","form1",$this->visit_type,$add_blank,$auto_submit)
$vtype = $this->load_visit_type("visit_type","form1",$db->record['visit_type'],true,false,'readonly','disabled');
*/
No comments:
Post a Comment