koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/intranet/cgi-bin/members boraccount.pl bor... [rel_TG]


From: Tumer Garip
Subject: [Koha-cvs] koha/intranet/cgi-bin/members boraccount.pl bor... [rel_TG]
Date: Sat, 10 Mar 2007 01:19:30 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_TG
Changes by:     Tumer Garip <tgarip1957>        07/03/10 01:19:30

Added files:
        intranet/cgi-bin/members: boraccount.pl borrowers_details.pl 
                                  deletemem.pl guarantor_search.pl 
                                  imemberentry.pl insertdata.pl 
                                  insertidata.pl insertjdata.pl 
                                  jmemberentry.pl mancredit.pl 
                                  maninvoice.pl manualcredit.pl 
                                  member-flags.pl member-password.pl 
                                  member-picupload.pl member.pl 
                                  memberentry.pl members-home.pl 
                                  moremember.pl newimember.pl 
                                  newjmember.pl newmember.pl pay.pl 
                                  payprint.pl readingrec.pl setdebar.pl 

Log message:
        fresh files for rel_TG

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/boraccount.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/borrowers_details.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/deletemem.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/guarantor_search.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/imemberentry.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/insertdata.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/insertidata.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/insertjdata.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/jmemberentry.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/mancredit.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/maninvoice.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/manualcredit.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/member-flags.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/member-password.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/member-picupload.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/member.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/memberentry.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/members-home.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/moremember.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/newimember.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/newjmember.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/newmember.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/pay.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/payprint.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/readingrec.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/members/setdebar.pl?cvsroot=koha&only_with_tag=rel_TG&rev=1.1.2.1

Patches:
Index: boraccount.pl
===================================================================
RCS file: boraccount.pl
diff -N boraccount.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ boraccount.pl       10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,103 @@
+#!/usr/bin/perl
+
+# $Id: boraccount.pl,v 1.1.2.1 2007/03/10 01:19:29 tgarip1957 Exp $
+
+#writen 11/1/2000 by address@hidden
+#script to display borrowers account details
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Date;
+use CGI;
+use C4::Search;
+use C4::Members;
+my $input=new CGI;
+
+my $theme = $input->param('theme'); # only used if allowthemeoverride is set
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/boraccount.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $bornum=$input->param('bornum');
+#get borrower details
+my $data=borrdata('',$bornum);
+
+#get account details
+my %bor;
+$bor{'borrowernumber'}=$bornum;
+my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
+my $totalcredit;
+if($total <= 0){
+       $totalcredit = 1;
+}
+my @accountrows; # this is for the tmpl-loop
+
+my $toggle;
+for (my $i=0;$i<$numaccts;$i++){
+       if($i%2){
+               $toggle = 0;
+       } else {
+               $toggle = 1;
+       }
+  $accts->[$i]{'toggle'} = $toggle;
+  $accts->[$i]{'amount'}+=0.00;
+  if($accts->[$i]{'amount'} <= 0){
+       $accts->[$i]{'amountcredit'} = 1;
+  }
+  $accts->[$i]{'amountoutstanding'}+=0.00;
+  if($accts->[$i]{'amountoutstanding'} <= 0){
+       $accts->[$i]{'amountoutstandingcredit'} = 1;
+  }
+  my %row = (   'date'              => format_date($accts->[$i]{'date'}),
+               'accountid' => $accts->[$i]{'accountid'},
+               'itemnum' => $accts->[$i]{'itemnumber'},
+               'amountcredit' => $accts->[$i]{'amountcredit'},
+               'amountoutstandingcredit' => 
$accts->[$i]{'amountoutstandingcredit'},
+               'toggle' => $accts->[$i]{'toggle'},
+               'description'       => $accts->[$i]{'description'},
+               'amount'            => sprintf("%.2f",$accts->[$i]{'amount'}),
+               'accounttype'   =>$accts->[$i]{'accounttype'},
+               'amountoutstanding' => 
sprintf("%.2f",$accts->[$i]{'amountoutstanding'}) );
+               
+  if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 
'FU'){
+    $row{'printtitle'}=1;
+    $row{'title'} = $accts->[$i]{'title'};
+  }
+
+  push(@accountrows, \%row);
+}
+
+$template->param(
+                       firstname       => $data->{'firstname'},
+                       surname         => $data->{'surname'},
+                       bornum          => $bornum,
+                       total           => sprintf("%.2f",$total),
+                       totalcredit => $totalcredit,
+                       accounts        => address@hidden );
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: borrowers_details.pl
===================================================================
RCS file: borrowers_details.pl
diff -N borrowers_details.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ borrowers_details.pl        10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,86 @@
+#!/usr/bin/perl
+# NOTE: This file uses standard 8-space tabs
+#       DO NOT SET TAB SIZE TO 4
+
+# $Id: borrowers_details.pl,v 1.1.2.1 2007/03/10 01:19:29 tgarip1957 Exp $
+
+#script to set up screen for modification of borrower details
+#written 20/12/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Members;
+use C4::Koha;
+use HTML::Template;
+use Date::Manip;
+use C4::Date;
+use C4::Input;
+use C4::Log;
+my $input = new CGI;
+my $dbh = C4::Context->dbh;
+my %data;
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/borrowers_details.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $data;
+my $categorycode=$input->param('categorycode');
+my $borrowernumber=$input->param('borrowernumber');
+my $description=$input->param('description');
+my $category_type=$input->param('category_type');
+
+ if ( $data{'surname'} eq '') 
+       {
+               $data=borrdata('',$borrowernumber);
+               %data=%$data;
+       }
+ my ($category_type,$description) = getcategorytype($data{'categorycode'});    
+
+$template->param(              borrowernumber  => $borrowernumber,#register 
number
+                               #transform value  in capital or capital for 
first letter of the word
+                               firstname       => ucfirst($data{'firstname'}),
+                               surname         => uc($data{'surname'}),
+                               categorycode    => $data{'categorycode'},
+                               title           => $data{'title'},
+                               category_type   => $category_type,
+       # #                     
+                               "title_".$data{'title'}             => " 
SELECTED ",                    
+                               dateofbirth     => 
format_date($data{'dateofbirth'}),
+                               description     =>$description
+#                              
+                               );
+       $template->param(Institution => 1) if ($category_type eq "I");
+       output_html_with_http_headers $input, $cookie, $template->output;
+
+# Local Variables:
+# tab-width: 8
+# End:
\ No newline at end of file

