checkPermissions('admin-devices', 'RO', true)) { echo 'error 401 unauthorized'; exit; } # Page functions function showExtension($devicesLinked, $filter = false) { if (count($devicesLinked) > 0) { foreach ($devicesLinked as $extension) { if ($filter === false || $extension['device_type'] == $filter) { ?>
...

checkPermissions('admin-devices-files', 'RW', true)) { ?>
>
>
>
checkPermissions('admin-devices', 'RW', true)) { $pageNavbar->AddHTMLButton(''); $get_view = htmlspecialchars($_GET['view'], ENT_QUOTES, 'UTF-8'); $pageNavbar->AddHTMLButton(' ' . __('edit') . ''); $pageNavbar->AddHTMLButton(''); } # Retrieve Information for the page $stmt = $GLOBALS['conn']->prepare("SELECT * FROM vc_devices INNER JOIN vc_vendors ON vc_devices.device_vendor_uuid = vc_vendors.vendor_uuid WHERE device_uuid = ?"); $stmt->bind_param("s", $_GET['view']); $stmt->execute(); $device_data_result = $stmt->get_result(); if ($device_data_result->num_rows == 0) { echo "No Vendor found with uuid " . htmlspecialchars($_GET['edit'], ENT_QUOTES, 'UTF-8'); exit; } else { $device_data = $device_data_result->fetch_assoc(); } # Set breadcrumb data array_push($GLOBALS['breadCrumbArray'], array('display' => __('devices'), 'href' => '/devices/')); array_push($GLOBALS['breadCrumbArray'], array('display' => $device_data['vendor_name'] . ' ' . $device_data['device_name'], 'href' => '?view=' . $device_data['device_uuid'])); # Start page output $pageNavbar->outPutNavbar(); ?>

...
vendor_name:
device_uuid:
device_type:
device_name:
device_slugify:
device_enabled:
device_eol:
device_create_timestamp:
device_modified_timestamp:  
device_notes:
device_extra:

Uses

To be made. Its going to be visible where the device is used (organisation/site).
prepare($query); if ($stmt) { $searchTerm = "%" . $device_data['device_uuid'] . "%"; // Add wildcards manually $stmt->bind_param('s', $searchTerm); $stmt->execute(); $result = $stmt->get_result(); $device_extensions = array(); while ($row = $result->fetch_assoc()) { array_push($device_extensions, $row['device_uuid']); } $stmt->close(); } } if (!empty($device_extensions)) { $placeholders = implode(' OR device_uuid = ', array_fill(0, count($device_extensions), '?')); $query = "SELECT * FROM vc_devices WHERE device_uuid = " . $placeholders; $stmt = $GLOBALS['conn']->prepare($query); if ($stmt) { $types = str_repeat('s', count($device_extensions)); $stmt->bind_param($types, ...$device_extensions); $stmt->execute(); $result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { array_push($devicesLinked, $row); } $stmt->close(); } } $connectedDeviceCards = []; if (in_array($device_data['device_type'], ['phone', 'base'])) { $connectedDeviceCards[] = [ 'title' => __('extensions_available'), 'filter' => 'module' ]; } if ($device_data['device_type'] == 'base') { $connectedDeviceCards[] = [ 'title' => __('handsets_available'), 'filter' => 'handset' ]; } if (in_array($device_data['device_type'], ['module', 'handset'])) { $connectedDeviceCards[] = [ 'title' => __('parent_device'), 'filter' => false ]; } foreach ($connectedDeviceCards as $card) { ?>

checkPermissions('admin-devices-files', 'RW', true)) { ?>