2011-10-27 4 views
1

PHP를 통해 표시되는 mysql 쿼리가 있습니다. 반환 된 각 레코드에는 확인란이 지정됩니다. 테이블 (ReleaseNumber)의 열에는 여러 레코드를 그룹화하는 숫자가 있습니다. 릴리스 번호별로 접을 수있는 체크 박스 그룹을 만들려면 어떻게해야합니까? 나는 현재 상태의 이미지와 내가 무엇을하고 있는지 (아웃룩 스크린 샷) 첨부했다. 사용자는 행 그룹을 축소하거나 확장 할 수 있습니다. 행 그룹이 선택되면 모든 하위 행도 선택됩니다.체크 박스 접기 및 확장 그룹

이렇게 할 수 있습니까? 현재 : enter image description here 이 원하는 : enter image description here

내 코드는 다음과 같습니다

<?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>&nbsp;</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> 

내가 어떤 자바이를 완료해야합니까? 어떤 충고라도 언제나 그렇듯이 인정할 수 있습니까?

감사와 안부, 라이언 스미스

답변