Index: deletemem.pl
===================================================================
RCS file: deletemem.pl
diff -N deletemem.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ deletemem.pl        10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,134 @@
+#!/usr/bin/perl
+
+# $Id: deletemem.pl,v 1.1.2.1 2007/03/10 01:19:29 tgarip1957 Exp $
+
+#script to delete items
+#written 2/5/00
+#by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+
+use CGI;
+use C4::Context;
+use C4::Search;
+use C4::Interface::CGI::Output;
+use C4::Output;
+use C4::Circulation::Circ2;
+use C4::Auth;
+use C4::Members;
+use C4::Log;
+my $input = new CGI;
+
+my $flagsrequired;
+# $flagsrequired->{borrower}=1;
+# my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, 
$flagsrequired);
+my ($template, $loggedinuser, $cookie)
+               = get_template_and_user({template_name => 
"members/deletemem.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {borrowers => 1},
+                                       debug => 1,
+                                       });
+
+
+#print $input->header;
+my $member=$input->param('member');
+my %env;
+$env{'nottodayissues'}=1;
+my %member2;
+$member2{'borrowernumber'}=$member;
+my $issues=currentissues(\%env,\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+       $i++;
+}
+my ($bor,$flags)=getpatroninformation(\%env, $member,'');
+if (C4::Context->preference("IndependantBranches")) {
+       my $userenv = C4::Context->userenv;
+       unless ($userenv->{flags} == 1){
+               unless ($userenv->{'branch'} eq $bor->{'branchcode'}){
+#                      warn "user ".$userenv->{'branch'} ."borrower :". 
$bor->{'branchcode'};
+                       print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$member");
+                       exit 1;
+               }
+       }
+}
+my $dbh = C4::Context->dbh;
+my $sth=$dbh->prepare("Select * from borrowers where guarantor=?");
+$sth->execute($member);
+my $data=$sth->fetchrow_hashref;
+$sth->finish;
+
+
+if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
+       
+       #   print $input->header;
+       $template->param(bornum => $member);
+       if ($i >0) {
+               $template->param(ItemsOnIssues => $i);
+       }
+       if ($flags->{'CHARGES'} ne '') {
+               $template->param(charges => $flags->{'CHARGES'}->{'message'});
+       }
+       if ($data ne '') {
+               $template->param(guarantees => 1);
+       }
+#      print "<table border=1>";
+#      if ($i > 0){
+#              print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";
+#      }
+#      if ($flags->{'CHARGES'} ne ''){
+#              print 
"<TR><TD>Charges</td><td>$flags->{'CHARGES'}->{'message'}</tr>";
+#      }
+#      if ($data ne ''){
+#              print "<TR><TD>Guarantees</td></tr>";
+#      }
+#      print "</table>";
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+output_html_with_http_headers $input, $cookie, $template->output;
+
+} else {
+       delmember($member);
+               
logaction($loggedinuser,"members","delete",$member,"$bor->{'firstname'} 
$bor->{'surname'}" ) if (&logstatus);
+       print $input->redirect("/cgi-bin/koha/members/members-home.pl");
+}
+
+sub delmember{
+       my ($member)address@hidden;
+       my $dbh = C4::Context->dbh;
+       my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
+       $sth->execute($member);
+       my @data=$sth->fetchrow_array;
+       $sth->finish;
+       $sth=$dbh->prepare("Insert into deletedborrowers values 
(".("?,"x(scalar(@data)-1))."?)");
+       $sth->execute(@data);
+       $sth->finish;
+       $sth=$dbh->prepare("Delete from borrowers where borrowernumber=?");
+       $sth->execute($member);
+       $sth->finish;
+       $sth=$dbh->prepare("Delete from reserves where borrowernumber=?");
+       $sth->execute($member);
+       $sth->finish;
+}

Index: guarantor_search.pl
===================================================================
RCS file: guarantor_search.pl
diff -N guarantor_search.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ guarantor_search.pl 10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,109 @@
+#!/usr/bin/perl
+
+# $Id: guarantor_search.pl,v 1.1.2.1 2007/03/10 01:19:29 tgarip1957 Exp $
+
+# script to find a guarantor
+
+# Copyright 2006 OUEST PROVENCE
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use HTML::Template;
+#op
+use C4::Date;
+use C4::Members;
+
+my $input = new CGI;
+my ($template, $loggedinuser, $cookie);
+
+       ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/guarantor_search.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+# }
+my $theme = $input->param('theme') || "default";
+                       # only used if allowthemeoverride is set
+
+
+my $member=$input->param('member');
+my $orderby=$input->param('orderby');
+$orderby = "surname,firstname" unless $orderby;
+$member =~ s/,//g;   #remove any commas from search string
+$member =~ s/\*/%/g;
+if ($member eq ''){
+               $template->param(results=>0);
+}else{
+               $template->param(results=>1);
+}      
+my $env;
+
+my ($count,$results);
+my @resultsdata;
+my $background = 0;
+
+if ($member ne ''){
+       if(length($member) == 1)
+       {
+               
($count,$results)=GuarantornameSearch($env,$member,$orderby,"simple");
+       }
+       else
+       {
+               
($count,$results)=GuarantornameSearch($env,$member,$orderby,"advanced");
+       }
+       for (my $i=0; $i < $count; $i++){
+       #find out stats
+       my ($od,$issue,$fines)=borrdata2($env,$results->[$i]{'borrowerid'});
+       
+       my %row = (
+               background => $background,
+               count => $i+1,
+               borrowernumber => $results->[$i]{'borrowernumber'},
+               cardnumber => $results->[$i]{'cardnumber'},
+               surname => $results->[$i]{'surname'},
+               firstname => $results->[$i]{'firstname'},
+               categorycode => $results->[$i]{'categorycode'},
+               address => $results->[$i]{'address'},
+               city => $results->[$i]{'city'},
+               branchcode => $results->[$i]{'branchcode'},
+               
+               #op
+               dateofbirth =>format_date($results->[$i]{'dateofbirth'}),
+               #fi op  
+               
+               odissue => "$od/$issue",
+               fines => $fines,
+               borrowernotes => $results->[$i]{'borrowernotes'});
+       if ( $background ) { $background = 0; } else {$background = 1; }
+       push(@resultsdata, \%row);
+               }
+}
+$template->param( 
+                       member          => $member,
+                       numresults              => $count,
+                       
+                       resultsloop     => address@hidden );
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: imemberentry.pl
===================================================================
RCS file: imemberentry.pl
diff -N imemberentry.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ imemberentry.pl     10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+# NOTE: standard 8-space tabs here
+
+#script to set up screen for modification of borrower details
+#written 20/12/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use CGI;
+use C4::Search;
+use C4::Interface::CGI::Output;
+use C4::Koha;
+use C4::Members;
+use C4::Date;
+
+my $input = new CGI;
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/imemberentry.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+
+my $member=$input->param('bornum');
+if ($member eq ''){
+  $member=NewBorrowerNumber();
+}
+my $type=$input->param('type');
+
+my $data=borrdata('',$member);
+
+my $cardnumber=C4::Members::fixup_cardnumber($data->{'cardnumber'});
+
+my @branches;
+my @select_branch;
+my %select_branches;
+my $branches=GetBranches();
+foreach my $branch (keys %$branches) {
+       push @select_branch, $branch;
+       $select_branches{$branch} = $branches->{$branch}->{'branchname'};
+}
+my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+                       -id => 'branchcode',
+                       -values   => address@hidden,
+                       -default  => $data->{'branchcode'},
+                       -labels   => \%select_branches,
+                       -size     => 1,
+                       -multiple => 0 );
+
+$template->param(member => $member,
+                               member          => $member,
+                               address         => $data->{'streetaddress'},
+                               firstname       => $data->{'firstname'},
+                               surname         => $data->{'surname'},
+                               othernames      => $data->{'othernames'},
+                               streetaddress   => $data->{'streetaddress'},
+                               streetcity      => $data->{'streetcity'},
+                               zipcode => $data->{'zipcode'},
+                               homezipcode => $data->{'homezipcode'},
+                               city            => $data->{'city'},
+                               phone           => $data->{'phone'},
+                               phoneday        => $data->{'phoneday'},
+                               faxnumber       => $data->{'faxnumber'},
+                               emailaddress    => $data->{'emailaddress'},
+                               textmessaging   => $data->{'textmessaging'},
+                               contactname     => $data->{'contactname'},
+                               altphone        => $data->{'altphone'},
+                               altnotes        => $data->{'altnotes'},
+                               borrowernotes   => $data->{'borrowernotes'},
+                               "title_".$data->{'title'} => " SELECTED ",
+                               dateenrolled    => $data->{'dateenrolled'},
+                               expiry          => $data->{'expiry'},
+                               joining => format_date($data->{'dateenrolled'}),
+                               cardnumber      => $cardnumber,
+                               dateofbirth     => $data->{'dateofbirth'},
+                               dateformat      => display_date_format(),
+                               cardnumber_institution => $cardnumber,
+                               CGIbranch => $CGIbranch);
+
+output_html_with_http_headers $input, $cookie, $template->output;
+
+# Local Variables:
+# tab-width: 8
+# End:

Index: insertdata.pl
===================================================================
RCS file: insertdata.pl
diff -N insertdata.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ insertdata.pl       10 Mar 2007 01:19:29 -0000      1.1.2.1
@@ -0,0 +1,111 @@
+#!/usr/bin/perl
+
+#script to enter borrower data into the data base
+#needs to be moved into a perl module
+# written 9/11/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use CGI;
+use C4::Context;
+use C4::Input;
+use C4::Search;
+use Date::Manip;
+use C4::Date;
+use strict;
+use C4::Members;
+my $input= new CGI;
+
+#get all the data into a hash
+my @names=$input->param;
+my %data;
+my $keyfld;
+my $keyval;
+my $problems;
+my $env;
+foreach my $key (@names){
+  $data{$key}=$input->param($key);
+  $data{$key}=~ s/\'/\\\'/g;
+  $data{$key}=~ s/\"/\\\"/g;
+}
+my $dbh = C4::Context->dbh;
+my $query="Select * from borrowers where borrowernumber=?";
+my $sth=$dbh->prepare($query);
+$sth->execute($data{'borrowernumber'});
+if (my $data2=$sth->fetchrow_hashref){
+  $data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
+  $data{'joining'}=format_date_in_iso($data{'joining'});
+  $data{'expiry'}=format_date_in_iso($data{'expiry'});
+  $query="update borrowers set title='$data{'title'}',expiry='$data{'expiry'}',
+  
cardnumber='$data{'cardnumber'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}',
+  
streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}',
+  
altnotes='$data{'altnotes'}',dateofbirth='$data{'dateofbirth'}',contactname='$data{'contactname'}',
+  
emailaddress='$data{'emailaddress'}',dateenrolled='$data{'joining'}',streetcity='$data{'streetcity'}',
+  
altrelationship='$data{'altrelationship'}',othernames='$data{'othernames'}',phoneday='$data{'phoneday'}',
+  
categorycode='$data{'categorycode'}',city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}',
+  
borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'surname'}',
+  
initials='$data{'initials'}',physstreet='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}',
+  
gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}',
+  textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}',
+  zipcode = '$data{'zipcode'}',homezipcode='$data{'homezipcode'}'
+  where borrowernumber=$data{'borrowernumber'}";
+
+}else{
+  $data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
+  $data{'joining'}=format_date_in_iso($data{'joining'});
+  $data{'expiry'}=format_date_in_iso($data{'expiry'});
+    $data{'borrowernumber'}=NewBorrowerNumber();
+  $query="insert into borrowers 
(title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
+  
firstname,altnotes,dateofbirth,contactname,emailaddress,textmessaging,dateenrolled,streetcity,
+  
altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
+  initials,ethnicity,physstreet,branchcode,zipcode,homezipcode) values 
('$data{'title'}','$data{'expiry'}','$data{'cardnumber'}',
+  '$data{'sex'}','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
+  
'$data{'firstname'}','$data{'altnotes'}','$data{'dateofbirth'}','$data{'contactname'}','$data{'emailaddress'}','$data{'textmessaging'}',
+  
'$data{'joining'}','$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
+  
'$data{'phoneday'}','$data{'categorycode'}','$data{'city'}','$data{'area'}','$data{'phone'}',
+  
'$data{'borrowernotes'}','$data{'altphone'}','$data{'surname'}','$data{'initials'}',
+  
'$data{'ethnicity'}','$data{'streetaddress'}','$data{'branchcode'}','$data{'zipcode'}','$data{'homezipcode'}')";
+}
+# ok if its an adult (type) it may have borrowers that depend on it as a 
guarantor
+# so when we update information for an adult we should check for guarantees 
and update the relevant part
+# of their records, ie addresses and phone numbers
+
+if ($data{'categorycode'} eq 'A' || $data{'categorycode'} eq 'W'){
+    # is adult check guarantees;
+    my ($count,$guarantees)=findguarantees($data{'borrowernumber'});
+    for (my $i=0;$i<$count;$i++){
+       # FIXME
+       # It looks like the $i is only being returned to handle walking through
+       # the array, which is probably better done as a foreach loop.
+       #
+       my $guaquery="update borrowers set 
streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',
+        
streetcity='$data{'streetcity'}',phoneday='$data{'phoneday'}',city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}'
+        ,streetaddress='$data{'address'}'
+        where borrowernumber='$guarantees->[$i]->{'borrowernumber'}'";
+        my $sth3=$dbh->prepare($guaquery);
+        $sth3->execute;
+        $sth3->finish;
+     }
+}
+
+  my $sth2=$dbh->prepare($query);
+  $sth2->execute;
+  $sth2->finish;
+$sth->finish;
+print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$data{'borrowernumber'}");

