#!/usr/bin/perl use CGI qw(param cookie); use POSIX; use DBI; my $dbh = DBI->connect("DBI:mysql:licenses:localhost","licenseuser","kic"); my $step = param('step'); my $license = param('license'); my $where = param('where'); my $exlic = param('exlic'); my $exp = ";exlic=$exlic" if ($exlic); if (!$where) { my $cty = 'int'; $where = 'uk' if ($cty eq 'uk'); $where = 'ecnonumber' if ($cty eq 'eu'); $where ||= 'nonec'; } my $coupon = param('coupon'); print "Content-type:text/html\n\n"; open(TOP,"top.html.ssl"); print while (); close(TOP); print "
"; if (!$step) { print qq~Thanks for your interest in using bbBoard v2. We offer two different payment options. You can either rent a copy of bbBoard v2, or purchase one. What\'s the difference between renting and purchasing, and what\'s the difference between Business and Regular?

Purchasing: Please select below which license you wish to use.

Regular License (~ . '£50 GBP' . qq~)
Choose this option if you will not be using the software for business use.

Business License (~ . '£89 GBP' . qq~)
Choose this option if you will be using the software for business use.

Renting: Please select below which license you wish to use.

Regular License (~ . '£4.99 GBP' . qq~ per month)
Choose this option if you will not be using the software for business use.

