Net::SMTP DBI Mail::Address Email::Valid sub start_form_Booking { my($ctxt)=@_; } sub load_paymenttype { my($ctxt,$value)=@_; return $value || "[undefined]", "Choose type" => "[undefined]", "Credit card" => "Credit card", "Purchase order" => "Purchase order", "Cheque" => "Cheque", ; } sub load_Type { my($ctxt,$value)=@_; return $value || "[undefined]", "Choose type" => "[undefined]", "Academic" => "Academic", "Business" => "Business", ; } sub validate_Lastname { my($ctxt,$value)=@_; $value=~s/^\s*//; $value=~s/\s*$//; die "You must enter a last name" unless length($value); } sub validate_Firstname { my($ctxt,$value)=@_; $value=~s/^\s*//; $value=~s/\s*$//; die "You must enter a first name" unless length($value); } sub validate_Email { my($ctxt,$value)=@_; die "You must enter a valid email address" unless Email::Valid->address($value); } sub validate_Ordernumber { my($ctxt,$value)=@_; if ($ctxt->{Form}{paymenttype} eq 'Purchase order' and $value eq '') { die "you must supply a purchase order number"; } } sub validate_Type { my($ctxt,$value)=@_; if ($ctxt->{Form}{Type} eq '[undefined]') { die "You must choose Academic or Business"; } } sub validate_paymenttype { my($ctxt,$value)=@_; if ($ctxt->{Form}{paymenttype} eq '[undefined]') { die "You must choose a payment type"; } } sub submit_send { my($ctxt,$value)=@_; my $date = scalar localtime; my $name=$ctxt->{Form}{Firstname} . " " . $ctxt->{Form}{Lastname}; my $addr = Mail::Address->new($name, $ctxt->{Form}{Email}) or die "Unable to build From: address"; my $them = $addr->format(); my $us= "osswatch-data\@rt.oucs.ox.ac.uk"; # my $host="pgsql.oucs.ox.ac.uk"; # my $user="www-data"; # my $pwd=""; my $host="sysdev-db1.oucs.ox.ac.uk"; my $user="osswatch_web"; my $pwd="t8J3YY6JR7CdnNwJ"; my $dbh = DBI->connect("dbi:Pg:dbname=osswatch;host=$host;port=5432",$user,$pwd) or die "cannot connect to osswatch database"; my ($sequence) = $dbh->selectrow_array("SELECT NEXTVAL('booking_seq')"); my $n1 = $ctxt->{Form}{Firstname}; my $n2 = $ctxt->{Form}{Lastname}; $n1 =~ s/(.).*/$1/; $n2 =~ s/(.).*/$1/; my $bookingref= $n1 . $n2 . $sequence; my $Contact=0; my $List=0; my $Dinner=0; my $Accomodation=0; if ($ctxt->{Form}{Contact} eq 'true') { $Contact=1;} if ($ctxt->{Form}{List} eq 'true') { $List=1;} if ($ctxt->{Form}{Dinner} eq 'true') { $Dinner=1;} if ($ctxt->{Form}{Accomodation} eq 'true') { $Accomodation=1;} my $FEE=0; if ($ctxt->{Form}{Type} eq 'Academic') { $FEE = 250; } else { $FEE = 275; } if ($ctxt->{Form}{discountcode} eq 'Survey 2006') { $FEE -= $FEE * .9; } elsif ($ctxt->{Form}{discountcode} eq 'JISC') { $FEE -= $FEE * .9; } elsif ($ctxt->{Form}{discountcode} eq 'ITSS') { $FEE = 0; } elsif ($ctxt->{Form}{discountcode} eq 'SPECIAL') { $FEE = 100; } if ($Dinner == 1 ) { $FEE += 40;} if ($Accomodation ==1) { $FEE +=151.58; } # early bird my $rc = $dbh->do("INSERT INTO bookings ( id, Event, Title, Lastname, Firstname, Email, Job, Department, Organisation, Street, City, County, PostCode, Country, Phone, Fax, Diet, Access, Contact, List, status, paymenttype, Ordernumber, Accomodation, Type, Dinner, bookingref, Fee ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )", {}, $sequence, 5, $ctxt->{Form}{Title}, $ctxt->{Form}{Lastname}, $ctxt->{Form}{Firstname}, $ctxt->{Form}{Email}, $ctxt->{Form}{Job}, $ctxt->{Form}{Department}, $ctxt->{Form}{Organisation}, $ctxt->{Form}{Street}, $ctxt->{Form}{City}, $ctxt->{Form}{County}, $ctxt->{Form}{PostCode}, $ctxt->{Form}{Country}, $ctxt->{Form}{Phone}, $ctxt->{Form}{Fax}, $ctxt->{Form}{Diet}, $ctxt->{Form}{Access}, $Contact, $List, 0, $ctxt->{Form}{paymenttype}, $ctxt->{Form}{Ordernumber}, $Accomodation, $ctxt->{Form}{Type}, $Dinner, $bookingref, $FEE*100 ); if ($rc != 1) { die "YIKES. Failed to update database, code $rc:" . $dbh->errstr; } $dbh->disconnect; # to be changed to osswatch-data\@rt.oucs.ox.ac.uk"; my $dcode ="(" . $ctxt->{Form}{discountcode} . ")"; my $message = <<"EOT"; To: $them From: $us Subject: OSS Watch Conference registration $dcode Dear $ctxt->{Form}{Firstname} $ctxt->{Form}{Lastname}, Thank you for registering for the OSS Watch conference *Open Source and Sustainability*, 10-12 April 2006, Oxford. Your booking reference is $bookingref. =============== Booking options =============== --------------- Payment type: $ctxt->{Form}{paymenttype} EOT if ($ctxt->{Form}{Type} eq 'Academic') { $message .= "\nYou have made an Academic booking\n";} else { $message .= "\nYou have made a Business booking\n";} if ($Dinner == 1 ) { $message .= "\nYou have booked a place at the conference dinner @ £40\n"; } if ($Accomodation == 1 ) { $message .= "\nYou have booked accomodation @ £151.58\n"; } #$message .= "\nYou are entitled to an earlybird discount of £25\n"; $message .= "\nYour total fee due is £$FEE\n"; if ($ctxt->{Form}{paymenttype} eq 'Credit card') { $message .= <<"EOT"; Please print out this page, fill out the section below and send it to the address indicated. Credit/debit card payment details: Card type: Mastercard / Visa / Switch [no other cards are acceptable] Card number: _________________________________________ Expiry Date (MM/YY): _________________________________ Issue number (for Switch payments): __________________ Account name (name on the card - please print): _____________________ Signature: ______________________________________ N.B. All credit card payments are charged in GBP. Your card issuer may charge an additional fee for currency conversion. Send the completed form to: Open Source and Sustainability c/o OSS Watch Research Technologies Service Oxford University 13 Banbury Road Oxford OX2 6NN United Kingdom EOT } elsif ($ctxt->{Form}{paymenttype} eq 'Purchase order') { $message .= <<"EOT"; Purchase order number: $ctxt->{Form}{Ordernumber} Please print out this page, fill out the section below and send it to the address indicated. Please enclose a copy of your institution's purchase order or provide the following details for invoicing. Department: _________________________________________ Institution: _________________________________________ Street: _________________________________ Town/city: _________________________________ Region/county: _________________________________ Postal code: _________________________________ Country: _________________________________ Telephone: _________________________________ Fax: _________________________________ Send the completed form to: Open Source and Sustainability c/o OSS Watch Research Technologies Service Oxford University 13 Banbury Road Oxford OX2 6NN United Kingdom EOT } elsif ($ctxt->{Form}{paymenttype} eq 'Cheque') { $message .= <<"EOT"; Please print out this page and send it, along with your cheque for payment to the address below. Cheques should be made out to "OUCS", i.e. Oxford University Computing Services. Open Source and Sustainability c/o OSS Watch Research Technologies Service Oxford University 13 Banbury Road Oxford OX2 6NN United Kingdom EOT } $message .= <<"EOT"; ================ Personal details ================ Name: $ctxt->{Form}{Title} $ctxt->{Form}{Firstname} $ctxt->{Form}{Lastname} Institution: $ctxt->{Form}{Organisation} Address: $ctxt->{Form}{Job} $ctxt->{Form}{Department} $ctxt->{Form}{Street} $ctxt->{Form}{City} $ctxt->{Form}{County} $ctxt->{Form}{PostCode} $ctxt->{Form}{Country} Email: $ctxt->{Form}{Email} ================= Dietary requirements: $ctxt->{Form}{Diet} Access requirements: $ctxt->{Form}{Access} This booking remains provisional until payment has been received. The venue for the conference is the Said Business School, University of Oxford. Registration begins at 12:30 on Monday, 10 April. The opening conference session begins at 13:30 on Monday, 10 April. The final conference session ends at 12:30 on Wednesday, 12 April. Please let us know if, for any reason, you find you are not able to attend and see the cancellation policy at http://www.oss-watch.ac.uk/events/2006-04-10-12/cancellation.xml We look forward to seeing you in April. ======= Open Source and Sustainability 2006 OSS Watch EOT my $smtp= Net::SMTP->new('smtp.ox.ac.uk') or die; $smtp->mail($us); $smtp->recipient($them); $smtp->data($message); if ($smtp->quit) { } else { die "message sending failed" } $message = <<"EOT"; To: $us From: $them Subject: conference booking from $them $dcode $ctxt->{Form}{Firstname} $ctxt->{Form}{Lastname} booked on $date for the OSS Watch Conference on 10-12 April in Oxford Title: $ctxt->{Form}{Title} Firstname: $ctxt->{Form}{Firstname} Lastname: $ctxt->{Form}{Lastname} Email: $ctxt->{Form}{Email} Type: $ctxt->{Form}{Type} Job: $ctxt->{Form}{Job} Department: $ctxt->{Form}{Department} Organisation: $ctxt->{Form}{Organisation} Street: $ctxt->{Form}{Street} City: $ctxt->{Form}{City} County: $ctxt->{Form}{County} PostCode: $ctxt->{Form}{PostCode} Country: $ctxt->{Form}{Country} Phone: $ctxt->{Form}{Phone} Fax: $ctxt->{Form}{Fax} Diet: $ctxt->{Form}{Diet} Access: $ctxt->{Form}{Access} Contact: $ctxt->{Form}{Contact} List: $ctxt->{Form}{List} Payment type: $ctxt->{Form}{paymenttype} Order number: $ctxt->{Form}{Ordernumber} Accomodation: $ctxt->{Form}{Accomodation} Dinner:$ctxt->{Form}{Dinner} Reference: $bookingref Total Fee: $FEE EOT $smtp= Net::SMTP->new('smtp.ox.ac.uk') or die; $smtp->mail($them); $smtp->recipient($us); $smtp->data($message); if ($smtp->quit) { return "confirm.xml" } else { return "." } } Open Source and Sustainability - booking form OSS Watch, Oxford University OSS Watch
info@oss-watch.ox.ac.uk
http://creativecommons.org/licenses/by-sa/2.0/uk/ 2006-01-11

This is the master version of an original document, created by converting an HTML file to TEI XML on 2001/09/06.

2006-01-11 author Randolph Metcalfe creation

On completing the booking form you you will receive a summary of your provisional booking details by email. You should print out this email, complete the payment details, and return a copy of it to the address indicated (Open Source and Sustainability, c/o OSS Watch, Research Technologies Service, Oxford University, 13 Banbury Road, Oxford, OX2 6NN or fax: +44 (0)1865 273275) together with your cheque or official purchase order. Please make cheques payable to "OUCS", ie. Oxford University Computing Services.

If you do not receive an email with your provisional booking details please contact info@oss-watch.ac.uk.

Personal Details: Title: First name: Last Name E-mail address: Job title: Department: Institution/organisation: Street: Town/City: Region/County: Postal code: Country: Telephone: Fax: Special dietary requirements: Access requirements: Delegate list:Please include my name and institution in the delegates list Email list:Please add my name and email address to the osswatch-announce@jiscmail.ac.uk list if it is not already there so that I may be kept informed of future OSS Watch developments and events

Booking options

Conference fee (academic £250, business £275) Discount code (if applicable) Conference dinner £40 Accommodation (2 nights, limited availability) £151.58 (£75.79 per night, inc. VAT)

Payment options

Submitting this form makes a provisional booking for you. Your place will be confirmed when we receive payment. Please indicate here how you intend to pay:

If you have selected "Purchase order" payment option, please enter your purchase order number here:

Further details will be included in the email we will send you.

Please check the form carefully before clicking the Register button below.

Or Return to main conference page