49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Config;
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
|
|
|
class Printers extends BaseConfig
|
|
{
|
|
public array $printers = [
|
|
"lab" => [
|
|
"name" => "Lab Printer",
|
|
"command" => "copy /B file.txt \\\\glenlis\\zebralab",
|
|
],
|
|
"phlebo" => [
|
|
"name" => "Phlebo Printer",
|
|
"command" => "copy /B file.txt \\\\print-server\\phlebo-printer",
|
|
],
|
|
"reception" => [
|
|
"name" => "Reception Printer",
|
|
"command" => 'copy /B file.txt \\\\print-server\\reception-printer',
|
|
],
|
|
];
|
|
|
|
public array $roleDefaults = [
|
|
0 => "lab",
|
|
1 => "lab",
|
|
2 => "lab",
|
|
3 => "phlebo",
|
|
4 => "reception",
|
|
];
|
|
|
|
public string $defaultPrinter = "lab";
|
|
|
|
public function getPrinter(string $printerKey): ?array
|
|
{
|
|
return $this->printers[$printerKey] ?? null;
|
|
}
|
|
|
|
public function getCommand(string $printerKey): ?string
|
|
{
|
|
return $this->printers[$printerKey]["command"] ?? null;
|
|
}
|
|
|
|
public function getDefaultForRole(int $roleId): string
|
|
{
|
|
return $this->roleDefaults[$roleId] ?? $this->defaultPrinter;
|
|
}
|
|
}
|