/
Website_page.php
221 lines (205 loc) · 9.56 KB
/
Website_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
require ("path.php");
require (PATH."include/include.php");
//*************************************************************************************************
include ("public_session.php");
//*************************************************************************************************
$wuserId = $_GET['wuserId'];
$pageId = $_GET['pageId'];
if ( $pageId == '' )
{
$pageId = getColumn("USER_WEBSITE", $wuserId, "ID", "USERID");
}
if ( $pageId == '' )
{
header("Location:index.php?info=".urlencode('Please select a website to see ads.'));
die;
}
//*************************************************************************************************
if ( !($recWebsite = getRecord("USER_WEBSITE", $pageId)) )
{
header("Location:index.php?info=".urlencode('Website not found. Error Code - 02 -'));
die;
}
$wuserId = $recWebsite['USERID'];
//*************************************************************************************************
if ( !($recUser = getRecord("USER", $wuserId, "USERID")) )
{
header("Location:index.php?info=".urlencode('Website not found. Error Code - 01 -'));
die;
}
//*************************************************************************************************
include ("header.php");
//*************************************************************************************************
?>
<p align="left"><span class="style11 style7"><strong>Advertise on <?=$recWebsite['WEBSITE_NAME']?></strong></span></p>
<p align="right"><strong><span class="style6 style22"><?=$recWebsite['WEBSITE_NAME']?></span></strong></p>
<table width="100%" border="0">
<tr>
<td width="38%"><img src="thumbnail.php?url=<?=urlencode($recWebsite['WEBSITE_URL'])?>" alt="" width="160" height="120"></td>
<td colspan="2">
<div class="buy-area-call-to-action">
<table width="240" border="0" align="center" cellpadding="0" cellspacing="0" class="buy-area-call-to-action-main-table" id="producttable">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form name="F" method=get action="<?=$ROOT?>buy_ad.php">
<!-- <input type="hidden" name="return" value="<?=$ROOT?>website_page.php?pageId=<?=$pageId?>&"> -->
<script language="JavaScript">var detailsforproductcpc = '<br/><br/><p></p>';var detailsforproductppi = ' ';</script>
<?
$defAd = array();
$result = executeQuery("SELECT * FROM ".PREFIX."USER_AD_PRODUCT WHERE WEBSITE_ID='".$pageId."' AND ISVALID='Y'");
$count = 0;
while ( $row = getRow($result) )
{
$count++;
$defAd = empty($defAd) ? $row : $defAd;
?>
<script type="text/javascript">var detailsforproduct<?=$count?> = ' <p><strong>Next Ad Available:</strong> <?=formatDate(getSellerNextAdAvailableOn($pageId))?> </p> <p>Get your ad on <strong><?=str_replace("'", "\'", $recWebsite['WEBSITE_NAME'])?></strong> for <?=$row['DURATION']==0?$DOLLAR.$row['COST'].' per click':$row['DURATION'].' full day(s)'?>. </p> <p><strong>Days: </strong><?=$row['DURATION']==0?'Variable':$row['DURATION']?><strong><br> <?=$row['DURATION']==0?'Set Amount of Clicks: </strong>Your Choice':('Average '.($row['DURATION']==30?"Monthly":($row['DURATION']==7?"Weekly":($row['DURATION']==1?"Daily":$row['DURATION']." Day"))).' Clicks: </strong> '.(round(getAvgCPD($pageId, $row['ID'])*$row['DURATION'], 2)))?><br> <strong><?=$row['DURATION']==0?'Set Cost Per Click: </strong>'.$currencySymbol.number_format($currencyRate*$row['COST'], 2):'Average Cost Per Click: </strong>'.$currencySymbol.number_format($currencyRate*getAvgCPC($pageId), 2)?><br> </p> ';</script>
<?
if ( $defAd['ID'] == $row['ID'] )
{
?>
<script type="text/javascript">var activetr = 'product<?=$count?>'; var defaultdetails = detailsforproduct<?=$count?>;</script>
<?
}
?>
<tr class="" id="product<?=$count?>" onmouseover="document.getElementById(activetr).className = ''; document.getElementById('product<?=$count?>').className='buy-area-call-to-action-on'; document.getElementById('productdetails').innerHTML = detailsforproduct<?=$count?>;" onmouseout="document.getElementById(activetr).className = 'buy-area-call-to-action-on';if(activetr != 'product<?=$count?>') {document.getElementById('product<?=$count?>').className=''}; document.getElementById('productdetails').innerHTML = defaultdetails;">
<td width="14%" class="buy-area-call-to-action-choose"><input name="productId" type="radio" value="<?=$row['ID']?>" <?=$defAd['ID'] == $row['ID'] ? "checked" : ""?> onclick="document.getElementById(activetr).className=''; activetr='product<?=$count?>'; defaultdetails = detailsforproduct<?=$count?>;" id="product1radio"></td>
<td width="50%" class="buy-area-call-to-action-description"><?=$row['TITLE']?></td>
<td width="36%" class="buy-area-call-to-action-price"><?=$currencySymbol.number_format($currencyRate*$row['COST'], 2)?></td>
</tr>
<?
}
?>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="2"><!-- <span class="buy-area-call-to-action-description"><strong>Change Currency: </strong><br>
<? if ( $currencySymbol == $DOLLAR ) {?>
<a href="<?=$ROOT."currency.php?c=USD&r=website_page.php?pageId=".$pageId?>">Show Prices as $</a>
<? } else { ?>
<a href="<?=$ROOT."currency.php?c=GBP&r=website_page.php?pageId=".$pageId?>">Show Prices as £</a>
<? } ?>
</span> --></td>
<td align="left">
<input type="image" src="<?=$ROOT?>images/buy.gif" name="buy" alt="" width="76" height="32"> </td>
</tr>
</form>
</table> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td width="48%" rowspan="7" class="buy-area-call-to-action-details">
<div id="productdetails">
<p align="left"><strong>Next Ad Available:</strong> <?=formatDate(getSellerNextAdAvailableOn($pageId))?></p>
<p align="left">Get your ad on <strong><?=$recWebsite['WEBSITE_NAME']?></strong> for <?=$defAd['DURATION']?> full day(s).</p>
<p align="left"><strong>Days: </strong><?=$defAd['DURATION']==0?'Variable':$defAd['DURATION']?><strong><br>
<? if ( $defAd['DURATION'] == 0 ) { ?>
Set Amount of Clicks: </strong> Your Choice<br>
<strong>Set Cost Per Click: </strong><?=$currencySymbol.number_format($currencyRate*$defAd['COST'], 2)?><br>
<? } else { ?>
Average <?=($defAd['DURATION']==30?"Monthly":($defAd['DURATION']==7?"Weekly":($defAd['DURATION']==1?"Daily":$defAd['DURATION']." Day")))?> Clicks: </strong> <?=round(getAvgCPD($pageId, $defAd['ID'])*$defAd['DURATION'], 2)?><br>
<strong>Average Cost Per Click: </strong><?=$currencySymbol.number_format($currencyRate*getAvgCPC($pageId), 2)?><br>
<? } ?>
</p>
</div> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<span class="style22 style6"><strong><?=$recWebsite['WEBSITE_NAME']?> Website Stats </strong></span></div> </td>
</tr>
<tr>
<td> </td>
<td width="14%"> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Alexa Ranking: </strong> <?=$recWebsite['ALEXA_RANKING']==0?'n/a':$recWebsite['ALEXA_RANKING']?></div> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Google Page Rank: </strong> <?=getGooglePageRank($recWebsite['WEBSITE_URL'])?></div> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Pageviews Per Day: </strong> <?=getAvgImpressionsForSeller($pageId)?></div> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Daily Unique Users:</strong> <?=getAvgUniqueUsersForSeller($pageId)?></div> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Average CPC: </strong> <?=$currencySymbol.number_format($currencyRate*getAvgCPC($pageId), 2)?></div> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<div align="left">
<strong>Member Since:</strong> <?=formatDateTime($recUser['REGISTERATION_DATE'], 'dS F Y')?></div> </td>
<td>
<div align="left">
<strong>Click Through Stat: </strong></div> </td>
</tr>
<tr>
<td>
<div align="left">
<a href="<?=$recWebsite['WEBSITE_URL']?>"><?=$recWebsite['WEBSITE_URL']?></a></div> </td>
<td></td>
<td>
<? if ( $rowHCIAD = getHighestClickthroughsSentInADayForSeller($pageId) ) { ?>
<div align="left">
On the <?=formatDateTime($rowHCIAD['CLICK_DATE'], 'dS F Y')?>, <strong><?=$recWebsite['WEBSITE_NAME']?></strong> sent <strong><?=$rowHCIAD['C']?></strong> users to one advertiser.</div>
<? } ?> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<div align="left">
<strong>Website Owners Description: </strong></div> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="3">
<?=nl2br($recWebsite['DESCRIPTION'])?> </td>
</tr>
<? if ( $recWebsite['WEBSITE_TAGS'] != '' ) { ?>
<tr>
<td colspan="3" align="right">
<span style="color: #b5b2b2">
<b>Website Tags:</b><br><br>
<?
$tagcount = 0;
$arrTags = split(',', $recWebsite['WEBSITE_TAGS']);
foreach ( $arrTags as $tag )
{
if ( $tagcount++ >= 10 ) break;
echo $tag.' ';
}
?>
</span> </td>
</tr>
<? } ?>
</table>
<?
//*************************************************************************************************
include ("footer.php");
//*************************************************************************************************
?>