4 use lib '/srv/koha_ffzg';
6 $ENV{KOHA_CONF} = '/etc/koha/sites/ffzg/koha-conf.xml';
11 use Data::Dump qw(dump);
18 my $barcode = $c->param('barcode');
19 $c->stash( barcode => $barcode );
21 my $dbh = C4::Context->dbh;
22 my $sth_items = $dbh->prepare(qq{
29 join biblio on biblio.biblionumber = items.biblionumber where barcode = ?
33 $sth_items->execute( $barcode );
34 while ( my $row = $sth_items->fetchrow_hashref ) {
35 warn "# items row ",dump($row);
36 $c->stash( $_ => $row->{$_} ) foreach keys %$row;
39 my $sth_update = $dbh->prepare(qq{
40 update items set datelastseen = now() where barcode = ?
43 my $sth_inventura = $dbh->prepare(qq{
44 insert ignore into ffzg_inventura (date_scanned,barcode,source_id) values (date(now()), ?, 'abc')
47 my $sth_issues = $dbh->prepare(qq{
48 select firstname,surname,userid,email from issues join borrowers on issues.borrowernumber = borrowers.borrowernumber where itemnumber = ?
51 $sth_update->execute( $barcode );
52 $sth_inventura->execute( $barcode );
54 $sth_issues->execute( $c->stash('itemnumber') );
55 while ( my $row = $sth_issues->fetchrow_hashref ) {
56 warn "# issues row ",dump($row);
57 $c->stash( $_ => $row->{$_} ) foreach keys %$row;
58 AddReturn( $barcode, 'FFZG' );
61 $c->render(template => 'index');
70 %= form_for '/' => begin
71 %#= text_field 'barcode'
72 <input name=barcode size=10 autofocus>
73 %= submit_button 'Scan'
76 % if ( stash('title') ) {
77 <%= stash('author') %>
78 <b><%= stash('title') %></b>
79 <%= stash('barcode') %>
81 <big style="color:red"><%= stash('barcode') %> not found</big>
84 % if ( stash('userid') ) {
87 <tt><%= stash('userid') %></tt>
88 <%= stash('firstname') %>
89 <%= stash('surname') %>
90 <tt><%= stash('email') %></tt>
94 @@ layouts/default.html.ep
98 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
104 <title>Inventura</title>
106 <body><%= content %></body>