|
楼主 |
发表于 2015-5-6 17:07:49
|
显示全部楼层
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<style>
*{
margin:0 auto;
}
table {
border:1px solid gray;
border-collapse: collapse;
width:500px;
text-align:center;
}
th,td {
border:1px solid gray;
}
</style>
</head>
<body>
<div>
<form action="<?php echo site_url('finance/verifypaystandard1');?>" method="get">
批次号
<input type="text" name="batch_number" id="batch_number" value="<?=$batch_number?>"/>
<br/>
<input type="submit" name="query" value="查找" style="background-color:#FFf"/>
<input type="submit" name="query" value="审核" style="background-color:#FFf"/>
</form>
</div>
<div>
<form name="form" method="post" action="<?php echo site_url('finance/verifypaystandard1');?>" >
<table>
<tr>
<th><input type="checkbox" id="checkAll" name="checkbox" onclick="checkall()">全选</th>
<th>批次号</th>
<th>审核</th>
</tr>
<?php
foreach($blog as $item){
?>
<tr>
<td><input type="checkbox" name="checkbox1[]"></td>
<td><?=$item->batch_number?></td>
<td><?=$item->status?></td>
</tr>
<?php
}
?>
</table>
</form>
</div>
</body>
</html>
<script>
function checkall(){
var isChecked = (document.form.checkAll.checked == true);
var elements_all = document.form.elements;
for(i=0;i<elements_all.length;i++){
var element = elements_all[i];
if(element.type == "checkbox"){
element.checked = isChecked;
}
}
}
</script>
这是view的代码,我勾上全选后,我需要把batch_number的值传到controller层调用数据库 |
|