Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
$borderCollapseVal = $pdfVersion ? "border-collapse: collapse;" : "";
3
 
4
if(!$summaryPage && (!empty($printVersion) || !empty($pdfVersion))) {
5
    $pdfVersion ? showPdfHeader($spTextTools['Keyword Search Summary']) : showPrintHeader($spTextTools['Keyword Search Summary']);
6
    ?>
7
    <table width="80%" class="search">
8
    	<?php if (!empty($websiteInfo['url'])) {?>
9
    		<tr>
10
    			<th><?php echo $spText['common']['Website']?>:</th>
11
        		<td>
12
        			<?php echo $websiteInfo['url']; ?>
13
    			</td>
14
    		</tr>
15
		<?php }?>
16
		<tr>
17
			<th><?php echo $spText['common']['Period']?>:</th>
18
    		<td>
19
    			<?php echo $fromTime?> - <?php echo $toTime?>
20
			</td>
21
		</tr>
22
	</table>
23
    <?php
24
} else {
25
 
26
	echo showSectionHead($spTextTools['Website Search Summary']);
27
 
28
    // if not summary page show the filters
29
    if(!$summaryPage) {
30
    	$scriptName = "webmaster-tools.php";
31
    	?>
32
		<form id='search_form'>
33
		<?php $submitLink = "scriptDoLoadPost('webmaster-tools.php', 'search_form', 'content', '&sec=viewWebsiteSearchSummary')";?>
34
		<table width="100%" class="search">
35
			<tr>
36
				<th><?php echo $spText['common']['Name']?>: </th>
37
				<td>
38
					<input type="text" name="search_name" value="<?php echo htmlentities($searchInfo['search_name'], ENT_QUOTES)?>" onblur="<?php echo $submitLink?>">
39
				</td>
40
				<th width="100px"><?php echo $spText['common']['Website']?>: </th>
41
				<td width="160px">
42
					<select name="website_id" id="website_id" style='width:100px;' onchange="<?php echo $submitLink?>">
43
						<option value="">-- <?php echo $spText['common']['Select']?> --</option>
44
						<?php foreach($websiteList as $websiteInfo){?>
45
							<?php if($websiteInfo['id'] == $websiteId){?>
46
								<option value="<?php echo $websiteInfo['id']?>" selected><?php echo $websiteInfo['name']?></option>
47
							<?php }else{?>
48
								<option value="<?php echo $websiteInfo['id']?>"><?php echo $websiteInfo['name']?></option>
49
							<?php }?>
50
						<?php }?>
51
					</select>
52
				</td>
53
				<th width="100px;"><?php echo $spText['common']['Period']?>:</th>
54
	    		<td width="236px">
55
	    			<input type="text" value="<?php echo $fromTime?>" name="from_time"/>
56
	    			<input type="text" value="<?php echo $toTime?>" name="to_time"/>
57
        			<script type="text/javascript">
58
        			$(function() {
59
        				$( "input[name='from_time'], input[name='to_time']").datepicker({dateFormat: "yy-mm-dd"});
60
        			});
61
        		  	</script>
62
	    		</td>
63
				<td><a href="javascript:void(0);" onclick="<?php echo $submitLink?>" class="actionbut"><?php echo $spText['button']['Search']?></a></td>
64
			</tr>
65
		</table>
66
		</form>
67
		<?php
68
    } else {
69
    	$scriptName = "archive.php";
70
    }
71
 
72
	// url parameters
73
	$mainLink = SP_WEBPATH."/$scriptName?sec=viewWebsiteSearchSummary&website_id=$websiteId&from_time=$fromTime&to_time=$toTime";
74
	$mainLink .= "&search_name=" . $searchInfo['search_name'] . "&report_type=website-search-reports";
75
 
76
	// if not summary page show the filters
77
	if(!$summaryPage) {
78
		$directLink = $mainLink . "&order_col=$orderCol&order_val=$orderVal&pageno=$pageNo";
79
		?>
80
		<br><br>
81
		<div style="float:left;margin-right: 10px;">
82
			<a href="<?php echo $directLink?>&doc_type=pdf"><img src="<?php echo SP_IMGPATH?>/icon_pdf.png"></a> &nbsp;
83
			<a href="<?php echo $directLink?>&doc_type=export"><img src="<?php echo SP_IMGPATH?>/icoExport.gif"></a> &nbsp;
84
			<a target="_blank" href="<?php echo $directLink?>&doc_type=print"><img src="<?php echo SP_IMGPATH?>/print_button.gif?1"></a>
85
		</div>
86
		<?php
87
	}
88
 
89
	if (empty($pdfVersion)) echo $pagingDiv;
90
}
91
 
92
$baseColCount = count($colList);
93
$colCount = ($baseColCount * 3) + 1;
94
?>
95
<div id='subcontent' style="margin-top: 0px;">
96
<table id="cust_tab">
97
	<tr>
