Location: PHPKode > projects > QUICKLYWEB > quicklyweb/admin/test2.php
<form method="get">

<?
extract($_GET);
extract($_POST);

if(!isset($dn))
  {
  // domain type
  $d="n";    
  // payment frequency
  $f="y"; 
  // taxes quebec, taxes canada
  $tq="on"; $tc="on";
  } 
  
// to catch the times when $tc is off on $tq is on, if tq is on the tc has to be on
if($tq==="on") $tc="on"; 
?>

<!-- DOMAIN NAME -->
<font face="tahoma,arial" size="2">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2" bgcolor="E9B0B1">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:841718"><font size="5">1</font> Domain Name</font></b></td></tr>
    <tr><td colspan="2" align="right" bgcolor="FAE2E6">
    <table cellspacing=0 cellpadding=0><tr><td>
    <input type="text" size="40" name="dn" value="<?php echo $dn;?>"></td>
    <td><select name="tld">
        <option <? if($tld===".com") { ?>selected<? } ?>>.com</option>
        <option <? if($tld===".org") { ?>selected<? } ?>>.org</option>
        <option <? if($tld===".net") { ?>selected<? } ?>>.net</option>
        <option <? if($tld===".ca") { ?>selected<? } ?>>.ca</option>
        </select></td></tr>
    <tr><td colspan="2"><input type="radio" name="d" value="n" <? if($d==="n") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$25 Purchase new domain<br/>
    <input type="radio" name="d" value="t" <? if($d==="t") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$25 Transfer my domain<br/>
    <input type="radio" name="d" value="m" <? if($d==="m") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$00 I will manage my own domain name</td></tr>
    </table></td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- HOSTING PLANS -->
<tr><td colspan="2" bgcolor="D8A6E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:430A51"><font size="5">2</font> Hosting Plans</font></b></td></tr>
    <tr><td colspan="2" bgcolor="EFDDFB">
    <table cellpadding=0 cellspacing=0 width="100%"><tr><td align="right"><font face="tahoma,arial" size="2">Plan</td>
    <td align="right"><select name="p" style="width:190px">
                      <option value="pp" <? if($p==="pp") { ?>selected<? } ?>>Professional 200MB 10GB</option>
                      <option value="p0" <? if($p==="p0") { ?>selected<? } ?>>No Hosting</option>
                      <option value="pb" <? if($p==="pb") { ?>selected<? } ?>>Basic 50MB 1GB</option>
                      <option value="pr2" <? if($p==="pr2") { ?>selected<? } ?>>Professional2 400MB 14GB</option>
                      <option value="pr5" <? if($p==="pr5") { ?>selected<? } ?>>Reseller5 1GB 35GB</option>
                      <option value="pr20" <? if($p==="pr20") { ?>selected<? } ?>>Reseller20 5GB 140GB</option>
                      <option value="pr50" <? if($p==="pr50") { ?>selected<? } ?>>Reseller50 15GB 350GB</option>
                      <option value="pd" <? if($p==="pd") { ?>selected<? } ?>>Dedicated 80GB 700GB</option>
                      </select></td></tr>
    <tr><td align="right"><font face="tahoma,arial" size="2">Additional Diskspace</td>
    <td align="right"><select name="dk" style="width:190px">
                      <option value="dk0" <? if($dk==="dk0") { ?>selected<? } ?>>+0MB - $0</option>
                      <option value="dk100" <? if($dk==="dk100") { ?>selected<? } ?>>+100MB - $2</option>
                      <option value="dk500" <? if($dk==="dk500") { ?>selected<? } ?>>+500MB - $10</option>
                      <option value="dk1000" <? if($dk==="dk1000") { ?>selected<? } ?>>+1000MB - $20</option>
                      <option value="dk4000" <? if($dk==="dk4000") { ?>selected<? } ?>>+4000MB - $60</option>
                      </select></td></tr>
    <tr><td align="right"><font face="tahoma,arial" size="2">Additional Bandwidth</td>
    <td align="right"><select name="b" style="width:190px">
                      <option value="b0" <? if($b==="b0") { ?>selected<? } ?>>+0GB - $0</option>
                      <option value="b1" <? if($b==="b1") { ?>selected<? } ?>>+1GB - $2</option>
                      <option value="b5" <? if($b==="b5") { ?>selected<? } ?>>+5GB - $10</option>
                      <option value="b25" <? if($b==="b25") { ?>selected<? } ?>>+25GB - $50</option>
                      <option value="b75" <? if($b==="b75") { ?>selected<? } ?>>+75GB - $100</option>
                      <option value="b200" <? if($b==="b200") { ?>selected<? } ?>>+200GB - $200</option>
                      <option value="b500" <? if($b==="b500") { ?>selected<? } ?>>+500GB - $400</option>
                      <option value="b1200" <? if($b==="b1200") { ?>selected<? } ?>>+1200GB - $600</option>
                      </select></td></tr></table>
    </td></tr></table>
</td></tr> 

<tr><td colspan="2" height="10"></td></tr>
<!-- PAYMENT FREQUENCY -->
<tr><td colspan="2" bgcolor="A6C0E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F2D5B"><font size="5">3</font> Payment Frequency</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DDECFB">
    <input type="radio" name="f" value="y" <? if($f==="y") {?>checked<? } ?> ><font face="tahoma,arial" size="2">Pay Yearly<br/>
    <input type="radio" name="f" value="m" <? if($f==="m") {?>checked<? } ?> >Pay Monthly +$1.95/month (administrative costs)</font></td></tr>    
    </table></td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- TAXES -->
