Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
echo showSectionHead($spTextPanel["Crawl Log Manager"]);
3
$searchFun = "scriptDoLoadPost('log.php', 'listform', 'content')";
4
?>
5
<form name="listform" id="listform" onsubmit="<?php echo $searchFun?>">
6
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="search">
7
	<tr>
8
		<th><?php echo $spText['button']['Search']?>: </th>
9
		<td><input type="text" name="keyword" value="<?php echo htmlentities($keyword, ENT_QUOTES)?>" onblur="<?php echo $searchFun?>"></td>
10
		<th><?php echo $spText['label']['Report Type']?>: </th>
11
		<td>
12
			<select name="crawl_type" onchange="<?php echo $searchFun?>">
13
				<option value="">-- <?php echo $spText['common']['Select']?> --</option>
14
				<?php
15
				foreach ($crawlTypeList as $cInfo) {
16
					$selectType = ($cInfo['crawl_type'] == $crawlType) ? "selected" : "";
17
					?>
18
					<option value="<?php echo $cInfo['crawl_type']; ?>" <?php echo $selectType; ?> ><?php echo $cInfo['crawl_type']; ?></option>
19
					<?php
20
				}
21
				?>
22
			</select>
23
		</td>
24
	</tr>
25
	<tr>
26
		<th width="100px;"><?php echo $spText['common']['Period']?>:</th>
27
    	<td width="236px">
28
    		<input type="text" value="<?php echo $fromTime?>" name="from_time"/>
29
    		<input type="text" value="<?php echo $toTime?>" name="to_time"/>
30
			<script>
31
			$(function() {
32
				$( "input[name='from_time'], input[name='to_time']").datepicker({dateFormat: "yy-mm-dd"});
33
			});
34
		  	</script>
35
    	</td>
36
		<th><?php echo $spText['common']['Search Engine']?>: </th>
37
		<td>
38
			<?php
39
			$this->data['onChange'] = $searchFun;
40
			$this->data['seNull'] = true;
41
			echo $this->render('searchengine/seselectbox', 'ajax');
42
			?>
43
		</td>
44
	</tr>
45
	<tr>
46
		<th><?php echo $spText['common']['Status']?>: </th>
47
		<td>
48
			<select name="status" onchange="<?php echo $searchFun?>">
49
				<option value="">-- <?php echo $spText['common']['Select']?> --</option>
50
				<?php
51
				$inactCheck = $actCheck = "";
52
				if ($statVal == 'success') {
53
				    $actCheck = "selected";
54
				} elseif($statVal == 'fail') {
55
				    $inactCheck = "selected";
56
				}
57
				?>
58
				<option value="success" <?php echo $actCheck?> ><?php echo $spText['label']["Success"]?></option>
59
				<option value="fail" <?php echo $inactCheck?> ><?php echo $spText['label']["Fail"]?></option>
60
			</select>
61
		</td>
62
		<th><?php echo $spText['label']['Proxy']; ?>: </th>
63
		<td>
64
			<select name="proxy_id" onchange="<?php echo $searchFun?>">
65
				<option value="">-- <?php echo $spText['common']['Select']?> --</option>
66
				<?php
67
				foreach ($proxyList as $proxyInfo) {
68
					$selectType = ($proxyInfo['proxy_id'] == $proxyId) ? "selected" : "";
69
					?>
70
					<option value="<?php echo $proxyInfo['proxy_id']; ?>" <?php echo $selectType; ?> ><?php echo $proxyInfo['proxy'].":".$proxyInfo['port']; ?></option>
71
					<?php
72
				}
73
				?>
74
			</select>
75
			&nbsp;&nbsp;&nbsp;&nbsp;
76
			<a href="javascript:void(0);" onclick="<?php echo $searchFun?>" class="actionbut"><?php echo $spText['button']['Show Records']?></a>
77
		</td>
78
	</tr>
79
</table>
80
 
81
<br><br>
82
<b>Current Time:</b> <?php echo date("Y-m-d H:i:s <b>T(P)</b>"); ?>
83
<?php echo $pagingDiv?>
84
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
85
	<tr class="listHead">
86
		<td class="leftid"><input type="checkbox" id="checkall" onclick="checkList('checkall')"></td>
87
		<td><?php echo $spText['common']['Id']?></td>
88
		<td width="80px"><?php echo $spText['label']['Report Type']?></td>
89
		<td><?php echo $spText['label']['Reference']?></td>
90
		<td><?php echo $spText['label']['Subject']?></td>
91
		<td><?php echo $spText['common']['Details']?></td>
92
		<td><?php echo $spText['common']['Status']?></td>
93
		<td><?php echo $spText['label']['Updated']?></td>
94
		<td class="right"><?php echo $spText['common']['Action']?></td>
