Example #1
0
             } else {
                 echo "\t\t\t\t\t<option value=\"" . $field["device_mac_address"] . "\">" . $field["device_mac_address"] . "  " . $field['device_model'] . " " . $field['device_description'] . "</option>\n";
             }
         }
     }
 }
 unset($sql, $result, $result_count);
 echo "\t\t\t\t</select>\n";
 echo "\t\t\t\t<input type='button' id='btn_select_to_input_device_mac_address' class='btn' name='' alt='" . $text['button-back'] . "' onclick='changeToInput_device_mac_address(document.getElementById(\"device_mac_address\"));this.style.visibility = \"hidden\";' value='&#9665;'>\n";
 echo "\t</td>\n";
 echo "\t</tr>\n";
 echo "\t</table>\n";
 echo "\t\t</td>\n";
 echo "\t\t<td class='vtable'>";
 $device = new device();
 $template_dir = $device->get_template_dir();
 echo "<select id='device_template' name='device_template' class='formfld'>\n";
 echo "<option value=''></option>\n";
 if ($dh = opendir($template_dir)) {
     while ($dir = readdir($dh)) {
         if ($file != "." && $dir != ".." && $dir[0] != '.') {
             if (is_dir($template_dir . "/" . $dir)) {
                 echo "<optgroup label='{$dir}'>";
                 if ($dh_sub = opendir($template_dir . '/' . $dir)) {
                     while ($dir_sub = readdir($dh_sub)) {
                         if ($file_sub != '.' && $dir_sub != '..' && $dir_sub[0] != '.') {
                             if (is_dir($template_dir . '/' . $dir . '/' . $dir_sub)) {
                                 if ($device_template == $dir . "/" . $dir_sub) {
                                     echo "<option value='" . $dir . "/" . $dir_sub . "' selected='selected'>" . $dir . "/" . $dir_sub . "</option>\n";
                                 } else {
                                     echo "<option value='" . $dir . "/" . $dir_sub . "'>" . $dir . "/" . $dir_sub . "</option>\n";