 

<table width="100%" border="0" cellspacing="0" cellpadding="3">
   <tr>
   <?php 
      // LIMIT $startpoint,$perpage
   $GetRecord = "Select * from $table";
   $ResultData = DB_query($GetRecord,$db);
   $i=1;
   if(DB_num_rows($ResultData)==0)
   echo "<td>--No Record--</td>";
   
   while($RowData = DB_fetch_array($ResultData))
   {?>
 <tr> <td width="20%"><div align="center"><?php echo $RowData['GroupId']; ?></div></td>
    <td width="20%"><?php echo $RowData['GroupName']; ?>	  </td>
	  <td width="20%"><?php 
	   
	    $parent= $s->getField($table,'GroupId',$RowData['MainGroupId'],'GroupName');	 
	  if($parent!='')
	  echo $parent;
	  else{
	  echo "--Root--";
	  }
 	   ?></td>
   
   <td width="20%"><div align="center"><a href="main.php?route=AccountGroups_Master&action=Edit&GroupId=<?php echo $RowData['GroupId']; ?>"><img src="images/icon_edit.gif"  width="10" height="10"/></a></div></td>
	<td width="20%"><div align="center"><a href="main.php?route=AccountGroups_Master&action=del&GroupId=<?php echo $RowData['GroupId']; ?>"><img src="images/Icon_Delete.gif" width="10" height="10" /></a></div></td>	
	 </tr>
 
	<?php $i++;}   
   ?> </table>
   
    
  
 