Business License (~ . '£6.99 GBP' . qq~ per month)
Choose this option if you will be using the software for business use.
~; } elsif ($step == 55) { print qq~You have chosen a $license license.

Please now choose where you are located in the world from the options below. The option you select must match with the billing address you provide later on.

I am in the UK.
~; if ($license eq 'business') { print qq~ I am in the EC (but outside of the UK), and I have a VAT registration number for my business.
I am in the EC (but outside of the UK), and I don\'t have a VAT registration number for my business.
~; } else { print qq~ I am in the EC (but outside of the UK).
~; } print qq~ I am not in the EC (e.g if you\'re in the USA).

~; } elsif ($step == 2 || param('changemeth') || param('docoupon') eq 'Redeem') { my %in = ( uk => 'in the UK', ecwithnumber => 'in the EC, with a VAT registration number', ecnonumber => 'in the EC' . (($license eq 'business') ? ', without a VAT registration number' : ''), nonec => 'not in the EC'); print qq~You have chosen a ~ . ($license eq 'personal' ? 'regular' : $license) . qq~ license, and you are $in{$where}. ~; if ($where eq 'ecnonumber' && $license eq 'business') { print qq~
~; } my $tax; if ($where eq 'uk' || $where eq 'ecnonumber') { # print qq~17.5% VAT has been included in the total purchase price.~; # $tax = 1; } elsif ($where eq 'ecwithnumber' || $where eq 'nonec') { $tax = 0; } require "/home/bbv2/v2/amounts.pl"; my $amt = &amounts; my $total = ($license eq 'personal') ? $amt->{int}->{per_rent} : $amt->{int}->{bus_rent}; my $ustotal = ($license eq 'personal') ? $amt->{usa}->{per_rent} : $amt->{usa}->{bus_rent}; # $coupon = 'v2intro'; print qq~
"; # my $tax = ($total * 0.175); # $tax = sprintf("%0.2f",$tax); # my $ustax = ($ustotal * 0.175); # $ustax = sprintf("%0.2f",$ustax); print qq~
~; print "Upgrade For:$exlic
" if ($exlic); print "Base price:$amt->{int}->{prefix}$total$amt->{int}->{suffix} per month" . ($tax ? " (inc VAT)" : '') . "
" if ($coupon); my $discount, $usdiscount, $pluscon; if (!$coupon) { print qq~If you have a coupon code, please enter it here. Coupon Code: ~; } else { print qq~Coupon Code:$coupon~; # if ($coupon=~/^existing_/) { if ($coupon eq 'bbv1') { $pluscon = qq~
plus $amt->{int}->{prefix}$amt->{int}->{amt_inst}$amt->{int}->{suffix} for conversion~; print qq~
v1 Conversion:$amt->{int}->{prefix}$amt->{int}->{amt_inst}$amt->{int}->{suffix}~; } else { print qq~
Discount:Sorry, this coupon can only be redeemed against purchased licenses.~; } # $discount = $amt->{int}->{dis_exist}; # $usdiscount = $amt->{usa}->{dis_exist}; # print qq~
Discount:$amt->{int}->{prefix}$discount$amt->{int}->{suffix}~; # $total -= $discount; # $ustotal -= $usdiscount; # } # elsif ($coupon eq 'v2intro') { # $discount = $amt->{int}->{dis_int}; # $usdiscount = $amt->{usa}->{dis_int}; # print qq~
Discount:$amt->{int}->{prefix}$discount$amt->{int}->{suffix}~; # $total -= $discount; $ustotal -= $usdiscount; # } } print "
"; my $installation = param('installation'); if ($installation) { print qq~Installation:$amt->{int}->{prefix}$amt->{int}->{amt_inst}$amt->{int}->{suffix}
~; } else { print qq~Installation:Click here to have a tech install bbBoard v2 for you ($amt->{int}->{prefix}$amt->{int}->{amt_inst}$amt->{int}->{suffix})
~; } if ($tax) { my $taxamt = sprintf("%0.2f",$total * (17.5 / (100 + 17.5))); my $pretax = $total - $taxamt; print "Subtotal:$amt->{int}->{prefix}$pretax$amt->{int}->{suffix} per month
Tax (VAT):$amt->{int}->{prefix}$taxamt$amt->{int}->{suffix}
~; # $total = $total + $tax; # $ustotal = $ustotal + $ustax; } my $meth = param('method'); my $ref; while (!$ref) { $ref = int(rand(999999999999)); my $sth = $dbh->prepare("SELECT invnumber FROM invoices WHERE invnumber = '$ref'"); $sth->execute; (my $alr) = $sth->fetchrow_array; $sth->finish; $ref = '' if ($alr); } my $sess = cookie("frmsessionid"); my $uid; if ($sess) { require "/home/bbv2/sf.bbv2.com/bbv2api.pm"; my $bbv2 = new bbv2api; my $uu = $bbv2->{db}->bbselect('uid, sesid','session',"sesid = '$sess'",'sesid'); $uid = $uu->{$sess}->{uid}; } $dbh->do("INSERT INTO invoices (invnumber, currency, total, status, uid, lictype, rentorbuy, wantsinstall, whatfor, extlicense) VALUES ('$ref','GBP','$total','Awaiting Payment', '$uid', '$license', 'rented','" . ($installation ? $amt->{int}->{amt_inst} : '0') . "', '" . ($exlic ? 'UpgradeTrial' : 'license') . "', " . ($exlic ? "'$exlic'" : 'NULL') . ")"); if ($installation) { print qq~Total:$amt->{int}->{prefix}$total$amt->{int}->{suffix} per month
plus $amt->{int}->{prefix}$amt->{int}->{amt_inst}$amt->{int}->{suffix} one-time$pluscon
~; } else { print qq~Total:$amt->{int}->{prefix}$total$amt->{int}->{suffix} per month$pluscon~; } if ($meth ne 'check') { print qq~Please choose a payment method below, and make payment. After making payment, you will be taken to your client area, where you will be able to download a copy of bbBoard v2, and manage your license. We offer a 30-day no questions asked 100% money-back guarantee. You may also cancel your license at any time.

~; # print qq~~; print qq~~; } elsif ($pluscon) { my $famt = $amt->{int}->{amt_inst} + $total; print qq~PayPal~; } else { print qq~PayPal~; print qq~~; } #http://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=support\@bbv2.com&item_name=bbBoard v2 rented $license license&amount=$total&no_note=1¤cy_code=GBP&lc=GB&invoice=$ref¬ify_url=http://www.bbv2.com/paypalpassback.boy">PayPal } else { print qq~PayPal~; } print qq~
Credit/Debit Card #
#


#
~; if ('GBP' ne 'AUD' && 'GBP' ne 'CNY') { if ($installation) { my $famt = $amt->{int}->{amt_inst} + $total; if ($pluscon) { $famt += $amt->{int}->{amt_inst} } print qq~PayPal





PayPal is not yet available for your currency. If you wish to pay by PayPal, please click here to review your order in GBP, then choose PayPal.



~; } # if ($meth eq 'check') { # if ("GBP" ne 'GBP') { # my $surcharge = $amt->{int}->{chk_surcharge}; # print qq~Paper cheque surchage: $amt->{int}->{prefix}$surcharge$amt->{int}->{suffix}

~; # print qq~[ Choose a different payment method? ]

~; # $total += $surcharge; # } # print qq~ # # Please send a paper cheque for $amt->{int}->{prefix}$total$amt->{int}->{suffix} to:

~ . "Chris Brooks, bbv2 site
9 Travis Grove
Thorne
Doncaster
Sth Yorkshire
DN8 5PL
England" . #bbv2.com
Suite 6
34 Buckingham Palace Road
London
SW1W 0RH
England #qq~
A window with a print out form should have popped up when you loaded this page (click here if it didn\'t). To ensure quick processing of your cheque, please print out the form, fill in the blanks, staple the cheque to the paper and send it in an envelope to the above address. If you are not sending from the UK, then air mail is preferred.

We understand that post will take a while, but endeavour to process all cheques on the day we receive them. While you\'re waiting, please feel free to take advantage of our Free Trial - you will be able to set up and begin using your board right now, before your payment is processed.~; # } } open(BOT,"bottom.html.ssl"); print while (); close(BOT);