<?
include "config.php";
?>
<html>

<head><meta name="robots" content="noindex,nofollow">
<title>Offer Page 2</title>

<style>



<!--
BODY {
background-image: url(/images/bg.jpg);
background-repeat:repeat-x;
background-position:top;
background-attachment:fixed;
margin-top: 0px;
margin-bottom: 0px;
}
--></style>

</head>
<center>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table width="700" style="border: 3px dashed black" align="center" cellpadding="10" cellspacing="0" bgcolor="#ffffff">
<tr>
<td align="center"><p>&nbsp;</p>
<img src="images/customize.png" width="725" height="500" alt="" border="0">

<?
$sql = mysql_query("SELECT * FROM offerpage2 LIMIT 1");
$offer = mysql_fetch_array($sql);

if($_POST['type']) {
echo "<center><br><br>";
$options = "";
$price = $offer['price'];


if($_POST['upgrade1_qty']) {
$options .= $_POST['upgrade1_qty']." Upgrade 1/ ";
$price = $price + $_POST['upgrade1_qty'] * $offer['upgrade1_price'];
}
if($_POST['upgrade2_qty']) {
$options .= $_POST['upgrade2_qty']." Upgrade 2/ ";
$price = $price + $_POST['upgrade2_qty'] * $offer['upgrade2_price'];
}
if($_POST['upgrade3_qty']) {
$options .= $_POST['upgrade3_qty']." Upgrade 3/ ";
$price = $price + $_POST['upgrade3_qty'] * $offer['upgrade3_price'];
}
if($_POST['upgrade4_qty']) {
$options .= $_POST['upgrade4_qty']." Upgrade 4/ ";
$price = $price + $_POST['upgrade4_qty'] * $offer['upgrade4_price'];
}
if($_POST['upgrade5_qty']) {
$options .= $_POST['upgrade5_qty']." Upgrade 5/ ";
$price = $price + $_POST['upgrade5_qty'] * $offer['upgrade5_price'];
}	
if($_POST['upgrade6_qty']) {
$options .= $_POST['upgrade6_qty']." Upgrade 6/ ";
$price = $price + $_POST['upgrade6_qty'] * $offer['upgrade6_price'];
}
if($_POST['upgrade7_qty']) {
$options .= $_POST['upgrade7_qty']." Upgrade 7/ ";
$price = $price + $_POST['upgrade7_qty'] * $offer['upgrade7_price'];
}
if($_POST['upgrade8_qty']) {
$options .= $_POST['upgrade8_qty']." Upgrade 8/ ";
$price = $price + $_POST['upgrade8_qty'] * $offer['upgrade8_price'];
}
if($_POST['upgrade9_qty']) {
$options .= $_POST['upgrade9_qty']." Upgrade 9/ ";
$price = $price + $_POST['upgrade9_qty'] * $offer['upgrade9_price'];
}
if($_POST['upgrade10_qty']) {
$options .= $_POST['upgrade10_qty']." Upgrade 10/ ";
$price = $price + $_POST['upgrade10_qty'] * $offer['upgrade10_price'];
}

if(strlen($options)>1) $options = "- ".substr($options,0,-2)." ";





if($_POST['type']=="paypal") {

?>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<? echo $paypal; ?>">
<input type="hidden" name="item_name" value="<? echo $sitename; ?> Special Offer #2 <? echo $options."- ".$_POST['id']; ?>">
<input type="hidden" name="amount" value="<? echo $price; ?>">
<input type="hidden" name="page_style" value="PayPal">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="<? echo $domain; ?>/members/advertise.php">
<input type="hidden" name="cancel_return" value="<? echo $domain; ?>/">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="on0" value="User ID">
<input type="hidden" name="os0" value="<? echo $_POST['id']; ?>">
<input type="hidden" name="notify_url" value="<? echo $domain; ?>/offer2ipn.php">
<input type="image" src="<? echo $domain; ?>/images/paypal.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>	



<?

} elseif($_POST['type']=="alertpay") {

?>
<form method="post" action="https://www.alertpay.com/PayProcess.aspx" > 
<input type="hidden" name="ap_purchasetype" value="item"/> 
<input type="hidden" name="ap_merchant" value="<? echo $alertpay; ?>"/> 
<input type="hidden" name="ap_currency" value="USD"/> 
<input type="hidden" name="ap_returnurl" value="<? echo $domain; ?>/members/advertise.php"/>  
<input type="hidden" name="ap_itemname" value="<? echo $sitename; ?> Special Offer #2 <? echo $options."- ".$_POST['id']; ?>"/> 
<input type="hidden" name="ap_itemcode" value="<? echo $sitename; ?> Special Offer #2"/> 
<input type="hidden" name="ap_quantity" value="1"/> 
<input type="hidden" name="ap_amount" value="<? echo $price; ?>"/> 
<input type="hidden" name="apc_1" value="<? echo $_POST['id']; ?>"> 
<input type="image" name="ap_image" src="https://www.alertpay.com/Images/BuyNow/big_pay_03.gif"/> 
</form>

<?

} elseif($_POST['type']=="stripe") {
?>
<form action="<? echo $stripeurl; ?>/ccpayp.php" method="post" target="_top">
<input type="hidden" name="item" value="4">
<input type="hidden" name="userid" value="<? echo $_POST['id']; ?>">
<input type="hidden" name="amount" value="<? echo $price; ?>">
<input type="hidden" name="description" value="<? echo $sitename; ?> Special Offer #2 <? echo $options."- ".$_POST['id']; ?>">
<input type="image" src="/images/ccbutton.jpg" style="cursor: pointer;" border="0" name="submit" alt="Pay by Credit Card">
</form></a>  



<?

}

echo "</center>";	


} else {

$query = "SELECT * FROM pages where name='Offer Page 2'";
$result = mysql_query ($query)
or die ("Query failed");
while ($line = mysql_fetch_array($result)) {
$htmlcode = $line["htmlcode"];
echo dbget($htmlcode);
}
?>

<script type="text/javascript">
function updatetotal(form) {

document.getElementById("total").innerHTML = (<? echo $offer['price']; ?> + form.upgrade1_qty.value * <? echo $offer['upgrade1_price']; ?> + form.upgrade2_qty.value * <? echo $offer['upgrade2_price']; ?> + form.upgrade3_qty.value * <? echo $offer['upgrade3_price']; ?> + form.upgrade4_qty.value * <? echo $offer['upgrade4_price']; ?> + form.upgrade5_qty.value * <? echo $offer['upgrade5_price']; ?> + form.upgrade6_qty.value * <? echo $offer['upgrade6_price']; ?> + form.upgrade7_qty.value * <? echo $offer['upgrade7_price']; ?> + form.upgrade8_qty.value * <? echo $offer['upgrade8_price']; ?> + form.upgrade9_qty.value * <? echo $offer['upgrade9_price']; ?> + form.upgrade10_qty.value * <? echo $offer['upgrade10_price']; ?>);
return 1;

}

</script>



<!--form name="customize" onchange="updatetotal()" method="post"-->
<form onchange="updatetotal(this)" method="post">    
<input type="hidden" name="type" value="<? echo $_GET['type']; ?>">
<input type="hidden" name="id" value="<? echo $_GET['id']; ?>">
<center>

<br><br>

<table><tr><th>Upgrade Options</th><th>Quantity</th></tr>

<tr><td>Add <? echo $offer['upgrade1_points']; ?> Points <? echo $offer['upgrade1_text']; ?> ($<? echo $offer['upgrade1_price']; ?>)</td><td><input type="text" name="upgrade1_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade2_solos']; ?> Solo Ad <? echo $offer['upgrade2_text']; ?> ($<? echo $offer['upgrade2_price']; ?>)</td><td><input type="text" name="upgrade2_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade3_banners']; ?> Banner with <? echo $offer['upgrade3_views']; ?> Views <? echo $offer['upgrade3_text']; ?> ($<? echo $offer['upgrade3_price']; ?>)</td><td><input type="text" name="upgrade3_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade4_traffic']; ?> Traffic Link with <? echo $offer['upgrade4_views']; ?> Views <? echo $offer['upgrade4_text']; ?> ($<? echo $offer['upgrade4_price']; ?>)</td><td><input type="text" name="upgrade4_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade5_login']; ?> Login Ad with <? echo $offer['upgrade5_views']; ?> Views <? echo $offer['upgrade5_text']; ?> ($<? echo $offer['upgrade5_price']; ?>)</td><td><input type="text" name="upgrade5_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade6_hotlink']; ?> Hot Link Ad with <? echo $offer['upgrade6_views']; ?> Views <? echo $offer['upgrade6_text']; ?> ($<? echo $offer['upgrade6_price']; ?>)</td><td><input type="text" name="upgrade6_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade7_button']; ?> Button Ad with <? echo $offer['upgrade7_views']; ?> Views <? echo $offer['upgrade7_text']; ?> ($<? echo $offer['upgrade7_price']; ?>)</td><td><input type="text" name="upgrade7_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade8_headline']; ?> Headline Ad with <? echo $offer['upgrade8_views']; ?> Views <? echo $offer['upgrade8_text']; ?> ($<? echo $offer['upgrade8_price']; ?>)</td><td><input type="text" name="upgrade8_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade9_ptc']; ?> PTC Ads <? echo $offer['upgrade9_text']; ?> ($<? echo $offer['upgrade9_price']; ?>)</td><td><input type="text" name="upgrade9_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td>Add <? echo $offer['upgrade10_cashsolos']; ?> Cash Solo Ad <? echo $offer['upgrade10_text']; ?> ($<? echo $offer['upgrade10_price']; ?>)</td><td><input type="text" name="upgrade10_qty" value="0" onchange="updatetotal()"></td></tr>

<tr><td align=right><b>Total:</td><td>$<span id="total"><? echo $offer['price']; ?></b></span></td></tr>

</table>

<br><input type=submit value="Confirm Your Order">
</form>



<?

}

?>
</font></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
<?
mysql_close();
?>