68 $html =
'<select class="flat" id="'.$htmlname.
'" name="'.$htmlname.
'">';
70 $html.=
'<option value="-1"> </option>';
72 $arrayoflabels = $tmpep->labelStatus;
74 $arrayoflabels = $tmpep->labelStatusShort;
76 foreach ($arrayoflabels as $key => $val) {
77 if ($selected !=
'' && $selected == $key) {
78 $html .=
'<option value="'.$key.
'" selected>';
80 $html .=
'<option value="'.$key.
'">';
82 $html .= $langs->trans($val);
103 global $langs, $user;
104 $langs->load(
"trips");
108 $out .=
'<select class="flat" name="'.$htmlname.
'" id="'.$htmlname.
'">';
110 $out .=
'<option value="-1"';
111 if ($selected == -1) {
114 $out .=
'> </option>';
117 $sql =
"SELECT c.id, c.code, c.label as type FROM ".$this->db->prefix().
"c_type_fees as c";
119 $sql .=
" WHERE c.active = ".((int) $active);
121 $sql .=
" ORDER BY c.label ASC";
122 $resql = $this->db->query($sql);
124 $num = $this->db->num_rows($resql);
128 $obj = $this->db->fetch_object($resql);
129 $out .=
'<option value="'.$obj->id.
'"';
130 if ($obj->code == $selected || $obj->id == $selected) {
134 if ($obj->code != $langs->trans($obj->code)) {
135 $out .= $langs->trans($obj->code);
137 $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.