<tr><td colspan="2" bgcolor="A4E39F">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F540A"><font size="5">4</font> Taxes</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DFFADA">
    <input type="checkbox" name="tq" <? if($tq==="on") { ?>checked<? } ?> ><font face="tahoma,arial" size="2">I live in Quebec (PST)<br/>
    <input type="checkbox" name="tc" <? if($tc==="on") { ?>checked<? } ?> ><font face="tahoma,arial" size="2">I live in Canada (GST)<br/>
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

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

$domain = "25";

$plandesc = "Professional";
$plan = "120";
if($p==="p0") {$plan="0";$plandesc="No hosting";}
if($p==="pb") {$plan="5";$plandesc="Basic";}
if($p==="pp") {$plan="10";$plandesc="Professional";}
if($p==="pr2") {$plan="14";$plandesc="Professional 2";}
if($p==="pr5") {$plan="35";$plandesc="Reseller 5";}
if($p==="pr20") {$plan="99";$plandesc="Reseller 20";}
if($p==="pr50") {$plan="199";$plandesc="Reseller 50";}
if($p==="pd") {$plan="399";$plandesc="Dedicated";}

$bandwidth = "0";
if($b==="b0") $bandwidth = "0";
if($b==="b1") $bandwidth = "2";
if($b==="b5") $bandwidth = "10";
if($b==="b25") $bandwidth = "50";
if($b==="b75") $bandwidth = "100";
if($b==="b200") $bandwidth = "200";
if($b==="b500") $bandwidth = "400";
if($b==="b1200") $bandwidth = "600";

$diskspace = "0";
if($dk==="dk0") $diskspace = "0";
if($dk==="dk100") $diskspace = "2";
if($dk==="dk500") $diskspace = "10";
if($dk==="dk1000") $diskspace = "20";
if($dk==="dk4000") $diskspace = "60";

if($f==="y") {$diskspace = ($diskspace*12); $bandwidth = ($bandwidth*12); $plan = ($plan*12);}
if($f==="m") 
  {
  $domain = "2.09"; $plan = ($plan + 1.95);
  }
if ($d==="m") $domain="0";

$subtotal = $domain+$bandwidth+$diskspace+$plan;
$gst = "0";
$pst = "0";
if($tc==="on") 
  {
  $gst = $subtotal*0.07;
  if($tq==="on") $pst = ($subtotal+$gst)*0.075;
  }
?>

<!-- CALCULATE -->
<tr><td colspan="2" bgcolor="D6CA0D">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:605A00"><font size="5">5</font> 
    <? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?></font></b></td></tr>
    <tr><td colspan="2" bgcolor="F6F090">
    
    <table width="100%" border="0">
    <? if(isset($dn)) { ?>
    <tr><td><font size="1" face="tahoma,arial"><?= $dn . $tld ?> Domain Name</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$domain) ?></td>
    <tr><td><font size="1" face="tahoma,arial"><?= $plandesc ?> Plan</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$plan) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Diskspace</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$diskspace) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Bandwidth</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$bandwidth) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Subtotal</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$subtotal) ?></td>
    <tr><td><font size="1" face="tahoma,arial">GST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$gst) ?></td>
    <tr><td><font size="1" face="tahoma,arial">PST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$pst) ?></td>
    <?php $total = sprintf("%01.2f",($subtotal+$gst+$pst));?>
    <tr><td bgcolor="958D05" colspan="2"><table width="100%"><tr><td><font size="5" face="tahoma,arial" style="color:FFFFFF">Total</td><td align="right"><font size="5" face="tahoma,arial" style="color:FFFFFF"><?php echo "$".$total;?></td></tr></table></td>
    <tr><td colspan="2"><font size="1" face="tahoma,arial">Payable every <?= $frequency ?></td>
    <? } ?>
    <tr><td colspan="2" align="right"><font size="1"></font> <input type="submit" Value="<? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?>"></td></tr>
    </tr></table>    
          
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

<? if(isset($dn)) { ?>
<!-- CHECKOUT -->
<tr><td colspan="2" bgcolor="DAA552">
    <table width="100%" cellpading="0" valign="center">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:542410"><font size="5">6</font> Checkout</font></b></td></tr>
    <tr><td colspan="2" bgcolor="F4D7A9" align="right">
    
<?
$days="365";
$yahoof = "Y";
if($f==="m") {$days="30"; $yahoof="M";}

$company_id = "";

$paysystems = "https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?product1=" .
              $plandesc."-".$dn.$tld."-".$d."-".$p."-".$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";
 
$business_email = "";
              
$paypal = "https://www.paypal.com/subscriptions/business=" . $business_email . "&item_number=" .
          $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&no_note=1&currency_code=CAD&a3=" .
          $total . "&p3=1&t3=" . $yahoof . "&src=1&sra=1";
?>
<? if($dn != "") { ?>
<a href="<?= $paysystems ?>"><font face="tahoma,arial" color="000000" size="3"><b>PaySystems</b></font></a>
&nbsp;&nbsp;&nbsp;&nbsp; <b>or</b> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= $paypal ?>"><font face="tahoma,arial" color="000000" size="3"><b>PayPal</b></font></a>
<? } else { ?>
<font face="tahoma,arial" color="000000" size="3">
Please type in your <b>Domain Name</b> in section 1 above, and then click on Recalculate.
</font>
<? } ?>
</td></tr>
</table>
</td></tr>
<? } ?>
    
</table>
</font>
</form>
Return current item: QUICKLYWEB