11
peterr
Re: Web Hosting module
  • 2004/8/10 5:04

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Hi,

Quote:

Bassman wrote:
Recent intensive practice :) I've converted a few scripts to modules. It's not hard, especially if there's no database access involved. If you want it to have a look at how it's put together, let me know & i'll put it up for download.


Yes thanks, that would be good. I'll look into why the 'form submit' won't work within a module, but will work as a 'block'. No doubt there are other modules that do a submit, possibly because the form is submitting itself, if you know what I mean, that it has problems within a module ??

Peter

12
Bassman
Re: Web Hosting module
  • 2004/8/10 5:11

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


Yeah, I noticed that the calculate button wouldn't work, i'm sure there's a simple reason for that.

You can download the zip from here . Have fun!

13
peterr
Re: Web Hosting module
  • 2004/8/10 5:14

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Bassman wrote:
Yeah, I noticed that the calculate button wouldn't work, i'm sure there's a simple reason for that.


Yes, possibly the GET should be a POST and the form has no ID or name, I'll just compare how it is done to other modules that do a submit, I'm sure it's very minor.

Thanks for the link to the zip file (will d/load now) and for making the module. :)

Peter

14
Bassman
Re: Web Hosting module
  • 2004/8/11 1:20

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


peter,
I tried running the script in an i-frame, and it works fine that way. Let me know if you want info.

15
peterr
Re: Web Hosting module
  • 2004/8/11 3:41

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Hi,

Okay, thanks, if you can pass the info on, that will help.

Peter

16
ChadK
Re: Web Hosting module
  • 2004/8/11 19:02

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


I have modified that index.php page from the hosting module so it doesn't have all that color and crap.. I'm not quite done as you can see when you look at the code.

I'm trying to make it easier to deal with. Easier to add items to the boxes and such.

Quote:

include ('../../mainfile.php');
include ('../../header.php');
extract($_POST);

if(!isset($dn))
{
// domain type
$d="n";
// payment frequency
$f="y";
// taxes quebec, taxes canada
$tax="no";
}

$frequency = "year";
if($f==="m") $frequency="month";
if($f==="y") $frequency="year";

$plan[0][1]=0;
$plan[0][0]="No Hosting - $".$plan[0][1];
$plan[1][1]=3;
$plan[1][0]="Basic 50MB 500MB - $".$plan[1][1];
$plan[2][1]=6;
$plan[2][0]="Standard 100MB 1000MB - $".$plan[2][1];
$plan[3][1]=10;
$plan[3][0]="Professional 200MB 5000MB - ".$plan[3][1];
if($planselect<0) $planselect=0;
$plancount=4;

$extraspace[0][1]=0;
$extraspace[0][0]="+0 MB - $".$extraspace[0][1];
$extraspace[1][1]=2;
$extraspace[1][0]="+100 MB - $".$extraspace[1][1];
$extraspace[2][1]=5;
$extraspace[2][0]="+500 MB - $".$extraspace[2][1];
$extraspace[3][1]=10;
$extraspace[3][0]="+1000 MB - $".$extraspace[3][1];
$extraspace[4][1]=20;
$extraspace[4][0]="+4000 MB - $".$extraspace[4][1];
if($spaceselect<0) $spaceselect=0;
$extraspacecount=5;

$extrabandwidth[0][1]=0;
$extrabandwidth[0][0]="+0GB - $".$extrabandwidth[0][1];
$extrabandwidth[1][1]=10;
$extrabandwidth[1][0]="+5GB - $".$extrabandwidth[1][1];
$extrabandwidth[2][1]=15;
$extrabandwidth[2][0]="+10GB - $".$extrabandwidth[2][1];
$extrabandwidth[3][1]=50;
$extrabandwidth[3][0]="+25GB - $".$extrabandwidth[3][1];
$bandwidthcount=4;

if($f==="y") {
$diskspace = ($extraspace[$spaceselect][1]*12);
$bandwidth = ($extrabandwidth[$bandwidthselect][1]*12);
$plancost = ($plan[$planselect][1]*12);
$monthlyfee=0;
if ($d==="m") {
$domain=0;
} else {
$domain =12;
}
} else {
$diskspace = $extraspace[$spaceselect][1];
$bandwidth = $extrabandwidth[$bandwidthselect][1];
$plancost = $plan[$planselect][1];
$monthlyfee=1;
if ($d==="m") {
$domain=0;
} else {
$domain = "1";
}
}

