<?php
include 'inc/sqlinf.php';
$package = $_POST['hp'];
$domain = $_POST['domain'];
$un = $_POST['un'];
$pw = $_POST['pw'];
$email = $_POST['email'];
$billing = $_POST['billing'];
$id = $_POST['id'];

$chars = "abcdefghijklmnopqrstuvwxyz";
$len = strlen($chars);
mt_srand((double)microtime() * 1000000);
for ($i = 0; $i < 5; $i++)
{
    $randomize = mt_rand(0, $len);
    $unique .= $chars{$randomize};
}

$SQL = "SELECT * from SETTINGS";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
include 'admin/query.php';}

$SQL = "SELECT * from HOSTINGPACKAGES WHERE WHMNAME='$package'";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
include 'admin/query.php';}

if ($billing == 'Monthly') {$price = $monthly; $i='1'; $o='M';} else {}
if ($billing == 'Quarterly') {$price = $quarterly; $i='3'; $o='M';} else {}
if ($billing == 'Semi-Annually') {$price = $semiannually; $i='6'; $o='M';} else {}
if ($billing == 'Annually') {$price = $annually; $i='1'; $o='Y';} else {}
if ($billing == '2Years') {$price = $twoyears; $i='2'; $o='Y';} else {}
$pkg = $whmname;
$t = $name;
$u = $id;
?>
<html>
<head>
<title>Hosting Order Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include 'inc/apple.inc'; ?>

</head>

<body bgcolor="#FFFFFF" text="#000000">
<div align="center"><br>
  <table border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td width="17" bgcolor="#333333" background="img/tl.jpg"></td>
          <td height="17" background="img/shgt.jpg"></td>
          <td width="7" bgcolor="#333333" background="img/tr.jpg"></td>
        </tr>
        <tr>
          <td width="7" background="img/svgl.jpg"></td>
          <td bgcolor="#FFFFFF">
                <table border="5" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF" width="100%">
                  <tr>
                        <td valign="top" bgcolor="#FFFFFF">
                          <div align="center"><b>Your Hosting Company</b><br>
                                Complete Your Order</div>
                        </td>
                        <td valign="top">&nbsp; </td>
                  </tr>
                </table>
          </td>
          <td width="17" background="img/svgr.jpg"></td>
        </tr>
        <tr>
          <td width="7" bgcolor="#333333" background="img/bl.jpg"></td>
          <td height="17" background="img/shg.jpg"></td>
          <td width="7" bgcolor="#333333" background="img/br.jpg"></td>
        </tr>
  </table>
