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['Review Report Summary']) : showPrintHeader($spTextTools['Review Report 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['Review Report Summary']);
26
 
27
    // if not summary page show the filters
28
    if(!$summaryPage) {
29
    	$scriptName = $pageScriptPath;
30
	    ?>
31
		<form id='search_form'>
32
		<?php $submitLink = "scriptDoLoadPost('$scriptName', 'search_form', 'content', '&sec=reportSummary')";?>
33
		<table width="100%" class="search">
34
			<tr>
35
				<th><?php echo $spText['common']['Url']?>: </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><?php echo $spText['label']['Type']?>:</th>
53
				<td>
54
					<select name="type" onchange="<?php echo $submitLink?>">
55
						<option value="">-- <?php echo $spText['common']['Select']?> --</option>
56
						<?php foreach($serviceList as $serviceName => $serviceInfo){?>
57
							<?php if($serviceName == $searchInfo['type']){?>
58
								<option value="<?php echo $serviceName?>" selected><?php echo $serviceInfo['label']?></option>
59
							<?php }else{?>
60
								<option value="<?php echo $serviceName?>"><?php echo $serviceInfo['label']?></option>
61
							<?php }?>
62
						<?php }?>
63
					</select>
64
					<?php echo $errMsg['service_name']?>
65
				</td>
66
				<th width="100px;"><?php echo $spText['common']['Period']?>:</th>
67
	    		<td width="236px">
68
	    			<input type="text" value="<?php echo $fromTime?>" name="from_time"/>
69
	    			<input type="text" value="<?php echo $toTime?>" name="to_time"/>
70
        			<script>
71
        			$(function() {
72
        				$( "input[name='from_time'], input[name='to_time']").datepicker({dateFormat: "yy-mm-dd"});
73
        			});
74
        		  	</script>
75
	    		</td>
76
				<td><a href="javascript:void(0);" onclick="<?php echo $submitLink?>" class="actionbut"><?php echo $spText['button']['Search']?></a></td>
77
			</tr>
78
		</table>
79
		</form>
80
		<?php
81
    } else {
82
    	$scriptName = "archive.php";
83
    }
84
 
85
	// url parameters
86
	$mainLink = SP_WEBPATH."/$scriptName?sec=reportSummary&website_id=$websiteId&from_time=$fromTime&to_time=$toTime&type={$searchInfo['type']}";
87
	$mainLink .= "&search_name={$searchInfo['search_name']}&report_type=review-reports";
88
 
89
	// if not summary page show the filters
90
	if(!$summaryPage) {
91
		$directLink = $mainLink . "&order_col=$orderCol&order_val=$orderVal&pageno=$pageNo";
92
		?>
93
		<br><br>
94
		<div style="float:left;margin-right: 10px;">
95
			<a href="<?php echo $directLink?>&doc_type=pdf"><img src="<?php echo SP_IMGPATH?>/icon_pdf.png"></a> &nbsp;
96
			<a href="<?php echo $directLink?>&doc_type=export"><img src="<?php echo SP_IMGPATH?>/icoExport.gif"></a> &nbsp;
97
			<a target="_blank" href="<?php echo $directLink?>&doc_type=print"><img src="<?php echo SP_IMGPATH?>/print_button.gif?1"></a>
98
		</div>
99
		<?php
100
	}
101
 
102
	if (empty($pdfVersion) && empty($cronUserId)) echo $pagingDiv;
103
}
104
 
105
$baseColCount = count($colList);
106
$colCount = ($baseColCount * 3) + 2;
107
?>
108
<div id='subcontent' style="margin-top: 0px;">
109
 
110
<table id="cust_tab">
111
	<tr>
112
		<th id="head" rowspan="2"><?php echo $spText['common']['Website']?></th>
113
		<?php
114
		$hrefAttr = $pdfVersion ? "" : "href='javascript:void(0)'";
115
		foreach (array_keys($colList) as $i => $colName){
116
 
117
		    $linkClass = "";
118
            if ($colName == $orderCol) {
119
                $oVal = ($orderVal == 'DESC') ? "ASC" : "DESC";
120
                $linkClass .= "sort_".strtolower($orderVal);
121
            } else {
122
                $oVal = 'DESC';
123
            }
124
 
125
            $linkName = "<a id='sortLink' class='$linkClass' $hrefAttr onclick=\"scriptDoLoad('$mainLink&order_col=$colName&order_val=$oVal', 'content')\">$colList[$colName]</a>";
126
		    $rowSpan = ($colName == "url") ? 2 : 1;
127
			?>
128
			<th rowspan="<?php echo $rowSpan?>" colspan="3" id="head"><?php echo $linkName; ?></th>
129
			<?php
130
 
131
		}
132
		?>
133
	</tr>
134
	<tr>
135
		<?php
136
		$pTxt = str_replace("-", "/", substr($fromTime, -5));
137
		$cTxt = str_replace("-", "/", substr($toTime, -5));
138
		foreach ($colList as $colName => $colVal) {
139
			if ($colName == 'url') continue;
140
			?>
141
			<th><?php echo $pTxt; ?></th>
142
			<th><?php echo $cTxt; ?></th>
143
			<th>+ / -</th>
144
			<?php
145
		}
146
		?>
147
	</tr>
148
	<?php
149
		if (!empty($baseReportList)) {
150
			foreach($baseReportList as $listInfo){
151
				$keywordId = $listInfo['id'];
152
				$rangeFromTime = date('Y-m-d', strtotime('-14 days', strtotime($fromTime)));
153
				$scriptLink = "website_id=$websiteId&link_id={$listInfo['id']}&rep=1&from_time=$rangeFromTime&to_time=$toTime";
154
				?>
155
				<tr>
156
					<td>
157
						<a href="javascript:void(0)"><?php echo $websiteList[$listInfo['website_id']]['url']; ?></a>
158
					</td>
159
					<td colspan="3">
160
						<?php echo $listInfo['url']; ?>
161
					</td>
162
					<?php
163
					foreach ($colList as $colName => $colVal){
164
						if ($colName == 'url') continue;
165
 
166
						// if not facebook likes value will be null
167
						if ($colName == 'likes' && $listInfo['type'] != 'facebook') {
168
							$prevRankLink = $currRankLink = $graphLink = $rankDiffTxt = "";
169
						} else {
170
 
171
							$currRank = isset($listInfo[$colName]) ? $listInfo[$colName] : 0;
172
							$prevRank = isset($compareReportList[$keywordId][$colName]) ? $compareReportList[$keywordId][$colName] : 0;
173
							$rankDiffTxt = "";
174
 
175
							// find rank difefrence
176
							$rankDiff = $currRank - $prevRank;
177
							$rankDiff = round($rankDiff, 2);
178
							if ($colName == 'average_position') $rankDiff = $rankDiff * -1;
179
 
180
							if ($rankDiff > 0) {
181
								$rankDiffTxt = "<font class='green'>($rankDiff)</font>";
182
							} else if ($rankDiff < 0) {
183
								$rankDiffTxt = "<font class='red'>($rankDiff)</font>";
184
							} else {
185
								$rankDiffTxt = "";
186
							}
187
 
188
							$prevRankLink = scriptAJAXLinkHrefDialog($pageScriptPath, 'content', $scriptLink . "&sec=viewDetailedReports", $prevRank);
189
							$currRankLink = scriptAJAXLinkHrefDialog($pageScriptPath, 'content', $scriptLink . "&sec=viewDetailedReports", $currRank);
190
							$graphLink = scriptAJAXLinkHrefDialog($pageScriptPath, 'content', $scriptLink . "&sec=viewGraphReports&attr_type=$colName", '&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
					    ?>
200
						<td><?php echo $prevRankLink; ?></td>
201
						<td><?php echo $currRankLink; ?></td>
202
						<td><?php echo $graphLink . " " . $rankDiffTxt; ?></td>
203
						<?php
204
					}
205
					?>
206
				</tr>
207
			<?php
208
			}
209
		} else {
210
			?>
211
			<tr><td colspan="<?php echo $colCount?>"><b><?php echo $_SESSION['text']['common']['No Records Found']?></b></tr>
212
			<?php
213
		}
214
	?>
215
</table>
216
</div>
217
<?php
218
if(!$summaryPage && (!empty($printVersion) || !empty($pdfVersion))) {
219
	echo $pdfVersion ? showPdfFooter($spText) : showPrintFooter($spText);
220
}
221
?>