Subversion Repositories cheapmusic

Rev

Rev 103 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
$borderCollapseVal = $pdfVersion ? "border-collapse: collapse;" : "";
3
$hrefAttr = $pdfVersion ? "" : "href='javascript:void(0)'";
4
 
5
if(!empty($printVersion) || !empty($pdfVersion)) {
6
    $doPrint = empty($cronUserId) ? true : false;
7
    $pdfVersion ? showPdfHeader($sectionHead) : showPrintHeader($sectionHead, $doPrint);
8
    ?>
9
    <table class="search">
10
    	<?php if (!empty($websiteUrl)) {?>
11
    		<tr>
12
    			<th><?php echo $spText['common']['Website']?>:</th>
13
        		<td>
14
        			<?php echo $websiteUrl; ?>
15
    			</td>
16
    		</tr>
17
		<?php }?>
18
		<tr>
19
			<th><?php echo $spText['common']['Period']?>:</th>
20
    		<td>
21
    			<?php echo $fromTime?> - <?php echo $toTime?>
22
			</td>
23
		</tr>
24
	</table>
25
<?php } else {?>
26
	<?php echo showSectionHead($sectionHead); ?>
27
	<form id='search_form'>
28
	<table width="100%" class="search">
29
		<tr>
30
			<th><?php echo $spText['common']['Name']?>: </th>
31
			<td>
32
				<input type="text" name="search_name" value="<?php echo htmlentities($searchInfo['search_name'], ENT_QUOTES)?>" onblur="<?php echo $submitLink?>">
33
			</td>
34
			<th><?php echo $spText['common']['Period']?>:</th>
35
    		<td colspan="2">
155 - 36
    			<input type="text" value="<?php echo $fromTime?>" name="from_time" id="from_time_summary"/>
37
    			<input type="text" value="<?php echo $toTime?>" name="to_time" id="to_time_summary"/>
103 - 38
				<script>
39
				  $( function() {
155 - 40
				    $( "#from_time_summary, #to_time_summary").datepicker({dateFormat: "yy-mm-dd"});
103 - 41
				  } );
42
			  	</script>
43
    		</td>
44
    	<tr>
45
    	<tr>
46
		    <th><?php echo $spText['common']['Website']?>: </th>
47
			<td>
48
    			<select name="website_id" id="website_id"  onchange="scriptDoLoadPost('archive.php', 'search_form', 'content')" style="width: 180px;">
49
    				<option value="">-- <?php echo $spText['common']['Select']?> --</option>
50
    				<?php foreach($siteList as $websiteInfo){?>
51
    					<?php if($websiteInfo['id'] == $websiteId){?>
52
    						<option value="<?php echo $websiteInfo['id']?>" selected><?php echo $websiteInfo['name']?></option>
53
    					<?php }else{?>
54
    						<option value="<?php echo $websiteInfo['id']?>"><?php echo $websiteInfo['name']?></option>
55
    					<?php }?>
56
    				<?php }?>
57
    			</select>
58
			</td>
59
			<th><?php echo $spText['label']['Report Type']?>: </th>
60
			<td>
61
				<select name="report_type" id="report_type" onchange="scriptDoLoadPost('archive.php', 'search_form', 'content')" style="width: 210px;">
62
					<option value="">-- <?php echo $spText['common']['Select']?> --</option>
63
    				<?php foreach($reportTypes as $type => $info){?>
64
						<?php if($type == $searchInfo['report_type']){?>
65
							<option value="<?php echo $type?>" selected><?php echo $info?></option>
66
						<?php }else{?>
67
							<option value="<?php echo $type?>"><?php echo $info?></option>
68
						<?php }?>
69
					<?php }?>
70
				</select>
71
				<a href="javascript:void(0);" onclick="scriptDoLoadPost('archive.php', 'search_form', 'content')" class="actionbut"><?php echo $spText['button']['Search']?></a>
72
			</td>
73
		</tr>
74
	</table>
75
	<br>
76
	</form>
77
	<?php
78
	// url parameters
79
	$mainLink = SP_WEBPATH."/archive.php?$urlarg";
80
	$directLink = $mainLink . "&order_col=$orderCol&order_val=$orderVal&pageno=$pageNo";
81
 
82
	// export links
83
	$pdfLink = "$directLink&doc_type=pdf";
84
	$csvLink = "$directLink&doc_type=export";
85
	$printLink = "$directLink&doc_type=print";
86
	showExportDiv($pdfLink, $csvLink, $printLink);
87
	?>
88
<?php }?>
89
 