95
	</tr>
96
	<?php
97
	$colCount = 9;
98
	if (count($list) > 0) {
99
		$catCount = count($list);
100
		foreach ($list as $i => $listInfo) {
101
			$class = ($i % 2) ? "blue_row" : "white_row";
102
            if ($catCount == ($i + 1)) {
103
                $leftBotClass = "tab_left_bot";
104
                $rightBotClass = "tab_right_bot";
105
            } else {
106
                $leftBotClass = "td_left_border td_br_right";
107
                $rightBotClass = "td_br_right";
108
            }
109
 
110
            // if from popup
111
			if ($fromPopUp) {
112
            	$logLink = scriptAJAXLinkHref('log.php', 'content', "sec=crawl_log_details&id=".$listInfo['id'], $listInfo['id']);
113
            } else {
114
				$logLink = scriptAJAXLinkHrefDialog('log.php', 'content', "sec=crawl_log_details&id=".$listInfo['id'], $listInfo['id']);
115
			}
116
 
117
            // crawl log is for keyword
118
            if ($listInfo['crawl_type'] == 'keyword') {
119
 
120
				// if ref is is integer find keyword name
121
				if (!empty($listInfo['keyword'])) {
122
					$listInfo['ref_id'] = $listInfo['keyword'];
123
				}
124
 
125
				// find search engine info
126
				if (preg_match("/^\d+$/", $listInfo['subject'])) {
127
					$seCtrler = new SearchEngineController();
128
					$seInfo = $seCtrler->__getsearchEngineInfo($listInfo['subject']);
129
					$listInfo['subject'] = $seInfo['domain'];
130
				}
131
 
132
			}
133
 
134
			?>
135
			<tr class="<?php echo $class?>">
136
				<td class="<?php echo $leftBotClass?>"><input type="checkbox" name="ids[]" value="<?php echo $listInfo['id']?>"></td>
137
				<td class="td_br_right"><?php echo $logLink?></td>
138
				<td class="td_br_right left"><?php echo $listInfo['crawl_type']?></td>
139
				<td class="td_br_right left"><?php echo $listInfo['ref_id']?></td>
140
				<td class="td_br_right left"><?php echo $listInfo['subject']?></td>
141
				<td class="td_br_right left"><?php echo stripslashes($listInfo['log_message'])?></td>
142
				<td class="td_br_right">
143
					<?php
144
					if ($listInfo['crawl_status']) {
145
						echo "<b class='success'>{$spText['label']['Success']}</b>";
146
					} else {
147
						echo "<b class='error'>{$spText['label']['Fail']}</b>";
148
					}
149
					?>
150
				</td>
151
				<td class="td_br_right"><?php echo $listInfo['crawl_time']?></td>
152
				<td class="<?php echo $rightBotClass?>" width="100px">
153
					<select name="action" id="action<?php echo $listInfo['id']?>" onchange="doAction('log.php', 'content', 'id=<?php echo $listInfo['id']?>&pageno=<?php echo $pageNo?><?php echo $urlParams?>', 'action<?php echo $listInfo['id']?>')">
154
						<option value="select">-- <?php echo $spText['common']['Select']?> --</option>
155
						<option value="delete_crawl_log"><?php echo $spText['common']['Delete']?></option>
156
					</select>
157
				</td>
158
			</tr>
159
			<?php
160
		}
161
	}else{
162
		echo showNoRecordsList($colCount-2);
163
	}
164
	?>
165
	<tr class="listBot">
166
		<td class="left" colspan="<?php echo ($colCount-1)?>"></td>
167
		<td class="right"></td>
168
	</tr>
169
</table>
170
<?php
171
if (SP_DEMO) {
172
    $clearAllFun = $delFun = "alertDemoMsg()";
173
} else {
174
    $delFun = "confirmSubmit('log.php', 'listform', 'content', '&sec=delete_all_crawl_log&pageno=$pageNo')";
175
    $clearAllFun = "confirmLoad('log.php', 'content', '&sec=clear_all_log')";
176
}
177
?>
178
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="actionSec">
179
	<tr>
180
    	<td style="padding-top: 6px;" class="left">
181
         	<a onclick="<?php echo $delFun?>" href="javascript:void(0);" class="actionbut">
182
         		<?php echo $spText['common']['Delete']?>
183
         	</a>&nbsp;&nbsp;
184
         	<?php if (empty($fromPopUp)) {?>
185
	         	<a onclick="<?php echo $clearAllFun?>" href="javascript:void(0);" class="actionbut">
186
	         		<?php echo $spTextLog['Clear All Logs']?>
187
	         	</a>
188
	         <?php }?>
189
    	</td>
190
	</tr>
191
</table>
192
</form>