2020-06-10 13:38:33 +03:00
< ? php
$device_groups = " " ;
foreach ( dbFetchRows ( " select dg.id, dg.name from devices d, device_group_device g, device_groups dg where dg.id=g.device_group_id and g.device_id=d.device_id and d.hostname=? order by dg.name " , array ( $device [ 'hostname' ])) as $groups ) {
$device_groups .= ( empty ( $device_groups ) ? " " : str_repeat ( " " , 4 )) . '<a class="list-device" href="/devices/group=' . $groups [ 'id' ] . '" target="_blank">' . $groups [ 'name' ] . '</a>' ;
}
if ( ! empty ( $device_groups )) {
echo " <div class='row'>
< div class = 'col-md-12' >
< div class = 'panel panel-default panel-condensed device-overview' >
< div class = 'panel-heading' > " ;
2020-06-10 18:41:19 +03:00
echo '<a href="/device-groups">' ;
echo '<i class="fa fa-th fa-lg icon-theme" aria-hidden="true"></i><strong>Device Group Membership</strong>' ;
echo '</a></div><div class="panel-body">' ;
2020-06-10 13:38:33 +03:00
echo ' < div class = " row " >
< div class = " col-sm-12 " > ' . $device_groups . ' </ div >
</ div > ' ;
echo " </div>
</ div >
</ div >
</ div > " ;
}