16
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";
}*/
?>
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.