69 $html =
'<select class="flat'.($morecss ?
' '.$morecss :
'').
'" id="'.$htmlname.
'" name="'.$htmlname.
'">';
71 $html.=
'<option value="-1"> </option>';
73 $arrayoflabels = $tmpep->labelStatus;
75 $arrayoflabels = $tmpep->labelStatusShort;
77 foreach ($arrayoflabels as $key => $val) {
78 if (!empty($selected) && $selected == $key) {
79 $html .=
'<option value="'.$key.
'" selected>';
81 $html .=
'<option value="'.$key.
'">';
83 $html .= $langs->trans($val);
86 $html .=
'</select>'.
"\n";
88 $html .=
ajax_combobox($htmlname, array(), 0, 0,
'resolve', ($useempty < 0 ? (
string) $useempty :
'-1'), $morecss);
105 global $langs, $user;
106 $langs->load(
"trips");
110 $out .=
'<select class="flat" name="'.$htmlname.
'" id="'.$htmlname.
'">';
112 $out .=
'<option value="-1"';
113 if ($selected == -1) {
116 $out .=
'> </option>';
119 $sql =
"SELECT c.id, c.code, c.label as type FROM ".$this->db->prefix().
"c_type_fees as c";
121 $sql .=
" WHERE c.active = ".((int) $active);
123 $sql .=
" ORDER BY c.label ASC";
124 $resql = $this->db->query($sql);
126 $num = $this->db->num_rows($resql);
130 $obj = $this->db->fetch_object($resql);
131 $out .=
'<option value="'.$obj->id.
'"';
132 if ($obj->code == $selected || $obj->id == $selected) {
136 if ($obj->code != $langs->trans($obj->code)) {
137 $out .= $langs->trans($obj->code);
139 $out .= $langs->trans($obj->type);
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Class to manage Trips and Expenses.