* @copyright (C) Adam Armstrong * */ register_html_title("Printing"); $navbar = []; $navbar['brand'] = "Printer supplies"; $navbar['class'] = "navbar-narrow"; // Convert generic view to supply var if (!isset($vars['supply']) && isset($vars['view'])) { $vars['supply'] = $vars['view']; unset($vars['view']); } foreach ($printing_tabs as $type) { if (!$vars['supply']) { $vars['supply'] = $type; } $navbar['options'][$type]['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'printing', 'supply' => $type]); $navbar['options'][$type]['text'] = nicecase($type); if ($vars['supply'] == $type) { $navbar['options'][$type]['class'] = "active"; } } if (dbExist('counters', '`device_id` = ? AND `counter_class` = ?', [$device['device_id'], 'printersupply'])) { $navbar['options']['counters']['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'printing', 'supply' => 'counters']); $navbar['options']['counters']['text'] = 'Printed counters'; if ($vars['supply'] == 'counters') { $navbar['options']['counters']['class'] = "active"; } } print_navbar($navbar); unset($navbar); switch ($vars['supply']) { case 'counter': case 'counters': echo generate_box_open(); echo('