98
		<?php
99
		$hrefAttr = $pdfVersion ? "" : "href='javascript:void(0)'";
100
		foreach (array_keys($colList) as $i => $colName){
101
 
102
		    $linkClass = "";
103
            if ($colName == $orderCol) {
104
                $oVal = ($orderVal == 'DESC') ? "ASC" : "DESC";
105
                $linkClass .= "sort_".strtolower($orderVal);
106
            } else {
107
                $oVal = 'DESC';
108
            }
109
 
110
            $headerVal = ($colName == 'name') ? $_SESSION['text']['common']['Website'] : $colList[$colName];
111
            $linkName = "<a id='sortLink' class='$linkClass' $hrefAttr onclick=\"scriptDoLoad('$mainLink&order_col=$colName&order_val=$oVal', 'content')\">$headerVal</a>";
112
		    $rowSpan = ($colName == "name") ? 2 : 1;
113
			?>
114
			<th id="head" rowspan="<?php echo $rowSpan?>" colspan="3"><?php echo $linkName; ?></th>
115
			<?php
116
 
117
		}
118
		?>
119
	</tr>
120
	<tr>
121
		<?php
122
		$pTxt = str_replace("-", "/", substr($fromTime, -5));
123
		$cTxt = str_replace("-", "/", substr($toTime, -5));
124
		foreach ($colList as $colName => $colVal) {
125
			if ($colName == 'name') continue;
126
			?>
127
			<th><?php echo $pTxt; ?></th>
128
			<th><?php echo $cTxt; ?></th>
129
			<th>+ / -</th>
130
			<?php
131
		}
132
		?>
133
	</tr>
134
	<?php
135
	if (count($baseReportList) > 0) {
136
		foreach($baseReportList as $listInfo){
137
			$keywordId = $listInfo['id'];
138
			$rangeFromTime = date('Y-m-d', strtotime('-14 days', strtotime($fromTime)));
139
            $scriptLink = "website_id={$listInfo['id']}&rep=1&from_time=$rangeFromTime&to_time=$toTime";
140
			?>
141
			<tr>
142
				<td colspan="3"><a href="javascript:void(0)"><?php echo $listInfo['url']; ?></a></td>
143
				<?php
144
				foreach ($colList as $colName => $colVal){
145
					if ($colName == 'name') continue;
146
 
147
					$prevRank = isset($listInfo[$colName]) ? $listInfo[$colName] : 0;
148
					$currRank = isset($compareReportList[$keywordId][$colName]) ? $compareReportList[$keywordId][$colName] : 0;
149
					$rankDiffTxt = "";
150
 
151
					// check rank difference
152
					$rankDiff = $currRank - $prevRank;
153
					$rankDiff = round($rankDiff, 2);
154
					if ($colName == 'average_position') $rankDiff = $rankDiff * -1;
155
 
156
					if ($rankDiff > 0) {
157
						$rankDiffTxt = "<font class='green'>($rankDiff)</font>";
158
					} else if ($rankDiff < 0) {
159
						$rankDiffTxt = "<font class='red'>($rankDiff)</font>";
160
					} else {
161
						$rankDiffTxt = "";
162
					}
163
 
164
					$prevRankLink = scriptAJAXLinkHrefDialog('webmaster-tools.php', 'content', $scriptLink . "&sec=viewWebsiteSearchReports", $prevRank);
165
					$currRankLink = scriptAJAXLinkHrefDialog('webmaster-tools.php', 'content', $scriptLink . "&sec=viewWebsiteSearchReports", $currRank);
166
					$graphLink = scriptAJAXLinkHrefDialog('webmaster-tools.php', 'content', $scriptLink . "&sec=viewWebsiteSearchGraphReports&attr_type=$colName", '&nbsp;', 'graphicon');
167
 
168
					// if pdf report remove links
169
					if ($pdfVersion) {
170
						$prevRankLink = str_replace("href='javascript:void(0);'", "", $prevRankLink);
171
						$currRankLink = str_replace("href='javascript:void(0);'", "", $currRankLink);
172
						$graphLink = str_replace("href='javascript:void(0);'", "", $graphLink);
173
					}
174
				    ?>
175
					<td><?php echo $prevRankLink; ?></td>
176
					<td><?php echo $currRankLink; ?></td>
177
					<td><?php echo $graphLink . " " . $rankDiffTxt; ?></td>
178
					<?php
179
				}
180
				?>
181
			</tr>
182
			<?php
183
		}
184
	}
185
	?>
186
</table>
187
</div>
188
<?php
189
if(!$summaryPage && (!empty($printVersion) || !empty($pdfVersion))) {
190
	echo $pdfVersion ? showPdfFooter($spText) : showPrintFooter($spText);
191
}
192
?>