【发布时间】:2011-12-16 17:17:52
【问题描述】:
我有一个通过 PHP 显示的 mysql 查询。每个返回的记录都分配有一个复选框。表中的一列 (ReleaseNumber) 有一个数字,用于对不同的记录进行分组。如何按版本号创建可折叠的复选框组。我附上了当前状态的图像以及我所追求的(outlook 截图)。用户可以折叠或展开行组。如果选择了行组,则所有子行也会被选中。
这可以做到吗?如果可以,怎么做? 当前的: 期望:
我的代码是:
<?php
mysql_connect("localhost", "username", "password")or die("cannot connect");
mysql_select_db("database")or die("cannot select DB");
$sql="SELECT`despgoodsid` ,`crtd dept` ,`customer` ,`loc cust rel` ,`case no` ,`gross mass` ,`case width` ,`case length` FROM despgoods_alldetails WHERE transporttypename ='localjhb' AND locstatus ='unplanned' AND customer <>'customer' AND `loc cust rel` > 0 ";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
putenv("TZ=Africa/Johannesburg");
?>
<table border=0>
<tr>
<td>
<form name="form1" method="post">
<table border=0 id="hor-minimalist-a">
<tr>
<th> </th>
<th width=150><center>Release Number</th>
<th width=150>Dispatch Area</th>
<th width=150>Customer</th>
<th width=130><center>Case Number</th>
<th width=80><center>Weight</th>
<th width=80><center>Width</th>
<th width=80><center>Length</th>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><input type="checkbox" name=check[] value="<?php echo $rows['despgoodsid']; ?>"></td>
<td><center><?php echo $rows['loc cust rel']; ?></td>
<td><?php echo $rows['crtd dept']; ?></td>
<td><?php echo $rows['customer']; ?></td>
<td><center><?php echo $rows['case no']; ?></td>
<td><center><?php echo $rows['gross mass']; ?></td>
<td><center><?php echo $rows['case width']; ?></td>
<td><center><?php echo $rows['case length']; ?></td>
</tr>
<?php
}
?>
</table>
<table>
<tr>
<td colspan=3><input name="Next" type="submit" id="Next" value="Next"></td>
</tr></table>
我需要一些 Java 来完成这个吗?任何建议都会一如既往地受到赞赏?
感谢和问候, 瑞恩·史密斯
【问题讨论】:
标签: php mysql checkbox expand collapse