<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>文档重复检测记录</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
	</head>
	<body>
		<div class="container-fluid">
			<div class="card shadow-sm">
				<div class="card-header">文档重复检测记录</div>
				<div class="card-body">
					<form name="form2" method="POST" action="article_test_same.php">
						<input type="hidden" name="deltype" value="<?php echo $deltype;?>">
						<input type="hidden" name="dopost" value="delsel">
						<input type="hidden" name="pagesize" value="<?php echo $pagesize;?>">
						<input type="hidden" name="channelid" value="<?php echo $channelid;?>">
						<input type="hidden" name="maintable" value="<?php echo $maintable;?>">
						<input type="hidden" name="titles">
						<div class="table-responsive">
							<table class="table table-borderless">
								<thead>
									<tr>
										<td scope="col">选择</td>
										<td scope="col">重复数量</td>
										<td scope="col">文档标题</td>
									</tr>
								</thead>
								<tbody>
									<?php
									while($row = $dsql->GetArray())
									{
									   if ($row['dd']==1 ) break;
									?>
									<tr>
										<td><input type="checkbox" name="arcTitles" id="arcTitle" value="<?php echo urlencode($row['title'])?>"></td>
										<td>
											<?php
											$allarc += $row['dd'];
											echo $row['dd'];
											?>
										</td>
										<td><?php echo $row['title'];?></td>
									</tr>
									<?php }?>
									<tr>
										<td colspan="3">
											<a href="javascript:selAll();" class="btn btn-success btn-sm">全选</a>
											<a href="javascript:noSelAll();" class="btn btn-success btn-sm">反选</a>
											<a href="javascript:delArc();" class="btn btn-danger btn-sm">删除</a>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</form>
				</div>
			</div>
		</div>
		<script>
			function getCheckboxItem() {
				var allSel = '';
				if (document.form2.arcTitle.value) return document.form2.arcTitle.value;
				for (i = 0; i < document.form2.arcTitle.length; i++) {
					if (document.form2.arcTitle[i].checked) {
						if (allSel == "")
							allSel = document.form2.arcTitle[i].value;
						else
							allSel = allSel + "`" + document.form2.arcTitle[i].value;
					}
				}
				return allSel;
			}
			function delArc() {
				var qstr = getCheckboxItem();
				document.form2.titles.value = qstr;
				document.form2.submit();
			}
			function selAll() {
				for (i = 0; i < document.form2.arcTitle.length; i++) {
					if (!document.form2.arcTitle[i].checked) {
						document.form2.arcTitle[i].checked = true;
					}
				}
			}
			function noSelAll() {
				for (i = 0; i < document.form2.arcTitle.length; i++) {
					if (document.form2.arcTitle[i].checked) {
						document.form2.arcTitle[i].checked = false;
					}
				}
			}
		</script>
	</body>
</html>