90
<div id='subcontent' class="dashboard">
91
<?php
92
$seCount = count($seList);
93
if (!empty($keywordPos) && !empty($seCount)) {
94
	$colCount = empty($websiteId) ? ($seCount * 3) + 2 : ($seCount * 3) + 1;
95
	?>
96
	<br>
97
	<div class="table-responsive">
98
	<?php
99
	echo showSectionHead($spTextTools['Keyword Position Summary']);
100
	if (empty($pdfVersion)) echo $keywordPagingDiv;
101
	?>
102
	<table id="cust_tab">
103
		<tr>
104
			<?php
105
			$linkClass = "";
106
	        if ($orderCol == 'keyword') {
107
	            $oVal = ($orderVal == 'DESC') ? "ASC" : "DESC";
108
	            $linkClass .= "sort_".strtolower($oVal);
109
	        } else {
110
	            $oVal = 'ASC';
111
	        }
112
 
113
	        $hrefAttr = $pdfVersion ? "" : "href='javascript:void(0)'";
114
 
115
			$linkName = "<a id='sortLink' class='$linkClass' $hrefAttr onclick=\"scriptDoLoad('$mainLink&order_col=keyword&order_val=$oVal', 'content')\">{$spText['common']['Keyword']}</a>";
116
			?>
117
			<?php if (empty($websiteId)) {?>
118
				<th id="head" rowspan="2"><?php echo $spText['common']['Website']?></th>
119
				<th rowspan="2" id="head"><?php echo $linkName?></th>
120
			<?php } else { ?>
121
				<th id="head" rowspan="2" style="border-right:1px solid #B0C2CC;"><?php echo $linkName?></th>
122
			<?php }?>
123
			<?php
124
			foreach ($seList as $i => $seInfo){
125
 
126
			    $linkClass = "";
127
	            if ($seInfo['id'] == $orderCol) {
128
	                $oVal = ($orderVal == 'DESC') ? "ASC" : "DESC";
129
	                $linkClass .= "sort_".strtolower($oVal);
130
	            } else {
131
	                $oVal = 'ASC';
132
	            }
133
	            $linkName = "<a id='sortLink' class='$linkClass' $hrefAttr onclick=\"scriptDoLoad('$mainLink&order_col={$seInfo['id']}&order_val=$oVal', 'content')\">{$seInfo['domain']}</a>";
134
			    ?>
135
				<th id="head" colspan="3"><?php echo $linkName; ?></th>
136
				<?php
137
			}
138
			?>
139
		</tr>
140
		<tr>
141
			<?php
142
			$pTxt = str_replace("-", "/", substr($fromTime, -5));
143
			$cTxt = str_replace("-", "/", substr($toTime, -5));
144
			foreach ($seList as $i => $seInfo) {
145
				?>
146
				<th><?php echo $pTxt; ?></th>
147
				<th><?php echo $cTxt; ?></th>
148
				<th>+ / -</th>
149
				<?php
150
			}
151
			?>
152
		</tr>
153
		<?php
154
		if (count($list) > 0) {
155
			foreach($indexList as $keywordId => $rankValue){
156
			    $listInfo = $list[$keywordId];
157
				$positionInfo = $listInfo['position_info'];
158
	            $rangeFromTime = date('Y-m-d', strtotime('-14 days', strtotime($fromTime)));
159
	            $scriptLink = "website_id=$websiteId&keyword_id={$listInfo['id']}&rep=1&from_time=$rangeFromTime&to_time=$toTime";
160
				?>
161
				<tr>
162
					<?php if (empty($websiteId)) {?>
163
						<td><a href="javascript:void(0)"><?php echo $listInfo['weburl']; ?></a></td>
164
						<td><?php echo $listInfo['name'] ?></td>
165
					<?php } else { ?>
166
						<td><?php echo $listInfo['name']; ?></td>
167
					<?php }?>
168
					<?php
169
					foreach ($seList as $index => $seInfo){
170
						$rankInfo = $positionInfo[$seInfo['id']];
171
						$prevRank = isset($rankInfo[$fromTime]) ? $rankInfo[$fromTime] : "";
172
						$currRank = isset($rankInfo[$toTime]) ? $rankInfo[$toTime] : "";
173
						$rankDiffTxt = "";
174
 
175
						// if both ranks are existing
176
						if ($prevRank != '' && $currRank != '') {
177
							$rankDiff = $prevRank - $currRank;
178
 
179
							if ($rankDiff > 0) {
180
								$rankDiffTxt = "<font class='green'>($rankDiff)</font>";
181
							} else if ($rankDiff < 0) {
182
								$rankDiffTxt = "<font class='red'>($rankDiff)</font>";
183
							} else {
184
								$rankDiffTxt = "0";
185
							}
186
						}
187
 
188
						$prevRankLink = scriptAJAXLinkHrefDialog('reports.php', 'content', $scriptLink."&se_id=".$seInfo['id'], $prevRank);
189
						$currRankLink = scriptAJAXLinkHrefDialog('reports.php', 'content', $scriptLink."&se_id=".$seInfo['id'], $currRank);
190
						$graphLink = scriptAJAXLinkHrefDialog('graphical-reports.php', 'content', $scriptLink."&se_id=".$seInfo['id'], '&nbsp;', 'graphicon');
191
 
192
						// if pdf report remove links
193
						if ($pdfVersion) {
194
							$prevRankLink = str_replace("href='javascript:void(0);'", "", $prevRankLink);
195
							$currRankLink = str_replace("href='javascript:void(0);'", "", $currRankLink);
196
							$graphLink = str_replace("href='javascript:void(0);'", "", $graphLink);
197
						}
198
 
199
						$diffOut = empty($cronUserId) ? $graphLink . " " . $rankDiffTxt : $rankDiffTxt;
200
					    ?>
201
						<td><?php echo $prevRankLink; ?></td>
202
						<td><?php echo $currRankLink; ?></td>
203
						<td><?php echo $diffOut; ?></td>
204
						<?php
205
					}
206
					?>
207
				</tr>
208
				<?php
209
			}
210
		} else {
211
			echo showNoRecordsList($colCount - 2, '', true);
212
		}
213
		?>
214
	</table>
215
	</div>
216
	<?php
217
}
218
?>
219
 
