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