Index: insertidata.pl
===================================================================
RCS file: insertidata.pl
diff -N insertidata.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ insertidata.pl      10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+
+#script to enter borrower data into the data base
+#needs to be moved into a perl module
+# written 9/11/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use CGI;
+use C4::Context;
+use C4::Input;
+use Date::Manip;
+use strict;
+use C4::Members;
+my $input= new CGI;
+
+my @names=$input->param;
+my %data;
+my $keyfld;
+my $keyval;
+my $problems;
+my $env;
+my $sth2;
+foreach my $key (@names){
+  $data{$key}=$input->param($key);
+}
+my $dbh = C4::Context->dbh;
+my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
+$sth->execute($data{'borrowernumber'});
+if (my $data2=$sth->fetchrow_hashref){
+       $sth2=$dbh->prepare("update borrowers set title=?,expiry=?,
+       cardnumber=?,sex=?,ethnotes=?,
+       streetaddress=?,faxnumber=?,firstname=?,
+       altnotes=?,dateofbirth=?,contactname=?,
+       emailaddress=?,dateenrolled=?,streetcity=?,
+       altrelationship=?,othernames=?,phoneday=?,
+       city=?,area=?,phone=?,
+       borrowernotes=?,altphone=?,surname=?,
+       initials=?,physstreet=?,ethnicity=?,
+       gonenoaddress=?,lost=?,debarred=?,
+       textmessaging=?, branchcode = ?,
+       zipcode = ?,homezipcode=?
+       where borrowernumber=?");
+       $sth2->execute($data{'title'},$data{'expiry'},
+       $data{'cardnumber_institution'},$data{'sex'},$data{'ethnicnotes'},
+       $data{'address'},$data{'faxnumber'},$data{'firstname'},
+       $data{'altnotes'},$data{'dateofbirth'},$data{'contactname'},
+       $data{'emailaddress'},$data{'joining'},$data{'streetcity'},
+       $data{'altrelationship'},$data{'othernames'},$data{'phoneday'},
+       $data{'city'},$data{'area'},$data{'phone'},
+       $data{'borrowernotes'},$data{'altphone'},$data{'institution_name'},
+       $data{'initials'},$data{'streetaddress'},$data{'ethnicity'},
+       $data{'gna'},$data{'lost'},$data{'debarred'},
+       $data{'textmessaging'},$data{'branchcode'},
+       $data{'zipcode'},$data{'homezipcode'},
+       $data{'borrowernumber'});
+} else {
+       my $surname=$data{'institution_name'};
+       # note for code reading : 5 on each line
+       $sth2=$dbh->prepare("insert into borrowers (
+                       title,                  expiry,         cardnumber,     
sex,            ethnotes,
+                       streetaddress,  faxnumber,      firstname,              
altnotes,       dateofbirth,
+                       contactname,    emailaddress,   dateenrolled,   
streetcity,     altrelationship,
+                       othernames,     phoneday,               categorycode,   
city,           area,
+                       phone,          borrowernotes,  altphone,               
surname,        initials,
+                       ethnicity,              borrowernumber,guarantor,       
        school, branchcode,
+                       zipcode,                homezipcode)
+       values (        ?,?,?,?,?,
+                       ?,?,?,?,?,
+                       ?,?,now(),?,?,
+                       ?,?,?,?,?,
+                       ?,?,?,?,?,
+                       ?,?,?,?,?,
+                       ?,?
+                       )");
+       $sth2->execute('',                              $data{'expiry'},        
                $data{'cardnumber_institution'},        '',                     
        $data{'ethnotes'},
+                               $data{'address'},       $data{'faxnumber'},     
        $surname,                                       $data{'altnotes'},      
'',
+                               $data{'contactname'},$data{'emailaddress'},     
$data{'streetcity'},                    $data{'altrelationship'}, # only 4 
because of now()
+                               $data{'othernames'},    $data{'phoneday'},      
        'I',                                            $data{'city'},          
$data{'area'},
+                               ''.$data{'phone'},              
$data{'borrowernotes'}, $data{'altphone'},                      $surname,       
                ''.$data{'initials'},
+                               $data{'ethnicity'},     
$data{'borrowernumber'},        '',                                             
'',                             $data{'branchcode'},
+                               $data{'zipcode'},       $data{'homezipcode'});
+}
+
+$sth2->finish;
+$sth->finish;
+
+print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$data{'borrowernumber'}");

Index: insertjdata.pl
===================================================================
RCS file: insertjdata.pl
diff -N insertjdata.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ insertjdata.pl      10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+#script to enter borrower data into the data base
+#needs to be moved into a perl module
+# written 9/11/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use CGI;
+use C4::Context;
+use C4::Input;
+use Date::Manip;
+use strict;
+use C4::Members;
+
+my $input= new CGI;
+get all the data into a hash
+my @names=$input->param;
+my %data;
+my $keyfld;
+my $keyval;
+my $problems;
+my $env;
+foreach my $key (@names){
+       $data{$key}=$input->param($key);
+}
+my $dbh = C4::Context->dbh;
+my $query;
+for (my $i=0;$i<1;$i++){
+       my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
+       $sth->execute($data{'bornumber_child_$i'});
+       if (my $data=$sth->fetchrow_hashref){
+               $query="update borrowers set 
title='$data{'title'}',expiry='$data{'expiry'}',
+               
cardnumber='$data{'cardnumber'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}',
+               
streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}',
+               
altnotes='$data{'altnotes'}',dateofbirth='$data{'dateofbirth'}',contactname='$data{'contactname'}',
+               
emailaddress='$data{'emailaddress'}',dateenrolled='$data{'joining'}',streetcity='$data{'streetcity'}',
+               
altrelationship='$data{'altrelationship'}',othernames='$data{'othernames'}',phoneday='$data{'phoneday'}',
+               
categorycode='$data{'categorycode'}',city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}',
+               
borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'surname'}',
+               
initials='$data{'initials'}',streetaddress='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}',physstreet='$data{'physstreet'}',sort1='$data{sort1}',sort2='$data{'sort2'}'
+               where borrowernumber=$data{'borrowernumber'}";
+               #  print $query;
+       }elsif ($data{"cardnumber_child_$i"} ne ''){
+               my $dob=$data{"dateofbirth_child_$i"};
+               $dob=ParseDate($dob);
+               $dob=UnixDate($dob,'%Y-%m-%d');
+               $data{'joining'}=ParseDate("today");
+               $data{'joining'}=UnixDate($data{'joining'},'%Y-%m-%d');
+               my $cardnumber=$data{"cardnumber_child_$i"};
+               my $bornum=$data{"bornumber_child_$i"};
+               my $firstname=$data{"firstname_child_$i"};
+               my $surname=$data{"surname_child_$i"};
+               my $school=$data{"school_child_$i"};
+               my $guarant=$data{'borrowernumber'};
+               my $notes=$data{"altnotes_child_$i"};
+               my $sex=$data{"sex_child_$i"};
+               $data{'contactname'}=$data{'firstname_guardian'}." 
".$data{'surname_guardian'};
+               $data{'altrelationship'}="Guarantor";
+               $data{'altphone'}=$data{'phone'};
+               $query="insert into borrowers 
(title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
+               
firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity,
+               
altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
+               
initials,ethnicity,borrowernumber,guarantor,school,physstreet,sort1,sort2)
+               values ('','$data{'expiry'}',
+               '$cardnumber',
+               
'$sex','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
+               
'$firstname','$data{'altnotes'}','$dob','$data{'contactname'}','$data{'emailaddress'}',
+               
'$data{'joining'}','$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
+               
'$data{'phoneday'}','C','$data{'city'}','$data{'area'}','$data{'phone'}',
+               '$notes','$data{'altphone'}','$surname','$data{'initials'}',
+               
'$data{'ethnicity'}','$bornum','$guarant','$school','$data{'physstreet'}','$data{'sort1'}','$data{'sort2'}')";
+
+       }
+       #print $query;
+       my $sth2=$dbh->prepare($query);
+       $sth2->execute;
+       $sth2->finish;
+       $sth->finish;
+}
+print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$data{'borrowernumber'}");

Index: jmemberentry.pl
===================================================================
RCS file: jmemberentry.pl
diff -N jmemberentry.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ jmemberentry.pl     10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+
+#script to set up screen for modification of borrower details
+#written 20/12/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+
+use CGI;
+use C4::Search;
+use C4::Interface::CGI::Output;
+use C4::Date;
+use C4::Members;
+
+my $input = new CGI;
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/jmemberentry.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $member=$input->param('bornum');
+if ($member eq ''){
+  $member=NewBorrowerNumber();
+}
+my $type=$input->param('type');
+
+my $data=borrdata('',$member);
+
+my @titles = ('Miss', 'Mrs', 'Ms', 'Mr', 'Dr', 'Sir');
+       # FIXME - Assumes English. This ought to be made part of i18n.
+my @titledata;
+while (@titles) {
+  my $title = shift @titles;
+  my %row = ('title' => $title);
+  if ($data->{'title'} eq $title) {
+    $row{'selected'}=' selected';
+  } else {
+    $row{'selected'}='';
+  }
+  push(@titledata, \%row);
+}
+
+# get the data for children
+my $cmember1=NewBorrowerNumber();
+my @cmemdata;
+for (my $i=0;$i<1;$i++){
+  my %row;
+  $row{'cmember'}=$cmember1+$i;
+  $row{'i'}=$i;
+  $row{'count'}=$i+1;
+  push(@cmemdata, \%row);
+}
+
+my $jcardnumber=C4::Members::fixup_cardnumber("");
+
+$template->param( member => $member,
+                       firstname       => $data->{'firstname'},
+                       surname         => $data->{'surname'},
+                       cardnumber      => $data->{'cardnumber'},
+                       jcardnumber     => $jcardnumber,
+                       area            => $data->{'area'},
+                       city            => $data->{'city'},
+                       physstreet         => $data->{'physstreet'},
+                       streetaddress   => $data->{'streetaddress'},
+                       streetcity      => $data->{'streetcity'},
+                       phone           => $data->{'phone'},
+                       phoneday        => $data->{'phoneday'},
+                       faxnumber       => $data->{'faxnumber'},
+                       emailaddress    => $data->{'emailaddress'},
+                       contactname     => $data->{'contactname'},
+                       altphone        => $data->{'altphone'},
+                       dateformat      => display_date_format(),
+                       titleloop       => address@hidden,
+                       cmemloop        => address@hidden );
+
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: mancredit.pl
===================================================================
RCS file: mancredit.pl
diff -N mancredit.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mancredit.pl        10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,85 @@
+#!/usr/bin/perl
+
+#wrriten 18/09/2005 by TG
+#script to display borrowers account details
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+
+use C4::Search;
+use C4::Accounts2;
+use C4::Members;
+my $input=new CGI;
+  my $accounttype=$input->param('accounttype');
+ my $accountid=$input->param('accountid');
+my $amount=$input->param('amount');
+my $itemnum=$input->param('itemnum');
+my $error=0;
+my $bornum=$input->param('bornum');
+#get borrower details
+my $data=borrdata('',$bornum);
+my $user=$data->{firstname}.",".$data->{surname}."-".$data->{cardnumber};
+my $add=$input->param('add');
+# $error=$input->param('error');
+my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "members/mancredit.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {borrowers => 1},
+                                       debug => 1,
+                                       });
+       $template->param(user => $user);
+       $template->param( bornum => $bornum);
+       $template->param( itemnum => $itemnum);
+       $template->param( amount => $amount);
+       $template->param( accounttype => $accounttype);
+       $template->param( accountid => $accountid);
+if ($add){
+if ($accounttype eq "F" || $accounttype eq "FU"){
+$accounttype="CF";
+}else{
+$accounttype="C".$accounttype;
+}
+       
+  my $desc=$input->param('desc');
+  my $amount=$input->param('amount');
+  $amount = -$amount;
+my $loggeduser=$input->param('loggedinuser');
+my   
$error=manualcredit($bornum,$accountid,$desc,$accounttype,$amount,$loggeduser);
+       if ($error>0 ) {
+       $template->param( error => "1");
+       $template->param(user => $user);
+       $template->param( bornum => $bornum);
+       $template->param( itemnum => $itemnum);
+       $template->param( amount => $amount);
+       $template->param( accounttype => $accounttype);
+       $template->param( accountid => $accountid);
+       } else {
+       print 
$input->redirect("/cgi-bin/koha/members/boraccount.pl?bornum=$bornum");
+       }
+} 
+       
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: maninvoice.pl
===================================================================
RCS file: maninvoice.pl
diff -N maninvoice.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ maninvoice.pl       10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+#wrriten 11/1/2000 by address@hidden
+#script to display borrowers account details
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Accounts2;
+use C4::Members;
+
+
+my $input=new CGI;
+
+my $bornum=$input->param('bornum');
+#get borrower details
+my $data=borrdata('',$bornum);
+my $user=$data->{firstname}.",".$data->{surname}."-".$data->{cardnumber};
+my $add=$input->param('add');
+if ($add){
+#  print $input->header;
+  my $desc=$input->param('desc');
+  my $amount=$input->param('amount');
+  my $type=$input->param('type');
+  manualinvoice($bornum,$desc,$type,$amount);
+  print $input->redirect("/cgi-bin/koha/members/boraccount.pl?bornum=$bornum");
+} else {
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "members/maninvoice.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {borrowers => 1},
+                                       debug => 1,
+                                       });
+       $template->param(bornum => $bornum);
+       $template->param(user => $user);
+       output_html_with_http_headers $input, $cookie, $template->output;
+}

