diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index 3b7206dd5f..a5c4ae3258 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -213,6 +213,15 @@ $device_keys[$x]['device_key_protected'] = ''; $device_keys[$x]['device_key_label'] = ''; +//get the vendors + $sql = "SELECT * "; + $sql .= "FROM v_device_vendors as v "; + $sql .= "where enabled = 'true' "; + $sql .= "order by name asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $vendors = $prep_statement->fetchAll(PDO::FETCH_NAMED); + //get the vendor functions $sql = "SELECT v.name as vendor_name, f.name, f.value "; $sql .= "FROM v_device_vendors as v, v_device_vendor_functions as f "; @@ -224,6 +233,15 @@ $prep_statement->execute(); $vendor_functions = $prep_statement->fetchAll(PDO::FETCH_NAMED); +//get the vendor count + $vendor_count = 0; + foreach($device_keys as $row) { + if ($previous_vendor != $row['device_key_vendor']) { + $previous_vendor = $row['device_key_vendor']; + $vendor_count++; + } + } + //show the header require_once "resources/header.php"; $document['title'] = $text['title-profile']; @@ -288,14 +306,6 @@ echo "\n"; echo "\n"; - $vendor_count = 0; - foreach($device_keys as $row) { - if ($previous_vendor != $row['device_key_vendor']) { - $previous_vendor = $row['device_key_vendor']; - $vendor_count++; - } - } - echo "