<script type="text/javascript">
//--列头全选框被单击---
function ChkAllClick(sonName, cbAllId){
var arrSon = document.getElementsByName(sonName);
var cbAll = document.getElementById(cbAllId);
var tempState=cbAll.checked;
for(var i=0;i<arrSon.length;i++) {
if(arrSon[i].checked!=tempState)
arrSon[i].click();
}
}
// --子项复选框被单击---
function ChkSonClick(sonName, cbAllId) {
var arrSon = document.getElementsByName(sonName);
var cbAll = document.getElementById(cbAllId);
for(var i=0; i<arrSon.length; i++) {
if(!arrSon[i].checked) {
cbAll.checked = false;
return;
}
}
cbAll.checked = true;
}
</script>
<div class="look">
<form name="form5" method="post" onSubmit="Checker()">
<table class="add" >
<tr>
<td width="8"><input name="chkAll" id="chkAll" title="全选" onClick="ChkAllClick('chkSon','chkAll')" type="checkbox" /></td>
<td width="10%"><b>日志日期</b></td>
<td width="30%"><b>工作日志</b></td>
<td width="25%"><b>费用日志</b></td>
<td width="10%"><b>备注</b></td>
<td width="6%"><b>合计</b></td>
<td width="8%"><b>状态</b></td>
<td width="35%"><b>操作</b></td>
</tr>
<?php
$pagesize=10;
$url=$_SERVER["REQUEST_URI"];
$url=parse_url($url);
$url=$url[path];
//echo $url."<br>";
$sql="select * from article ";
$query = mysql_query($sql);
$num=mysql_num_rows($query);
if ($_GET[page]){
$pageval=$_GET[page];
$page=($pageval-1)*$pagesize;
$page.=',';
}
$SQL="select * from article limit $page $pagesize";
$query=mysql_query($SQL);
while($row = mysql_fetch_row($query)){
?>
<tr>
<td width="8"><input name="chkSon" id= "chkSon<?php echo $row[0]; ?>" onClick="ChkAllClick('chkSon','chkAll')" type="checkbox" value='<?php echo $row[0]; ?>' /></td>
<td width="10%"><?php echo $row[1];?></td>
<td width="30%"><?php echo $row[2];?></td>
<td width="25%"><?php echo $row[3];?></td>
<td width="10%"><?php echo $row[4];?></td>