<table width="100%" border="0" cellspacing="0" cellpadding="3" class="thborder">
<tr>
	  <th width="6%">Group Id</th>
    <th>Group Name</th>
    <th width="6%">Parent</th>
    <th width="5%" style="text-align:center;">Edit</th>
    <th width="5%" style="text-align:center;">Delete</th>
</tr>
   <?php 
      // LIMIT $startpoint,$perpage
   $GetRecord = "Select * from $table order by GroupId  ";
   $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><?php echo $i; ?></td>
    <td><?php echo $RowData['GroupName']; ?></td>
	  <td><?php 	   
	    $parent= $s->getField($table,'GroupId',$RowData['MainGroupId'],'GroupName');	 
	  if($parent!='')
	  echo $parent;
	  else{
	  echo "--Root--";
	  }
 	   ?></td>   
  <td style="text-align:center;"><a href="<?php echo $targetpage?>&action=Edit&GroupId=<?php echo $RowData['GroupId']; ?>"><img src="images/icon-edit.png" width="15" height="15" title="Edit Document" /></a></td>
	<td style="text-align:center;"><a href="<?php echo $targetpage?>&action=del&GroupId=<?php echo $RowData['GroupId']; ?>" onclick="return confirm('Do You Want To Delete This Record')"><img src="images/Icon_Delete.png" width="15" height="15" title="Delete Document" /></a></td>	
	 </tr>
 
	<?php $i++;}   
   ?> 
   
    
    <!-- <td colspan="4">
	<?php  
	//$cond="1=1";
	//Pages($table,20,"index.php?route=AccountGroups_Master&action=Edit".$url,$cond,'GroupId');
	 //echo Pages("jos_users",$perpage,"index.php?option=com_empdictory&dept=$dept&",$condition);?>
	</td> -->
 </table>  
 
