<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
   <tr>
   <td class="tabledata">Id</td>
   <td class="tabledata">Title</td>
   <td class="tabledata">Parent</td>
   <td class="tabledata">Status</td>
   <td class="tabledata">Edit</td>
  
   </tr>
   <?php 
      // LIMIT $startpoint,$perpage
   $GetRecord = "Select * from $table order by mst_pl_catid ";
   $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 bgcolor="#c1c1c1">
    <td><div align="center"><?php echo $i; ?></div></td>
    <td><?php echo $RowData['picklist_title']; ?>	  </td>
	  <td><?php 
	   
	    $parent= $s->GetFieldValue('crm_picklist',"picklist_id='".$RowData['mst_pl_catid']."'",'picklist_title');	 
		 $subparent= $s->GetFieldValue('crm_picklist',"picklist_id='".$RowData['mst_pl_subcatid']."'",'picklist_title');	
	  if($parent!='')
	  echo $parent.'-->'.$subparent;
	  else{
	  echo "--Root--";
	  }
	     
 	   ?></td>
   
   	<td><div align="center"><?php echo ($RowData['status']=='1'?'Active':'Inactive'); ?></div> </td>	

   <td><div align="center"><a href="<?php echo $targetpage?>&amp;action=Edit&amp;id=<?php echo $RowData['id']; ?>"><img src="images/icon-edit.png"  height="10"/></a></div></td>
	 </tr>
 
	<?php $i++;}   
   ?> </table>
   