Index: manualcredit.pl
===================================================================
RCS file: manualcredit.pl
diff -N manualcredit.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ manualcredit.pl     10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+#wrriten 18/09/2005 by TG
+#script to display borrowers account details
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Accounts2;
+
+my $input=new CGI;
+my $dbh=C4::Context->dbh;
+my $me= C4::Context->userenv;
+my $user=$me->{'cardnumber'} if ($me);
+$user="system" unless $user;
+my $sth=$dbh->prepare("SELECT * FROM accountlines a
+left join borrowers b on a.borrowernumber=b.borrowernumber
+where amountoutstanding>0 and categorycode='F' ");
+$sth->execute();
+my ($bornum,$itemnum,$desc,$accounttype,$amount);
+while (my $data=$sth->fetchrow_hashref){
+       if ($data->{'accounttype'}  eq "FU"){
+       $accounttype="CF";
+       }else{
+       $accounttype="C".$data->{'accounttype'};
+       }
+  my $accountno=getnextacctno('',$data->{borrowernumber},$dbh);        
+  my $desc="Automatic -credit for Faculty";
+  my $amount=$data->{amountoutstanding};
+  $amount = -$amount;
+my $sth3=$dbh->prepare("update accountlines set amountoutstanding=0 where 
accountid=?");
+$sth3->execute($data->{accountid});
+ my $sth2=$dbh->prepare("INSERT INTO   accountlines
+                       (borrowernumber, accountno, date, amount, description, 
accounttype, amountoutstanding,offset)
+                       VALUES (?, ?, now(), ?, ?, ?, ?,?)");
+       $sth2->execute($data->{borrowernumber}, $accountno, $amount, $desc, 
$accounttype, 0,$data->{amountoutstanding});
+
+
+} 
+       
+print $input->redirect("/cgi-bin/koha/mainpage.pl");
+

Index: member-flags.pl
===================================================================
RCS file: member-flags.pl
diff -N member-flags.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ member-flags.pl     10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,91 @@
+#!/usr/bin/perl
+
+# script to edit a member's flags
+# Written by Steve Tonnesen
+# July 26, 2002 (my birthday!)
+
+use strict;
+
+use C4::Search;
+use CGI;
+use C4::Output;
+use C4::Auth;
+use C4::Context;
+use C4::Circulation::Circ2;
+use C4::Members;
+use C4::Interface::CGI::Output;
+
+my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{borrowers}=1;
+$flagsrequired->{permissions}=1;
+
+my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "members/member-flags.tmpl",
+                               query => $input,
+                               type => "intranet",
+                               authnotrequired => 0,
+                               flagsrequired => {superlibrarian => 1},
+                               debug => 1,
+                               });
+
+
+
+
+my $member=$input->param('member');
+my %env;
+$env{'nottodayissues'}=1;
+my %member2;
+$member2{'borrowernumber'}=$member;
+my $issues=currentissues(\%env,\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+    $i++;
+}
+
+if ($input->param('newflags')) {
+    my $dbh=C4::Context->dbh();
+    my $flags=0;
+    foreach ($input->param) {
+       if (/flag-(\d+)/) {
+           my $flag=$1;
+           $flags=$flags+2**$flag;
+       }
+    }
+    my $sth=$dbh->prepare("update borrowers set flags=? where 
borrowernumber=?");
+    $sth->execute($flags, $member);
+    print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$member");
+} else {
+#     my ($bor,$flags,$accessflags)=getpatroninformation(\%env, $member,'');
+    my $bor = getpatroninformation(\%env, $member,'');
+    my $flags = $bor->{'flags'};
+    my $accessflags = $bor->{'authflags'};
+    my $dbh=C4::Context->dbh();
+    my $sth=$dbh->prepare("select bit,flag,flagdesc from userflags order by 
bit");
+    $sth->execute;
+    my @loop;
+    while (my ($bit, $flag, $flagdesc) = $sth->fetchrow) {
+       my $checked='';
+       if ($accessflags->{$flag}) {
+           $checked='checked';
+       }
+       my %row = ( bit => $bit,
+                flag => $flag,
+                checked => $checked,
+                flagdesc => $flagdesc );
+       push @loop, \%row;
+    }
+
+    $template->param(member => $member,
+                       surname => $bor->{'surname'},
+                       firstname => $bor->{'firstname'},
+                       loop => address@hidden,
+                       intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+                       );
+
+    output_html_with_http_headers $input, $cookie, $template->output;
+
+}

Index: member-password.pl
===================================================================
RCS file: member-password.pl
diff -N member-password.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ member-password.pl  10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+#script to set the password, and optionally a userid, for a borrower
+#written 2/5/00
+#by address@hidden
+#converted to using templates 3/16/03 by address@hidden
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Search;
+use C4::Context;
+use C4::Members;
+use C4::Circulation::Circ2;
+use CGI;
+use Digest::MD5 qw(md5_base64);
+
+my $input = new CGI;
+
+my $theme = $input->param('theme') || "default";
+                       # only used if allowthemeoverride is set
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/member-password.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $flagsrequired;
+$flagsrequired->{borrowers}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+my $member=$input->param('member');
+my %env;
+$env{'nottodayissues'}=1;
+my %member2;
+$member2{'borrowernumber'}=$member;
+my $issues=currentissues(\%env,\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+    $i++;
+}
+
+my ($bor,$flags)=getpatroninformation(\%env, $member,'');
+my $newpassword = $input->param('newpassword');
+
+if ( $newpassword ) {
+       my $digest=md5_base64($input->param('newpassword'));
+       my $uid = $input->param('newuserid');
+       my $dbh=C4::Context->dbh;
+       if (change_user_pass($uid,$member,$digest)) {
+               $template->param(newpassword => $newpassword);
+               print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$member");
+       } else {
+        $template->param(othernames => $bor->{'othernames'},
+                                               surname     => 
$bor->{'surname'},
+                                               firstname   => 
$bor->{'firstname'},
+                                               userid      => $bor->{'userid'},
+                                               defaultnewpassword => 
$newpassword );
+       }
+} else {
+    my $userid = $bor->{'userid'};
+
+    my $chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+    my $length=int(rand(2))+4;
+    my $defaultnewpassword='';
+    for (my $i=0; $i<$length; $i++) {
+       $defaultnewpassword.=substr($chars, int(rand(length($chars))),1);
+    }
+       $template->param(       othernames => $bor->{'othernames'},
+                       surname     => $bor->{'surname'},
+                       firstname   => $bor->{'firstname'},
+                       userid      => $bor->{'userid'},
+                       defaultnewpassword => $defaultnewpassword );
+
+
+}
+
+$template->param( member => $member,
+               intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: member-picupload.pl
===================================================================
RCS file: member-picupload.pl
diff -N member-picupload.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ member-picupload.pl 10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+ 
+ # $Id: member-picupload.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+ 
+ # script to upload a picture to a borrowerimages directory.
+ # checks to see if its either displaying the upload form
+ # or doing the actual upload.
+ # written by Waylon Robertson (address@hidden) 2005/08/22
+ 
+ 
+ # Copyright 2000-2002 Katipo Communications
+ #
+ # This file is part of Koha.
+ #
+ # Koha is free software; you can redistribute it and/or modify it under the
+ # terms of the GNU General Public License as published by the Free Software
+ # Foundation; either version 2 of the License, or (at your option) any later
+ # version.
+ #
+ # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along with
+ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ # Suite 330, Boston, MA  02111-1307 USA
+ 
+ use strict;
+ use C4::Auth;
+ use C4::Context;
+ use C4::Output;
+ use CGI;
+ use C4::Interface::CGI::Output;
+ use C4::Members;
+
+ my $input = new CGI;
+ my $name = $input->param('name');
+ my $cardnum = $input->param('cardnum');
+ my $bornum = $input->param('bornum');
+ my $photo = $input->param('photo');
+ 
+ my $template_name;
+
+ my $htdocs = C4::Context->config('opacdir');
+ my $upload_dir = $htdocs."/htdocs/uploaded-files/users-photo";
+ if($photo eq  ""){
+       $template_name = "members/member-picupload.tmpl";
+ } else {
+       $template_name = "members/moremember.tmpl";
+ }
+ 
+ my ($template, $loggedinuser, $cookie)
+     = get_template_and_user({template_name => $template_name,
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+ if ($photo){
+ 
+       my $filename=$cardnum.'.jpg';
+       my $upload_filehandle = $input->upload("photo");
+       open UPLOADFILE, ">$upload_dir/$filename";
+       binmode UPLOADFILE;
+       while ( <$upload_filehandle> )
+       {
+               print UPLOADFILE;
+       }
+       close UPLOADFILE;
+print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$bornum");
+ }
+ else {
+       $template->param(
+                bornum => $bornum,
+               cardnum => $cardnum,
+                name => $name
+                );
+        output_html_with_http_headers $input, $cookie, $template->output;
+ }
+
+
+

Index: member.pl
===================================================================
RCS file: member.pl
diff -N member.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ member.pl   10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,103 @@
+#!/usr/bin/perl
+
+# $Id: member.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+#script to do a borrower enquiery/brin up borrower details etc
+#written 20/12/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Members;
+
+my $input = new CGI;
+my $quicksearch = $input->param('quicksearch');
+my ($template, $loggedinuser, $cookie);
+if($quicksearch){
+       ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => 
"members/member-quicksearch-results.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+} else {
+       ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/member.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+}
+my $theme = $input->param('theme') || "default";
+
+
+my $member=$input->param('member');
+my $orderby=$input->param('orderby');
+$orderby = "surname,firstname" unless $orderby;
+$member =~ s/,//g;   #remove any commas from search string
+
+my $env;
+
+my ($count,$results);
+
+if(length($member) == 1)
+{
+       ($count,$results)=BornameSearch($env,$member,$orderby,"simple");
+}
+else
+{
+       ($count,$results)=BornameSearch($env,$member,$orderby,"advanced");
+}
+
+
+my @resultsdata;
+my $background = 0;
+for (my $i=0; $i < $count; $i++){
+  #find out stats
+  my ($od,$issue,$fines)=borrdata2($env,$results->[$i]{'borrowernumber'});
+
+  my %row = (
+       background => $background,
+        borrowernumber => $results->[$i]{'borrowernumber'},
+        cardnumber => $results->[$i]{'cardnumber'},
+        surname => $results->[$i]{'surname'},
+        firstname => $results->[$i]{'firstname'},
+        categorycode => $results->[$i]{'categorycode'},
+        streetaddress => $results->[$i]{'streetaddress'},
+        city => $results->[$i]{'city'},
+        odissue => "$od/$issue",
+        fines => $fines,
+        borrowernotes => $results->[$i]{'borrowernotes'});
+  if ( $background ) { $background = 0; } else {$background = 1; }
+  push(@resultsdata, \%row);
+}
+
+$template->param( 
+                       member          => $member,
+                       resultsloop     => address@hidden );
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: memberentry.pl
===================================================================
RCS file: memberentry.pl
diff -N memberentry.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ memberentry.pl      10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,299 @@
+#!/usr/bin/perl
+# NOTE: This file uses standard 8-space tabs
+#       DO NOT SET TAB SIZE TO 4
+
+# $Id: memberentry.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+#script to set up screen for modification of borrower details
+#written 20/12/99 by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Members;
+use C4::Koha;
+use C4::Date;
+use C4::Input;
+use C4::Log;
+
+my $input = new CGI;
+
+my $dbh = C4::Context->dbh;
+my $cardnumber;
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/memberentry.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $borrowernumber=$input->param('borrowernumber');
+my $actionType=$input->param('actionType') || '';
+my $modify=$input->param('modify');
+my $delete=$input->param('delete');
+my $op=$input->param('op');
+my $categorycode=$input->param('categorycode');
+my $destination=$input->param('destination');
+my $defaultbranch=C4::Context->preference('defaultBranch');
+ my $autonumber_members = C4::Context->boolean_preference('autoMemberNum');
+
+my $nok;
+# if a add or modify is requested => check validity of data.
+if ($op eq 'add' or $op eq 'modify') {
+       my %data;
+
+       my @names=$input->param;
+       foreach my $key (@names){
+               $data{$key}=$input->param($key);
+               $data{$key}=~ s/\'/\\\'/g;
+               $data{$key}=~ s/\"/\\\"/g;
+       }
+
+if ($op eq 'add'){      
$cardnumber=C4::Members::fixupneu_cardnumber($data{'cardnumber'},$data{'categorycode'});
+       $data{'cardnumber'}=$cardnumber;}
+       my @errors;
+       if ($data{'cardnumber'} eq '' && ! $autonumber_members){
+               push @errors,"ERROR_cardnumber";
+               $nok=1;
+       } else {
+               #check cardnumber is valid
+               my $nounique;
+               if ( $op eq "add" )    {
+                       $nounique = 0;
+               } else {
+                       $nounique = 1;
+               }
+               my $valid=checkdigit('',$data{'cardnumber'}, $nounique);
+               if ($valid != 1){
+                       $nok=1;
+                       push @errors, "ERROR_invalid_cardnumber";
+               }
+       }
+       if ($data{'sex'} eq '' && $categorycode ne "I"){
+               push @errors, "ERROR_gender";
+               $nok=1;
+       }
+       if ($data{'firstname'} eq '' && $categorycode ne "I"){
+               push @errors,"ERROR_firstname";
+               $nok=1;
+       }
+       if ($data{'surname'} eq ''){
+               push @errors,"ERROR_surname";
+               $nok=1;
+       }
+       if ($data{'streetaddress'} eq ''){
+               push @errors, "ERROR_address";
+               $nok=1;
+       }
+       if ($data{'city'} eq ''){
+               push @errors, "ERROR_city";
+               $nok=1;
+       }
+       if ($nok) {
+               foreach my $error (@errors) {
+                       $template->param( $error => 1);
+               }
+               $template->param(NOK => 1);
+       } else {
+               my $query="Select * from borrowers where borrowernumber=?";
+               my $sth=$dbh->prepare($query);
+               $sth->execute($data{'borrowernumber'});
+               if (my $data2=$sth->fetchrow_hashref){
+
+                       &modmember(%data);
+       
logaction($loggedinuser,"members","modify",$data{'borrowernumber'},"expiry:$data{'expiry'},userid:$data{'userid'},debarred:$data{'debarred'},gone:$data{'gna'}")
 if (&logstatus);
+               }else{
+
+                       $borrowernumber = &newmember(%data);
+               
logaction($loggedinuser,"members","add",$borrowernumber,"expiry:$data{'expiry'},userid:$data{'userid'}")
 if (&logstatus);
+       
+               }
+               
+       if($destination eq "circ"){
+               print 
$input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$data{'cardnumber'}");
+       } else {
+               print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrowernumber");
+               }
+       }
+}
+if ($delete){
+       print 
$input->redirect("/cgi-bin/koha/deletemem.pl?member=$borrowernumber");
+} else {  # this else goes down the whole script
+       if ($actionType eq 'Add'){
+               $template->param( addAction => 1);
+
+       } else {
+               $template->param( addAction =>0);
+
+       }
+       # retrieve previous values : either in DB or in CGI, in case of errors 
in values
+       my $data;
+       if ($nok) {
+               my @names=$input->param;
+               foreach my $key (@names){
+                       $data->{$key}=$input->param($key);
+               }
+       } else {
+               $data=borrdata('',$borrowernumber);
+       }
+       if ($actionType eq 'Add'){
+               $template->param( updtype => 'I');
+       } else {
+               $template->param( updtype => 'M');
+       }
+##Cardnumber was here
+if ($modify){ $cardnumber=($data->{'cardnumber'})};
+               
+       if ($data->{'sex'} eq 'F'){
+               $template->param(female => 1);
+       }
+       my ($categories,$labels)=ethnicitycategories();
+       my $ethnicitycategoriescount=$#{$categories};
+       my $ethcatpopup;
+       if ($ethnicitycategoriescount>=0) {
+               $ethcatpopup = CGI::popup_menu(-name=>'ethnicity',
+                                       -id => 'ethnicity',
+                                       -values=>$categories,
+                                       -default=>$data->{'ethnicity'},
+                                       -labels=>$labels);
+               $template->param(ethcatpopup => $ethcatpopup); # bad style, has 
to be fixed
+       }
+
+       ($categories,$labels)=borrowercategories();
+       my $catcodepopup = CGI::popup_menu(-name=>'categorycode',
+                                       -id => 'categorycode',
+                                       -values=>$categories,
+                                       -default=>$data->{'categorycode'},
+                                       -labels=>$labels);
+
+       my @relationships = ('','workplace', 'relative','friend', 'neighbour');
+       my @relshipdata;
+       while (@relationships) {
+               my $relship = shift @relationships;
+               my %row = ('relationship' => $relship);
+               if ($data->{'altrelationship'} eq $relship) {
+                       $row{'selected'}=' selected';
+               } else {
+                       $row{'selected'}='';
+               }
+               push(@relshipdata, \%row);
+       }
+
+       # %flags: keys=$data-keys, datas=[formname, HTML-explanation]
+       my %flags = ('gonenoaddress' => ['gna', 'Gone/Graduated'],
+                               'lost'          => ['lost', 'Lost'],
+                               'debarred'      => ['debarred', 'Debarred']);
+
+       my @flagdata;
+       foreach (keys(%flags)) {
+       my $key = $_;
+       my %row =  ('key'   => $key,
+                       'name'  => $flags{$key}[0],
+                       'html'  => $flags{$key}[1]);
+       if ($data->{$key}) {
+               $row{'yes'}=' checked';
+               $row{'no'}='';
+       } else {
+               $row{'yes'}='';
+               $row{'no'}=' checked';
+       }
+       push(@flagdata, \%row);
+       }
+
+       if ($modify){
+       $template->param( modify => 1 );
+       }
+
+       #Convert dateofbirth to correct format
+       $data->{'dateofbirth'} = format_date($data->{'dateofbirth'});
+       $data->{'expiry'} = format_date($data->{'expiry'});
+
+       my @branches;
+       my @select_branch;
+       my %select_branches;
+       my $branches=GetBranches();
+       foreach my $branch (keys %$branches) {
+               push @select_branch, $branch;
+               $select_branches{$branch} = 
$branches->{$branch}->{'branchname'};
+       }
+       my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+                               -id => 'branchcode',
+                               -values   => address@hidden,
+                               -default  => $defaultbranch,
+                               -labels   => \%select_branches,
+                               -size     => 1,
+                               -multiple => 0 );
+
+       $template->param(       actionType              => $actionType,
+                               destination => $destination,
+                               borrowernumber          => $borrowernumber,
+                               address         => $data->{'streetaddress'},
+                               firstname       => $data->{'firstname'},
+                               surname         => $data->{'surname'},
+                               othernames      => $data->{'othernames'},
+                               initials        => $data->{'initials'},
+                               ethcatpopup     => $ethcatpopup,
+                               catcodepopup    => $catcodepopup,
+                               streetaddress   => $data->{'streetaddress'},
+                               physstreet   => $data->{'physstreet'},
+                               zipcode => $data->{'zipcode'},
+                               streetcity      => $data->{'streetcity'},
+                               homezipcode => $data->{'homezipcode'},
+                               city            => $data->{'city'},
+                               phone           => $data->{'phone'},
+                               phoneday        => $data->{'phoneday'},
+                               faxnumber       => $data->{'faxnumber'},
+                               emailaddress    => $data->{'emailaddress'},
+                               preferredcont    => $data->{'preferredcont'},
+                               $data->{'preferredcont'} =>1,
+                               textmessaging   => $data->{'textmessaging'},
+                               contactname     => $data->{'contactname'},
+                               altphone        => $data->{'altphone'},
+                               altnotes        => $data->{'altnotes'},
+                               borrowernotes   => $data->{'borrowernotes'},
+                               flagloop        => address@hidden,
+                               relshiploop     => address@hidden,
+                               "title_".$data->{'title'} => " SELECTED ",
+                               joining => format_date($data->{'dateenrolled'}),
+                               expiry          => $data->{'expiry'},
+                               cardnumber      => $cardnumber,
+                               dateofbirth     => $data->{'dateofbirth'},
+                               sort1 => $data->{'sort1'},
+                               sort2 => $data->{'sort2'},
+                               dateformat      => display_date_format(),
+                               modify          => $modify,
+                               CGIbranch => $CGIbranch);
+       $template->param(Institution => 1) if ($categorycode eq "I");
+
+       output_html_with_http_headers $input, $cookie, $template->output;
+
+
+}
+
+# Local Variables:
+# tab-width: 8
+# End:

Index: members-home.pl
===================================================================
RCS file: members-home.pl
diff -N members-home.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ members-home.pl     10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use CGI;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Members;
+my $query = new CGI;
+my $quicksearch = $query->param('quicksearch');
+my ($template, $loggedinuser, $cookie);
+my $template_name;
+
+if($quicksearch){
+($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => 
"members/member-quicksearch.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+} else {
+($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/members-home.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+}
+
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+output_html_with_http_headers $query, $cookie, $template->output;

Index: moremember.pl
===================================================================
RCS file: moremember.pl
diff -N moremember.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ moremember.pl       10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,199 @@
+#!/usr/bin/perl
+
+# $Id: moremember.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+# script to do a borrower enquiry/bring up borrower details etc
+# Displays all the details about a borrower
+# written 20/12/99 by address@hidden
+# last modified 21/1/2000 by address@hidden
+# modified 31/1/2001 by address@hidden
+#   to not allow items on request to be renewed
+#
+# needs html removed and to use the C4::Output more, but its tricky
+#
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Context;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Date;
+use C4::Reserves2;
+use C4::Circulation::Circ2;
+use C4::Koha;
+use C4::Members;
+use C4::Accounts2;
+my $dbh = C4::Context->dbh;
+
+my $input = new CGI;
+my $print = $input->param('print');
+my $template_name;
+
+if($print eq "page"){
+       $template_name = "members/moremember-print.tmpl";
+} elsif($print eq "slip"){
+       $template_name = "members/moremember-receipt.tmpl";
+} else {
+       $template_name = "members/moremember.tmpl";
+}
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => $template_name,
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+my $bornum=$input->param('bornum');
+
+#start the page and read in includes
+
+my $data=borrdata('',$bornum);
+
+$template->param($data->{'categorycode'} => 1); # in template <TMPL_IF 
name="I"> => instutitional (A for Adult & C for children)
+my $picture;
+ my $htdocs = C4::Context->config('opacdir');
+
+$picture =$htdocs. 
"/htdocs/uploaded-files/users-photo/".$data->{'cardnumber'}.".jpg";
+ if (-e $picture)
+{ 
+
+   $template->param(borrowerphoto => 
"http://library.neu.edu.tr/uploaded-files/users-photo/".$data->{'cardnumber'}.".jpg");
+ }else{
+$picture = "http://cc.neu.edu.tr/stdpictures/".$data->{'cardnumber'}.".jpg";
+  $template->param(borrowerphoto => $picture);
+}
+$data->{'dateenrolled'} = format_date($data->{'dateenrolled'});
+$data->{'expiry'} = format_date($data->{'expiry'});
+$data->{'dateofbirth'} = format_date($data->{'dateofbirth'});
+$data->{'IS_ADULT'} = ($data->{'categorycode'} ne 'I');
+
+if($data->{'debarred'} || $data->{'gonenoaddress'} || $data->{'lost'} || 
$data->{'borrowernotes'}){
+       $template->param(flagged =>1);
+}
+
+$data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
+
+$data->{&expand_sex_into_predicate($data->{'sex'})} = 1;
+
+if ($data->{'categorycode'} eq 'C'){
+       my $data2=borrdata('',$data->{'guarantor'});
+       $data->{'streetaddress'}=$data2->{'streetaddress'};
+       $data->{'city'}=$data2->{'city'};
+       $data->{'physstreet'}=$data2->{'physstreet'};
+       $data->{'streetcity'}=$data2->{'streetcity'};
+       $data->{'phone'}=$data2->{'phone'};
+       $data->{'phoneday'}=$data2->{'phoneday'};
+       $data->{'zipcode'} = $data2->{'zipcode'};
+}
+
+
+if ($data->{'ethnicity'} || $data->{'ethnotes'}) {
+       $template->param(printethnicityline => 1);
+}
+
+if ($data->{'categorycode'} ne 'C'){
+       $template->param(isguarantee => 1);
+       # FIXME
+       # It looks like the $i is only being returned to handle walking through
+       # the array, which is probably better done as a foreach loop.
+       #
+       my ($count,$guarantees)=findguarantees($data->{'borrowernumber'});
+       my @guaranteedata;
+       for (my $i=0;$i<$count;$i++){
+               push (@guaranteedata, {borrowernumber => 
$guarantees->[$i]->{'borrowernumber'},
+                                       cardnumber => 
$guarantees->[$i]->{'cardnumber'},
+                                       name => 
$guarantees->[$i]->{'firstname'} . " " . $guarantees->[$i]->{'surname'}});
+       }
+       $template->param(guaranteeloop => address@hidden);
+
+} else {
+       my ($guarantor)=findguarantor($data->{'borrowernumber'});
+       unless ($guarantor->{'borrowernumber'} == 0){
+               $template->param(guarantorborrowernumber => 
$guarantor->{'borrowernumber'}, guarantorcardnumber => 
$guarantor->{'cardnumber'});
+       }
+}
+
+my %bor;
+$bor{'borrowernumber'}=$bornum;
+
+# Converts the branchcode to the branch name
+$data->{'branchcode'} = &getbranchname($data->{'branchcode'});
+
+# Converts the categorycode to the description
+$data->{'categorycode'} = &getborrowercategory($data->{'categorycode'});
+
+my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
+
+my ($count,$issue)=borrissues($bornum);
+my $today=get_today();
+my @issuedata;
+my $totalprice = 0;
+
+for (my $i=0;$i<$count;$i++){
+
+       my $datedue=$issue->[$i]{'date_due'};
+       $issue->[$i]{'date_due'} = format_date($issue->[$i]{'date_due'});
+       my %row = %{$issue->[$i]};
+       $totalprice += $issue->[$i]{'replacementprice'};
+       $row{'replacementprice'}=$issue->[$i]{'replacementprice'};
+       if ($datedue lt $today){
+               $row{'red'}=1; #print "<font color=red>";
+       }
+       #find the charge for an item
+       
+       my 
($charge,$itemtype)=C4::Accounts2::calc_charges($dbh,$issue->[$i]{'itemnumber'},$bornum);
+       
+       $row{'itemtype'}=ItemType($itemtype);
+       $row{'charge'}=$charge;
+
+       #check item is not reserved
+       my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'});
+       if ($restype){
+#              print "<TD><a 
href=/cgi-bin/koha/request.pl?bib=$issue->[$i]{'biblionumber'}>On Request - no 
renewals</a></td></tr>";
+               #  } elsif ($issue->[$i]->{'renewals'} > 0) {
+               #      print "<TD>Previously Renewed - no renewals</td></tr>";
+                       $row{'norenew'}=1;
+       } else {
+               $row{'norenew'}=0;
+       }
+       push (@issuedata, \%row);
+
+}
+my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
+
+foreach my $reserveline (@$reserves) {
+       $reserveline->{'reservedate'} = 
format_date($reserveline->{'reservedate'});
+       
+}
+
+$template->param($data);
+$template->param(today=>format_date($today),
+                bornum          => $bornum,
+                totalprice =>$totalprice,
+                totaldue =>$total,
+                issueloop       => address@hidden,
+                reserveloop     => $reserves);
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: newimember.pl
===================================================================
RCS file: newimember.pl
diff -N newimember.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ newimember.pl       10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,140 @@
+#!/usr/bin/perl
+# Note: This file now uses standard 8-space tabs
+
+# $Id: newimember.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+#script to print confirmation screen,
+#then if accepted calls itself to insert data
+#modified 2002/12/16 by address@hidden : Templating
+#the "parent" is imemberentry.pl
+
+
+# Copyright 2000-2003 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Output;
+use C4::Input;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Members;
+use CGI;
+use Date::Manip;
+use C4::Members;
+my %env;
+my $input = new CGI;
+#get varibale that tells us whether to show confirmation page
+#or insert data
+my $insert=$input->param('insert');
+
+my ($template, $loggedinuser, $cookie) = get_template_and_user({
+       template_name => "members/newimember.tmpl",
+       query => $input,
+       type => "intranet",
+       authnotrequired => 0,
+       flagsrequired => {borrowers => 1},
+       debug => 1,
+  });
+
+#get rest of data
+my %data;
+my @names=$input->param;
+foreach my $key (@names){
+  $data{$key}=$input->param($key);
+}
+
+my $missing=0;
+
+my $string="The following compulsary fields have been left blank. Please push 
the back button
+and try again<p>";
+if ($data{'cardnumber_institution'} !~ /\S/){
+  $string.="Cardnumber<br>";
+  $missing=1;
+}
+if ($data{'institution_name'} !~ /\S/){
+  $string.="Institution Name<br>";
+  $missing=1;
+}
+if ($data{'address'} !~ /\S/){
+  $string.="Postal Address<br>";
+  $missing=1;
+}
+if ($data{'city'} !~ /\S/){
+  $string.="City<br>";
+  $missing=1;
+}
+if ($data{'contactname'} !~ /\S/){
+  $string.="Contact Name";
+  $missing=1;
+}
+
+$template->param( missingloop => ($missing==1));
+$template->param( string => $string);
+if ($missing !=1) {
+    $data{'cardnumber_institution'} = C4::Members::fixup_cardnumber
+           ($data{'cardnumber_institution'});
+
+    #check cardnumber is valid
+    my $nounique;
+    if ( $data{'type'} ne "Add" )    {
+       $nounique = 0;
+    } else {
+       $nounique = 1;
+    }
+    my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique);
+
+    $template->param( invalid => ($valid !=1));
+
+    if ($valid) {
+       my @inputs;
+       while (my ($key, $value) = each %data) {
+           push(@inputs, { 'key'       => $key,
+                           'value'     => CGI::escapeHTML($value) });
+       }
+    $template->param(institution_name => $data{institution_name},
+                    bornum => $data{'borrowernumber'},
+                    cardnumber_institution => $data{'cardnumber_institution'},
+                    memcat => $data{'categorycode'},
+                    branchcode => $data{'branchcode'},
+                    sex => $data{sex},
+                    postal => $data{postal},
+                    home => $data{home},
+                       zipcode => $data{'zipcode'},
+                       homezipcode => $data{'homezipcode'},
+                    phone => $data{'phone'},
+                    phoneday => $data{'phoneday'},
+                    faxnumber => $data{'faxnumber'},
+                    emailaddress => $data{'emailaddress'},
+                       textmessaging => $data{'textmessaging'},
+                    contactname => $data{'contactname'},
+                    altphone => $data{'altphone'},
+                    altrelationship => $data{'altrelationship'},
+                    altnotes => $data{'altnotes'},
+                    bornotes => $data{'borrowernotes'},
+                    inputsloop => address@hidden);
+    }
+}
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+output_html_with_http_headers $input, $cookie, $template->output;
+
+
+# Local Variables:
+# tab-width: 8
+# End:

Index: newjmember.pl
===================================================================
RCS file: newjmember.pl
diff -N newjmember.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ newjmember.pl       10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+
+# $Id: newjmember.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+# script to print confirmation screen, then if accepted calls itself to insert 
data
+# FIXME - Yes, but what does it _do_?
+# 2002/12/18 address@hidden
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Context;
+use C4::Input;
+use C4::Interface::CGI::Output;
+
+use C4::Koha;
+use CGI;
+use Date::Manip;
+use C4::Members;
+my %env;
+my $input = new CGI;
+#get varibale that tells us whether to show confirmation page
+#or insert data
+my $insert=$input->param('insert');
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/newjmember.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
+
+#get rest of data
+my %data;
+my @names=$input->param;
+foreach my $key (@names){
+  $data{$key}=$input->param($key);
+}
+my $missing=0;
+
+for (my $i=0;$i<3;$i++){
+  my $number=$data{"cardnumber_child_$i"};
+  my $firstname=$data{"firstname_child_$i"};
+  my $surname=$data{"surname_child_$i"};
+  my $dob=$data{"dateofbirth_child_$i"};
+  my $sex=$data{"sex_child_$i"};
+  if ($number eq ''){
+    if ($i == 0){
+               $template->param(cardnumber_missing => 1);
+               $missing=1;
+                   if ($firstname eq ''){
+               $template->param(firstname_missing => 1);
+               $missing=1;
+    }
+    if ($surname eq ''){
+               $template->param(surname_missing => 1);
+               $missing=1;
+    }
+    if ($dob eq ''){
+               $template->param(dob_missing => 1);
+               $missing=1;
+    }
+    if ($sex eq ''){
+               $template->param(gender_missing => 1);
+               $missing=1;
+    }
+    }
+  } else {
+    if ($firstname eq ''){
+               $template->param(firstname_missing => 1);
+               $missing=1;
+    }
+    if ($surname eq ''){
+               $template->param(surname_missing => 1);
+               $missing=1;
+    }
+    if ($dob eq ''){
+               $template->param(dob_missing => 1);
+               $missing=1;
+    }
+    if ($sex eq ''){
+               $template->param(gender_missing => 1);
+               $missing=1;
+    }
+    #check cardnumber is valid
+    my $nounique;
+    if ( $data{'type'} ne "Add" )    {
+               $nounique = 0;
+    } else {
+               $nounique = 1;
+    }
+    my $valid=checkdigit(\%env,$number, $nounique);
+    if ($valid != 1){
+               $template->param(missing =>1);
+               $template->param(invalid_cardnumber => 1);
+               $missing=1;
+    }
+  }
+}
+       my @identsloop;
+       for (my $i=0;$i<3;$i++){
+               my %ident;
+#              $ident{'main'}=$main;
+#              $ident{'image'}=$image;
+               $ident{'cardchild'}=$data{"cardnumber_child_$i"};
+               if ($data{"cardnumber_child_$i"} ne ''){
+                       my $name=$data{"firstname_child_$i"} . " " . 
$data{"surname_child_$i"};
+                       $ident{'name'}=$name;
+                       $ident{'bornum'}=$data{"bornumber_child_$i"};
+                       $ident{'dob'}=$data{"dateofbirth_child_$i"};
+                       ($data{"sex_child_$i"} eq 'M') ? ($ident{'sex'}="Male") 
: ($ident{'sex'}="Female") ;
+                       $ident{'school'}=$data{"school_child_$i"};
+                       $ident{'notes'}=$data{"altnotes_child_$i"};
+                       push(@identsloop, \%ident);
+               }
+       }
+       my @inputsloop;
+       while (my ($key, $value) = each %data) {
+               $value=~ s/\"/%22/g;
+               my %line;
+               $line{'key'}=$key;
+               $line{'value'}=$value;
+               push(@inputsloop, \%line);
+       }
+
+# FIXME IF main and image are not fetched by HTML::TEMPLATE get them into 
identsloop
+$template->param(NOK => ($missing==1),
+               identsloop => address@hidden,
+               inputsloop => address@hidden,
+               intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: newmember.pl
===================================================================
RCS file: newmember.pl
diff -N newmember.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ newmember.pl        10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,213 @@
+#!/usr/bin/perl
+
+# $Id: newmember.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+#script to print confirmation screen, then if accepted calls itself to insert 
data
+# FIXME - Yes, but what does it _do_?
+# 2002/12/18 address@hidden templating
+
+# 2003/01/20 address@hidden XXX it seems to do the following:
+# * "insert" seems to do nothing; in 1.2.2 the script just returns a blank
+#   page (with the headers etc.) if "insert" has anything in it
+# * $ok has the opposite meaning of what one expects; $ok == 1 means "not ok"
+# * if ($ok == 0) considers the "ok" case; it displays a confirmation page
+#   for the user to "click to confirm that everything is entered correctly"
+# * The "else" case for ($ok == 0) handles the "not ok" case; $string is the
+#   error message to display
+
+# FIXME - What is the correct value of "flagsrequired"?
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Input;
+use C4::Interface::CGI::Output;
+use CGI;
+use Date::Manip;
+use C4::Date;
+use C4::Members;
+my %env;
+my $input = new CGI;
+
+#get rest of data
+my %data;
+my @names=$input->param;
+foreach my $key (@names){
+  $data{$key}=$input->param($key);
+}
+
+my ($template, $borrowernumber, $cookie)
+    = get_template_and_user({template_name => "members/newmember.tmpl",
+                            query => $input,
+                             type => "intranet",
+                             authnotrequired => 0,
+                             flagsrequired => {parameters => 1},
+                         });
+
+#Get the database handle
+my $dbh = C4::Context->dbh;
+
+# Check that all compulsary fields are entered
+# If everything is ok, set $ok = 0
+# Otherwise set $ok = 1 and $string to the error message to display.
+
+my $ok=0;
+my $string = "The following compulsary fields have been left blank. "
+       . "Please push the back button and try again<p>";
+my @errors;
+if ($data{'cardnumber'} eq ''){
+       push @errors,"cardnumber";
+    $ok=1;
+} else {
+    #check cardnumber is valid
+    my $nounique;
+    if ( $data{'type'} eq "Add" )    {
+       $nounique = 0;
+    } else {
+       $nounique = 1;
+    }
+    my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique);
+    if ($valid != 1){
+        $ok=1;
+       push @errors, "invalid_cardnumber";
+    }
+}
+if ($data{'sex'} eq ''){
+    push @errors, "gender";
+    $ok=1;
+}
+if ($data{'firstname'} eq ''){
+    push @errors,"firstname";
+    $ok=1;
+}
+if ($data{'surname'} eq ''){
+    push @errors,"surname";
+    $ok=1;
+}
+if ($data{'address'} eq ''){
+    push @errors, "address";
+    $ok=1;
+}
+if ($data{'city'} eq ''){
+    push @errors, "city";
+    $ok=1;
+}
+
+# Pass the ok/not ok status and the error message to the template
+$template->param(      OK=> ($ok==0));
+foreach my $error (@errors) {
+       $template->param( $error => 1);
+}
+
+# If things are ok, display the confirmation page
+if ($ok == 0) {
+    my $name=$data{'title'}." ";
+    if ($data{'othernames'} ne ''){
+       $name.=$data{'othernames'}." ";
+    } else {
+       $name.=$data{'firstname'}." ";
+    }
+    $name.="$data{'surname'} ( $data{'firstname'}, $data{'initials'})";
+    my $sex;
+    if ($data{'sex'} eq 'M'){
+       $sex=1;
+    } else {
+       $sex=0;
+    }
+    if ($data{'joining'} eq ''){
+       $data{'joining'}=ParseDate('today');
+       $data{'joining'}=format_date($data{'joining'});
+    }
+    if ($data{'expiry'} eq ''){
+       my $get_enrolmentperiod = $dbh->prepare(q{SELECT enrolmentperiod FROM 
categories WHERE categorycode = ?});
+       $get_enrolmentperiod->execute($data{'categorycode'});
+       my ( $period ) = $get_enrolmentperiod->fetchrow;
+       if ( ($period)  && ($period != 1))
+       {
+               $data{'expiry'}=ParseDate("in $period years");
+               $data{'expiry'}=format_date($data{'expiry'});
+       }
+       else
+       {
+               $data{'expiry'}=ParseDate('in 1 year');
+               $data{'expiry'}=format_date($data{'expiry'});
+       }
+    }
+    my $ethnic=$data{'ethnicity'}." ".$data{'ethnicnotes'};
+    my $postal=$data{'address'}."<br>".$data{'city'};
+    my $home;
+    if ($data{'streetaddress'} ne ''){
+       $home=$data{'streetaddress'}."<br>".$data{'streetcity'};
+    } else {
+       $home=$postal;
+    }
+    my @inputsloop;
+    while (my ($key, $value) = each %data) {
+       $value=~ s/\"/%22/g;
+       my %line;
+       $line{'key'}=$key;
+       $line{'value'}=$value;
+       push(@inputsloop, \%line);
+    }
+
+    #Get the fee
+    my $sth = $dbh->prepare("SELECT enrolmentfee FROM categories WHERE 
categorycode = ?");
+    $sth->execute($data{'categorycode'});
+    my ($fee) = $sth->fetchrow;
+    $sth->finish;
+
+    $template->param(name => $name,
+                    bornum => $data{'borrowernumber'},
+                    cardnum => $data{'cardnumber'},
+                    memcat => $data{'categorycode'},
+                    fee => $fee,
+                    joindate => format_date($data{'joining'}),
+                    expdate => format_date($data{'expiry'}),
+                    branchcode => $data{'branchcode'},
+                    ethnic => $ethnic,
+                    dob => format_date($data{'dateofbirth'}),
+                    sex => $sex,
+                    postal => $postal,
+                    home => $home,
+                       zipcode => $data{'zipcode'},
+                       homezipcode => $data{'homezipcode'},
+                    phone => $data{'phone'},
+                    phoneday => $data{'phoneday'},
+                    faxnumber => $data{'faxnumber'},
+                    emailaddress => $data{'emailaddress'},
+                       textmessaging => $data{'textmessaging'},
+                    contactname => $data{'contactname'},
+                    altphone => $data{'altphone'},
+                    altrelationship => $data{'altrelationship'},
+                    altnotes => $data{'altnotes'},
+                    bornotes => $data{'borrowernotes'},
+                    inputsloop => address@hidden);
+
+# If things are not ok, display the error message
+} else {
+    # Nothing to do; the "OK" and "string" variables have already been set
+    ;
+}
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+output_html_with_http_headers $input, $cookie, $template->output;
+
+

Index: pay.pl
===================================================================
RCS file: pay.pl
diff -N pay.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pay.pl      10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,163 @@
+#!/usr/bin/perl
+
+# $Id: pay.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+# written 11/1/2000 by address@hidden
+# part of the koha library system, script to facilitate paying off fines
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Context;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Accounts2;
+use C4::Stats;
+use C4::Members;
+
+my $input=new CGI;
+my ($template, $loggedinuser, $cookie)
+               = get_template_and_user ({ template_name => "members/pay.tmpl",
+                                          query => $input,
+                                          type => "intranet",
+                                          authnotrequired => 0,
+                                          flagsrequired => {borrowers => 1},
+                                          debug => 1,
+                                        });
+
+my $bornum=$input->param('bornum');
+if ($bornum eq ''){
+       $bornum=$input->param('bornum0');
+}
+#get borrower details
+my $data=borrdata('',$bornum);
+my $user=C4::Context->preference('defaultBranch');
+my $me=borrdata('',$loggedinuser);
+my $accountant=$me->{'firstname'}.' '.$me->{'surname'};
+#get account details
+my %bor;
+$bor{'borrowernumber'}=$bornum;
+
+my @names=$input->param;
+my %inp;
+my $check=0;
+my $type;
+my $totalamount;
+my $totaldesc;
+my $totalaccounttype;
+
+for (my $i=0;$i<@names;$i++){
+       my$temp=$input->param($names[$i]);
+       if ($temp eq 'wo'){
+               $type="W";
+               $check=2;
+       }
+if ($temp eq 'yes'){
+               $type="Pay";
+               $check=2;
+       }
+       if ($temp eq 'yes' || $temp eq 'wo'){
+               
+               my $desc=$input->param($names[$i+7]);
+               my $accounttype=$input->param($names[$i+2]);
+               my $amount=$input->param($names[$i+4]);
+               my $bornum=$input->param($names[$i+5]);
+               my $accountno=$input->param($names[$i+6]);
+               my $amounttopay=$input->param($names[$i+8]);
+
+               makepayment($bornum,$accountno,$amounttopay,$accountant, $type);
+               $totalamount=$totalamount+$amounttopay;
+               $totaldesc .="<br> ".$desc."-  Fee:".$amounttopay;
+               $totalaccounttype .="<br> ".$accounttype;
+               $check=2;
+       }
+}
+if ($type eq "Pay" || $type eq "W"){
+print 
$input->redirect("/cgi-bin/koha/members/payprint.pl?bornum=$bornum&accounttype=$totalaccounttype&amount=$totalamount&desc=$totaldesc");
+}
+my %env;
+   
+
+$env{'branchcode'}=C4::Context->preference('defaultBranch');
+my $total=$input->param('total');
+if ($check ==0){
+       
+       if ($total ne ''){
+               recordpayment(\%env,$bornum,$total);
+       }
+       my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
+
+       my @loop_pay;
+       for (my $i=0;$i<$numaccts;$i++){
+               if ($accts->[$i]{'amountoutstanding'} > 0){
+                       $accts->[$i]{'amount'}+=0.00;
+                       $accts->[$i]{'amountoutstanding'}+=0.00;
+                       my %line;
+                       $line{i}=$i;
+                       $line{itemnumber} = $accts->[$i]{'itemnumber'};
+                       $line{accounttype} = $accts->[$i]{'accounttype'};
+                       $line{amount} = sprintf("%.2f",$accts->[$i]{'amount'});
+                       $line{amountoutstanding} = 
sprintf("%.2f",$accts->[$i]{'amountoutstanding'});
+                       $line{bornum} = $bornum;
+                       $line{accountno} = $accts->[$i]{'accountno'};
+                       $line{description} = $accts->[$i]{'description'};
+                       $line{title} = $accts->[$i]{'title'};
+                       push(@loop_pay, \%line);
+               }
+       }
+       $template->param(firstname => $data->{'firstname'},
+                                                       surname => 
$data->{'surname'},
+                                                       bornum => $bornum,
+                                                       loop_pay => 
address@hidden,
+                                                       total => 
sprintf("%.2f",$total),
+                                                       totalamountopay => 
sprintf("%.2f",$total));
+output_html_with_http_headers $input, $cookie, $template->output;
+
+} else {
+       my%inp;
+       my @name=$input->param;
+       for (my $i=0;$i<@name;$i++){
+               my $test=$input->param($name[$i]);
+               if ($test eq 'wo'){
+               my $temp=$name[$i];
+               $temp=~ s/payfine//;
+               $inp{$name[$i]}=$temp;
+               }
+       }
+       my $bornum;
+       while ( my ($key, $value) = each %inp){
+               #  print $key,$value;
+               my $accounttype=$input->param("accounttype$value");
+               $bornum=$input->param("bornum$value");
+               my $itemno=$input->param("itemnumber$value");
+               my $amount=$input->param("amount$value");
+               
+       }
+       $bornum=$input->param('bornum');
+       print $input->redirect("/cgi-bin/koha/members/pay.pl?bornum=$bornum");
+}
+
+
+
+
+# Local Variables:
+# tab-width: 4
+# End:

Index: payprint.pl
===================================================================
RCS file: payprint.pl
diff -N payprint.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ payprint.pl 10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,85 @@
+#!/usr/bin/perl
+# WARNING: Not enough context to figure out the correct tabstop size
+# WARNING: Assume that this file uses 4-character tabs
+
+# $Id: payprint.pl,v 1.1.2.1 2007/03/10 01:19:30 tgarip1957 Exp $
+
+#written 11/1/2000 by address@hidden
+#part of the koha library system, script to facilitate paying off fines
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Context;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Date;
+use C4::Members;
+my $input=new CGI;
+
+#print $input->header;
+my $bornum=$input->param('bornum');
+
+#get borrower details
+my $data=borrdata('',$bornum);
+#my $user=C4::Context->preference('defaultbranch');
+my $amount=$input->param('amount');
+my $accounttype=$input->param('accounttype');
+my $desc=$input->param('desc');
+
+if ($accounttype eq "FU"){
+$accounttype="Overdue item";
+}elsif ($accounttype eq "L"){
+$accounttype="Very Overdue or Lost item";
+}else{
+$accounttype="Miscelenaous Fees";
+}
+       my($template, $loggedinuser, $cookie)
+               = get_template_and_user ({ template_name => 
"members/payprint.tmpl",
+                                          query => $input,
+                                          type => "intranet",
+                                          authnotrequired => 0,
+                                          flagsrequired => {borrowers => 1},
+                                          debug => 1,
+                                        });
+       my $user=borrdata('',$loggedinuser);
+my @datearr = localtime(time());
+my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", 
($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
+       $template->param(firstname => $data->{'firstname'}, 
date=>format_date($todaysdate),
+                                                       surname => 
$data->{'surname'},
+                                                       cardnumber => 
$data->{'cardnumber'},
+                                                       street => 
$data->{'street'},
+                                                       city => $data->{'city'},
+                                                       phone => 
$data->{'phone'},
+                                                       email => 
$data->{'email'},
+                                                       amount=> $amount,
+                                                       desc=> $desc,
+                                                       accounttype=> 
$accounttype,
+                                                       bornum=>$bornum,
+                                                       
loggeduser=>$user->{'firstname'}.' '.$user->{'surname'},
+                                                       );
+       output_html_with_http_headers $input, $cookie, $template->output;
+
+
+
+# Local Variables:
+# tab-width: 4
+# End:

Index: readingrec.pl
===================================================================
RCS file: readingrec.pl
diff -N readingrec.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ readingrec.pl       10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+
+# written 27/01/2000
+# script to display borrowers reading record
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use C4::Date;
+use C4::Members;
+my $input=new CGI;
+
+
+my $bornum=$input->param('bornum');
+#get borrower details
+my $data=borrdata('',$bornum);
+my $order=$input->param('order');
+my $order2=$order;
+if ($order2 eq ''){
+  $order2="date_due desc";
+}
+my $limit=$input->param('limit');
+if ($limit eq 'full' || $limit eq 0){
+  $limit=0;
+} else {
+  $limit=50;
+}
+my ($count,$issues)=allissues($bornum,$order2,$limit);
+
+my ($template, $loggedinuser, $cookie)
+= get_template_and_user({template_name => "members/readingrec.tmpl",
+                               query => $input,
+                               type => "intranet",
+                               authnotrequired => 0,
+                               flagsrequired => {borrowers => 1},
+                               debug => 1,
+                               });
+
+my @loop_reading;
+
+for (my $i=0;$i<$count;$i++){
+       my %line;
+       if($i%2){
+               $line{'toggle'} = 1;
+       }
+       $line{biblionumber}=$issues->[$i]->{'biblionumber'};
+       $line{title}=$issues->[$i]->{'title'};
+       $line{author}=$issues->[$i]->{'author'};
+       $line{classification} = $issues->[$i]->{'classification'};
+       $line{date_due}=format_date($issues->[$i]->{'date_due'});
+       $line{returndate}=format_date($issues->[$i]->{'returndate'});
+       $line{volumeddesc}=$issues->[$i]->{'volumeddesc'};
+       push(@loop_reading,\%line);
+}
+
+$template->param(
+                                               biblionumber => 
$data->{'biblionumber'},
+                                               title => $data->{'title'},
+                                               initials => $data->{'initials'},
+                                               surname => $data->{'surname'},
+                                               bornum => $bornum,
+                                               limit => $limit,
+                                               firstname => 
$data->{'firstname'},
+                                               cardnumber => 
$data->{'cardnumber'},
+                                               showfulllink => ($count > 50),  
                                
+                                               loop_reading => address@hidden);
+output_html_with_http_headers $input, $cookie, $template->output;
+
+
+

Index: setdebar.pl
===================================================================
RCS file: setdebar.pl
diff -N setdebar.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ setdebar.pl 10 Mar 2007 01:19:30 -0000      1.1.2.1
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+
+#script to set or lift debarred status
+#written 2/8/04
+#by address@hidden
+
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+
+use CGI;
+use C4::Context;
+use C4::Auth;
+use C4::Members;
+
+my $input = new CGI;
+
+my $flagsrequired;
+$flagsrequired->{borrower}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
+
+my $destination = $input->param("destination");
+my $cardnumber = $input->param("cardnumber");
+my $borrowernumber=$input->param('borrowernumber');
+my $status = $input->param('status');
+
+my $dbh = C4::Context->dbh;
+my $sth=$dbh->prepare("Update borrowers set debarred = ? where borrowernumber 
= ?");
+$sth->execute($status,$borrowernumber);
+my $data=$sth->fetchrow_hashref;
+$sth->finish;
+
+if($destination eq "circ"){
+       print 
$input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber");
+} else {
+       print 
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrowernumber");
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]