</div>
<form name="form1" method="post" action="https://www.paypal.com/cgi-bin/webscr">
  <table border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td width="17" bgcolor="#333333" background="img/tl.jpg"></td>
          <td height="17" background="img/shgt.jpg"></td>
          <td width="7" bgcolor="#333333" background="img/tr.jpg"></td>
        </tr>
        <tr>
          <td width="7" background="img/svgl.jpg"></td>
          <td bgcolor="#FFFFFF">

                <table border="5" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">
                  <tr>
                        <td valign="top" bgcolor="#FFFFFF">

                          <table border="5" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" bordercolor="#FFFFFF" align="center" background="img/g.jpg">
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b><font color="#000000"> Username</font></b></td>
                                  <td bgcolor="#F9F9F9">
                                        <?php echo $un; ?>
                                        <input type="hidden" name="un" value="<?php echo $un; ?>">
                                  </td>
                                </tr>
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b><font color="#000000">Email Address<font color="#F9F9F9">-</font>
                                        </font></b></td>
                                  <td bgcolor="#F9F9F9">
                                        <?php echo $email; ?>
                                        <input type="hidden" name="email" value="<?php echo $email; ?>">
                                  </td>
                                </tr>
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b><font color="#000000">Package </font></b></td>
                                  <td bgcolor="#F9F9F9">
                                        <?php echo $name; ?>
                                        <font color="#000000"><font color="#F9F9F9">-</font></font>
                                        <input type="hidden" name="hp" value="<?php echo $whmname; ?>">
                                  </td>
                                </tr>
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b><font color="#000000">Password</font></b></td>
                                  <td bgcolor="#F9F9F9">
                                        <?php echo $pw; ?>
                                        <input type="hidden" name="pw" value="<?php echo $pw; ?>">
                                  </td>
                                </tr>
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b><font color="#000000">Domain</font></b></td>
                                  <td bgcolor="#F9F9F9">
                                        <?php echo $domain;?>
                                        <input type="hidden" name="domain" value="<?php echo $domain; ?>">
                                  </td>
                                </tr>
                                <tr bgcolor="#F9F9F9" valign="middle">
                                  <td bgcolor="#F9F9F9"><b>Billing Cycle</b></td>
                                  <td bgcolor="#F9F9F9"><font color="#000000">
                                        <?php echo "$price | $billing"; ?>
                                        </font></td>
                                </tr>
                          </table>
                        </td>
                  </tr>
                  <tr>

                        <td valign="top" bgcolor="#FFFFFF"><br>
                          <div align="center"><b><font color="#FFFFFF">
                                <input type="submit" style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; background-color: #FCFCFC;" name="&raquo; Paypal Checkout" value="&raquo; Paypal Checkout">
                                </font></b></div>
                        </td>
                  </tr>
                </table>
          </td>
          <td width="17" background="img/svgr.jpg"></td>
        </tr>
        <tr>
          <td width="7" bgcolor="#333333" background="img/bl.jpg"></td>
          <td height="17" background="img/shg.jpg"></td>
          <td width="7" bgcolor="#333333" background="img/br.jpg"></td>
        </tr>
  </table>

<?php
$SQL = "SELECT * from SETTINGS";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
include 'admin/query.php';}
?>
  <div align="center">
        <p align="right"><font color="#CCCCCC"><br>
          <font color="#cccccc">Powered by <font color="#cccccc">Auto-Host
          2 </font></font></font>
          <input type="hidden" name="bn" value="mirndtsoft-autohost">
          <input type="hidden" name="cmd" value="_xclick-subscriptions">
          <input type="hidden" name="rm" value="1">
          <input type=hidden name=business value=<?php echo $receiver_email; ?>>
          <input type=hidden name=item_name value="<?php echo $t; ?>">
          <input type=hidden name=item_number value="<?php echo $unique; ?>">
          <input type=hidden name=currency_code value=<?php echo $currency; ?>>
          <input type=hidden name=image_url value=<?php echo $logo_url; ?>>
          <input type=hidden name=return value=<?php echo $success_url; ?>>
          <input type=hidden name=cancel_return value=<?php echo $cancel_url; ?>>
          <input type=hidden name=custom>
          <?php if ($freetrial == freetrial) { ?>
          <input type="hidden" name="a1" value="0.00">
          <input type="hidden" name="p1" value="<?php echo $yy; ?>">
          <input type="hidden" name="t1" value="<?php echo $nn; ?>">
          <?php }else{} ?>
          <input type="hidden" name="a3" value="<?php echo $price; ?>">
          <input type="hidden" name="p3" value="<?php echo $i; ?>">
          <input type="hidden" name="t3" value="<?php echo $o; ?>">
          <input type="hidden" name="no_shipping" value="1">
          <input type="hidden" name="src" value="1">
          <input type="hidden" name="sra" value="1">
          <input type="hidden" name="notify_url" value="<?php echo $url; ?>ipn/ahipn.php?un=<?php echo $un; ?>&amp;email=<?php echo $email; ?>&amp;package=<?php echo $pkg; ?>&amp;pw=<?php echo $pw; ?>&amp;domain=<?php echo $domain; ?>&id=<?php echo $u; ?>">
        </p>
  </div>
</form>
</body>
</html>