$setup=10;
$subtotal = $domain+$bandwidth+$diskspace+$plancost+$monthlyfee;



/*if($tax==="IA") {
$gst = $subtotal*0.06;
} else {
$gst = "0";
}*/


?>
















//HOSTING PLANS
print "";
print "\n";
//End Hosting Plans


//DISKSPACE
print "";
print "\n";
//End DISKSPACE

//Bandwidth
print "";
print "\n";
//End Bandwidth



?>







/*




*/
?>

















"; ?>

*/ ?>
















Domain Name

checked >Purchase new domain - $12

checked >Transfer my domain - $12

checked >I will manage my own domain name - $0

checked >I want a subdomain (select .aviary.info above) - $0
Hosting Plans
Additional Diskspace
Additional Bandwidth
Payment Frequency
checked >Annual Payments
checked >Pay Monthly +$1/month (administrative costs)
Taxes
checked >I do NOT live in Iowa
checked >Iowa Resident 6%
Invoice Totals
One-time charges
Setup:$10.00
Due Today
Recurring Charges
Domain Name:
Plan:
Extra Diskspace:
Extra Bandwidth:
Monthly Billing Fee".sprintf("$%01.2f",$monthlyfee)."
Subtotal
IA State Sales Tax (6%)
Due each $

$days="365";
$yahoof = "Y";
if($f==="m") {$days="30"; $yahoof="M";}
$company_id = "";
$companyname="Chad Kovac DBA IA Parrot";
$business_email = "chad@aviary.info";
/*
$paysystems = "https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?product1=" .
$plandesc."-".$dn.$tld."-".$d."-".$planselect."-".$dk."-".$b."-".$f . "&companyid=" . $company_id . "&total=" .
$total. "&repeatamount=" . $total .
"&formget=N&redirect=http://www.webhostingcanada.org/success.php" .
"&redirectfail=http://www.webhostingcanada.org/fail.php&reoccur=Y&cycle=" .
$days . "&totalperiod=100";
*/
$paypal = "https://www.paypal.com/subscriptions/business=" . $business_email . "&item_number=" .
$planselect.$d.$planselect.$spaceselect.$bandwidthselect.$f . "&item_name=Hosting%20".$dn.$tld."&no_note=0&cy_code=CAD" .
"&a1=" . $setup . "&p1=1&t1=D" .
"&a3=" . $total . "&p3=1&t3=" . $yahoof .
"&src=1&sra=1";
?>
CLICK HERE to Checkout via PayPal
(Paypal to )

Please type in your Domain Name above, and then click on Recalculate.



include XOOPS_ROOT_PATH.'/footer.php';

?>



I've also started rearranging the code so it makes more sense and I'm removing all of the garbage all over the place so the server doesn't have to stop and start. I'm not sure if PHP is like ASP in this matter but in ASP every time you stop and start the script the server slows down... the more you do it, the slower it all goes.

I also modified this to have a "setup" fee.
I commented/removed tax calculations.
I added a business name.
Reformatted the form and layout.
Cleaned up a few misc bugs including the paypal link.


Keep in mind, I'm not a PHP programmer so be careful with this and give feedback if possible.



17
peterr
Re: Web Hosting module
  • 2004/8/12 1:00

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Hi,

Thanks Chad, I'll give that a try soon.

Peter

18
ChadK
Re: Web Hosting module
  • 2004/8/20 21:57

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


I'm rewriting it from scratch as a proper module with admin options and everything...

19
rsagerj
Re: Web Hosting module
  • 2004/8/22 19:41

  • rsagerj

  • Just popping in

  • Posts: 1

  • Since: 2004/8/22


Wow you guys read my mind... this is the exact module I was looking for...

I dont know how to make/edit a modules but if you need help testing it, let me know...

20
ChadK
Re: Web Hosting module
  • 2004/8/23 14:04

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Sounds good.. nothing ready to test yet but keep watching:
http://dev.xoops.org/modules/xfmod/project/?xpay


Login

Who's Online

318 user(s) are online (230 user(s) are browsing Support Forums)


Members: 0


Guests: 318


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits