10 my ($self, %params) = @_;
12 my $dbh = $::auth->get_user_dbh($params{login});
14 my $query = qq|SELECT * FROM printers ORDER BY printer_description|;
15 my @printers = selectall_hashref_query($::form, $dbh, $query);
19 $::lxdebug->leave_sub;
21 return wantarray ? @printers : \@printers;
25 $::lxdebug->enter_sub;
27 my ($self, %params) = @_;
29 my $dbh = $::auth->get_user_dbh($params{login});
31 my $query = qq|SELECT * FROM printers WHERE id = ?|;
32 my ($printer) = selectfirst_hashref_query($::form, $dbh, $query, $params{id});
36 $::lxdebug->leave_sub;
42 $main::lxdebug->enter_sub();
44 my ($self, %params) = @_;
47 my $dbh = $::auth->get_user_dbh($params{login});
48 my $printer = $params{printer};
50 unless ($printer->{id}) {
51 ($printer->{id}) = selectfirst_array_query($::form, $dbh, "SELECT nextval('id'::text)");
52 do_query($::form, $dbh, "INSERT INTO printers (id, printer_description) VALUES (?, '')", $printer->{id});
57 printer_description = ?,
62 do_query($::form, $dbh, $query,
63 $printer->{printer_description},
64 $printer->{template_code},
65 $printer->{printer_command},
72 $::lxdebug->leave_sub;
76 $::lxdebug->enter_sub;
78 my ($self, %params) = @_;
80 my $dbh = $::auth->get_user_dbh($params{login});
82 my $query = qq|DELETE FROM printers WHERE id = ?|;
83 do_query($::form, $dbh, $query, $params{id});
88 $::lxdebug->leave_sub;