<?
session_start ();
include "config.php";
$sql = mysql_query ( "SELECT * FROM offerpage LIMIT 1" );
$offer = mysql_fetch_array ( $sql );
if ($offer ['enable'] == 0) {
include "header.php";
include "style.php";
echo "<br><br><center>This Offer Is Disabled.</center><br><br>";
echo "<center>Continue To Members Area <a href='/members/index.php'>HERE</center><br><br>";
include "footer.php";
exit ();
}
$sql = mysql_query ( "SELECT * FROM members WHERE userid='" . $_SESSION [uname] . "'" );
if (! @mysql_num_rows ( $sql )) {
include "header.php";
include "style.php";
echo "<br><br><center>Invalid user.</center><br><br>";
include "footer.php";
exit ();
} else {
$user = mysql_fetch_array ( $sql );
if ($user ['viewed_offer'] == 1 and $offer ['enable'] == 2) {
include "header.php";
include "style.php";
echo "<br><br><center>You Can Only See This Offer Once.</center><br><br>";
echo "<center>Continue To Members Area <a href='/offerpage2.php'>HERE</center><br><br>";
include "footer.php";
exit ();
}
}
mysql_query ( "UPDATE members SET viewed_offer=1 WHERE userid='" . $_SESSION [uname] . "'" );
?><html>
<head>
<meta name="robots" content="noindex,nofollow">
<title>Special Offer</title>
<style>
<!--
BODY {
background-image: url(/images/bg.jpg);
#background-color: #800000;
background-repeat: repeat-A;
background-position: top;
background-attachment: fixed;
margin-top: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>
<br>
<body>
<center>
<TABLE width="790px" height="430" border="1" cellpadding="10"
cellspacing="10" bordercolor="#00008b" bgcolor="#FFFFFF">
<TR bgcolor="#FFFFFF">
<TD valign="top">     
<?
$query = "SELECT * FROM pages where name='Offer page'";
$result = mysql_query ( $query ) or die ( "Query failed" );
while ( $line = mysql_fetch_array ( $result ) ) {
$htmlcode = $line ["htmlcode"];
echo dbget($htmlcode);
}
?>	
<p>&nbsp;</p>
<center><font face="Verdana" color="#000000"></font>
<font face="Verdana" color="#000080">Get them today! They may be gone next time!</font>
<br><br>
<p align="center"><b><font face="Tahoma" size="4" color="#008000">MAKE SURE TO CLICK RETURN TO MERCHANT (<? echo $adminname; ?>)<br></font></font></b></p>&nbsp;<P align=center>

<table style="width: 80%; height: 100px" cellspacing="0" cellpadding="0" align="center">

<tr>
<? if($paypal<>"") { ?>

<td align="center">
<a href="offerpage_customize.php?id=<? echo $userid; ?>&type=paypal"><img src="images/PayPal_BuyNow.jpg" border=0></a>
</td>

<? } ?>

<?	if ($alertpay<>"") { ?>

<td align="center">

<a href="offerpage_customize.php?id=<? echo $userid; ?>&type=alertpay"><img src="images/payzapayment.jpg" border=0></a>

</td>

<? } if ($stripe<>"") { ?>
<td align="center">
<a href="offerpage_customize.php?id=<? echo $userid; ?>&type=stripe"><img src="images/ccbutton.jpg" border=0></a>
</td>

<? 

}

?>
</tr>
</table>
</center></p>

<p align="center"><font face="verdana" size="2">
<span style="background-color: #FFFF00"><b>**Do Not Forget To Click &quot;Return To Merchant (<? echo $adminname; ?>)&quot; After Payment**</b></span></p>
</font><font face="verdana" size="2">
</p>
<?

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

if($offer['enable']==1 OR ($offer['enable']==2 AND $userrecord['viewed_offer2']==0)) {
if($offer['memtype'] == $memtype OR $offer['memtype'] == "ALL") $url = 'offerpage2.php';
else $url = 'members/index.php';



} else $url = 'members/fulllogin_frame.php';

if($url == $domain.'/members/index.php' AND $userreccord['fulllogin_viewed']!=date('Y-m-j') AND $fullloginurl!=""){
$url = $domain.'/members/fulllogin_frame.php';
}
?>
<center><font face="Verdana" color="#000080">If you are not interested, click the link below.
<br></br><a href="<? echo $url; ?>"><font face="Verdana" color="#0000ff">No, thanks. Just send me to <? echo $sitename; ?> Member's Area.</a></font></font></center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>
<br>
<?
mysql_close();
?>