220
<br>
221
<div class="table-responsive">
222
	<?php
223
	if (!empty($websiteStats)) {
224
    	echo showSectionHead($spTextHome['Website Statistics']);
155 - 225
    	$colSpan = 14;
103 - 226
    	if (empty($pdfVersion)) echo $websitePagingDiv;
227
    	?>
228
    	<table id="cust_tab">
229
    		<tr>
230
    			<th id="head" rowspan="2"><?php echo $spText['common']['Website']?></th>
231
    			<th id="head" colspan="4"><?php echo $spTextHome['Ranks']?></th>
232
    			<th id="head" colspan="3"><?php echo $spTextHome['Backlinks']?></th>
233
    			<th id="head" colspan="2"><?php echo $spTextHome['Pages Indexed']?></th>
155 - 234
    			<th id="head" colspan="2"><?php echo $spTextPS['Page Speed']?></th>
103 - 235
    			<th id="head" colspan="2"><?php echo $spTextHome['Directory Submission']?></th>
236
    		</tr>
237
    		<tr>
238
    			<th>Moz</th>
239
    			<th><?php echo $spText['common']['Domain Authority']?></th>
240
    			<th><?php echo $spText['common']['Page Authority']?></th>
241
    			<th>Alexa</th>
242
    			<th>Google</th>
243
    			<th>Alexa</th>
244
    			<th>Bing</th>
245
    			<th>Google</th>
246
    			<th>Bing</th>
247
    			<th><?php echo $spTextPS['Desktop Speed']?></th>
248
    			<th><?php echo $spTextPS['Mobile Speed']?></th>
249
    			<th><?php echo $spText['common']['Total']?></th>
250
    			<th><?php echo $spText['common']['Active']?></th>
251
    		</tr>
252
    		<?php
253
    		if(count($websiteRankList) > 0){
254
 
255
				foreach($websiteRankList as $websiteInfo){
256
					$rangeFromTime = date('Y-m-d', strtotime('-14 days', strtotime($fromTime)));
257
    				$timeArg = "&from_time=$rangeFromTime&to_time=$toTime";
258
    				$googleRankLink = scriptAJAXLinkHrefDialog('rank.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['mozrank']);
259
    				$alexaRankLink = scriptAJAXLinkHrefDialog('rank.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['alexarank']);
260
    				$daLink = scriptAJAXLinkHrefDialog('rank.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['domain_authority']);
261
    				$paLink = scriptAJAXLinkHrefDialog('rank.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['page_authority']);
262
    				$googleBackLInk = scriptAJAXLinkHrefDialog('backlinks.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['google']['backlinks']);
263
    				$alexaBackLInk = scriptAJAXLinkHrefDialog('backlinks.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['alexa']['backlinks']);
264
    				$bingBackLInk = scriptAJAXLinkHrefDialog('backlinks.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['msn']['backlinks']);
265
    				$googleIndexLInk = scriptAJAXLinkHrefDialog('saturationchecker.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['google']['indexed']);
266
    				$bingIndexLInk = scriptAJAXLinkHrefDialog('saturationchecker.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['msn']['indexed']);
267
    				$totaldirLink = scriptAJAXLinkHrefDialog('directories.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['dirsub']['total']);
268
    				$activeDirLink = scriptAJAXLinkHrefDialog('directories.php', 'content', "sec=reports&active=approved&&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['dirsub']['active']);
269
    				$desktopPageSpeedLink = scriptAJAXLinkHrefDialog('pagespeed.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['desktop_speed_score']);
270
    				$mobilePageSpeedLink = scriptAJAXLinkHrefDialog('pagespeed.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['mobile_speed_score']);
271
    				?>
272
    				<tr>
273
    					<td>
274
    						<a href="javascript:void(0)"><?php echo $websiteInfo['url'];?></a>
275
    					</td>
276
    					<td><?php echo $googleRankLink;?></td>
277
						<td><?php echo $daLink; ?></td>
278
						<td><?php echo $paLink; ?></td>
279
						<td><?php echo $alexaRankLink; ?></td>
280
						<td><?php echo $googleBackLInk; ?></td>
281
						<td><?php echo $alexaBackLInk; ?></td>
282
						<td><?php echo $bingBackLInk; ?></td>
283
						<td><?php echo $googleIndexLInk; ?></td>
284
						<td><?php echo $bingIndexLInk; ?></td>
285
						<td><?php echo $desktopPageSpeedLink; ?></td>
286
						<td><?php echo $mobilePageSpeedLink; ?></td>
287
						<td><?php echo $totaldirLink?></td>
288
						<td><?php echo $activeDirLink?></td>
289
    				</tr>
290
    			<?php
291
				}
292
    		} else {
293
    		    echo showNoRecordsList($colSpan - 2, '', true);
294
    		}?>
295
    	</table>
296
		<?php
297
	}
298
	?>
299
</div>
300
 
301
<?php
302
if (!empty($websiteSearchReport)) {
303
    ?>
304
    <br>
305
	<div class="table-responsive"><?php echo $websiteSearchReport;?></div>
306
	<?php
307
}
308
?>
309
 
310
<?php
311
if (!empty($sitemapReport)) {
312
    ?>
313
    <br>
314
	<div class="table-responsive"><?php echo $sitemapReport;?></div>
315
	<?php
316
}
317
?>
318
 
319
<?php
320
if (!empty($keywordSearchReport)) {
321
    ?>
322
    <br>
323
	<div class="table-responsive"><?php echo $keywordSearchReport;?></div>
324
	<?php
325
}
326
?>
327
 
328
<?php
329
if (!empty($socialMediaReport)) {
330
    ?>
331
    <br>
332
	<div class="table-responsive"><?php echo $socialMediaReport;?></div>
333
	<?php
334
}
335
?>
336
 
337
<?php
338
if (!empty($analyticsReport)) {
339
    ?>
340
    <br>
341
	<div class="table-responsive"><?php echo $analyticsReport;?></div>
342
	<?php
343
}
344
?>
345
 
346
<?php
347
if (!empty($reviewReport)) {
348
    ?>
349
    <br>
350
	<div class="table-responsive"><?php echo $reviewReport;?></div>
351
	<?php
352
}
353
?>
354
 
355
</div>
356
<br>
357
<?php
358
if(empty($cronUserId) && (!empty($printVersion) || !empty($pdfVersion))) {
359
	echo $pdfVersion ? showPdfFooter($spText) : showPrintFooter($spText);
360
}
361
?>