i had forgotten tmpl tags for delete_confirm and delete_confirmed
[koha.git] / jmemberentry.pl
1 #!/usr/bin/perl
2
3 #script to set up screen for modification of borrower details
4 #written 20/12/99 by chris@katipo.co.nz
5
6
7 # Copyright 2000-2002 Katipo Communications
8 #
9 # This file is part of Koha.
10 #
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 #
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA  02111-1307 USA
23
24 use strict;
25 use C4::Output;
26 use CGI;
27 use C4::Search;
28 use HTML::Template;
29
30 my $input = new CGI;
31
32 my $template = gettemplate("members/jmemberentry.tmpl");
33
34 my $member=$input->param('bornum');
35 if ($member eq ''){
36   $member=NewBorrowerNumber();
37 }
38 my $type=$input->param('type');
39
40 my $data=borrdata('',$member);
41
42 my @titles = ('Miss', 'Mrs', 'Ms', 'Mr', 'Dr', 'Sir');
43         # FIXME - Assumes English. This ought to be made part of i18n.
44 my @titledata;
45 while (@titles) {
46   my $title = shift @titles;
47   my %row = ('title' => $title);
48   if ($data->{'title'} eq $title) {
49     $row{'selected'}=' selected';
50   } else {
51     $row{'selected'}='';
52   }
53   push(@titledata, \%row);
54 }
55
56 # get the data for children
57 my $cmember1=NewBorrowerNumber();
58 my @cmemdata;
59 for (my $i=0;$i<3;$i++){
60   my %row;
61   $row{'cmember'}=$cmember1+$i;
62   $row{'i'}=$i;
63   $row{'count'}=$i+1;
64   push(@cmemdata, \%row);
65 }
66
67
68 $template->param( startmenumember => startmenu('member'),
69                         endmenumember   => endmenu('member'),
70                         member          => $member,
71                         firstname       => $data->{'firstname'},
72                         surname         => $data->{'surname'},
73                         cardnumber      => $data->{'cardnumber'},
74                         area            => $data->{'area'},
75                         city            => $data->{'city'},
76                         address         => $data->{'address'},
77                         streetaddress   => $data->{'streetaddress'},
78                         streetcity      => $data->{'streetcity'},
79                         phone           => $data->{'phone'},
80                         phoneday        => $data->{'phoneday'},
81                         faxnumber       => $data->{'faxnumber'},
82                         emailaddress    => $data->{'emailaddress'},
83                         contactname     => $data->{'contactname'},
84                         altphone        => $data->{'altphone'},
85                         titleloop       => \@titledata,
86                         cmemloop        => \@cmemdata );
87
88 print "Content-Type: text/html\n\n", $template->output;