webui: Added an empty option for delete device selection, and a minor db performance fix (#7018)

* webui: Added an empty option, also minor performance fix on the db query

* Added missing backtick

* Added html options per Laf's suggestion
This commit is contained in:
Aldemir Akpinar
2017-07-14 13:40:29 +03:00
committed by Neil Lathwood
parent 039e410d6d
commit 550e412808

View File

@@ -57,8 +57,9 @@ if ($_SESSION['userlevel'] == 11) {
<label for="id" class="col-sm-2 control-label">Device:</label>
<div class="col-sm-10">
<select name="id" class="form-control" id="id">
<option disabled="disabled" selected="selected">Please select</option>
<?php
foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $data) {
foreach (dbFetchRows("SELECT `device_id`, `hostname` FROM `devices` ORDER BY `hostname`") as $data) {
echo("<option value='".$data['device_id']."'>".$data['hostname']."</option>");
}