Location: PHPKode > scripts > Create Your Own Directory > cms/functions/parentchild.php
<script language=javascript>
function getparentchild(layout)
{
	document.write("<table border=0 width=90% align=center><tr><td colspan=3 align=right><strong><a class=heading1 href="+home+"HRAS/users/index.php>ADD YOUR LISTING</a></strong></td></tr><tr>");
	var par=child[0].split("#");
	for(i=0;i<par.length;i++)
	{
  	    if(i%3 == 0)
  	 	document.write("</tr><tr>");
  		document.write("<td valign=top width=33%><br>");
 	 	var arr=(par[i].split("::"));
 	 	var parentnam=arr[1];
  		var parentid=arr[2];
            if(layout==1){

		if(typ7=="updated"){
	    		var temp1="<table bgcolor=#dedede width=100%><tr><td  width=16%><img src="+home+"includes/print.php?cnt="+id7+"width="+width7+" height="+height7+" border=0 ><a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a></td></tr>";
		}else{
	   		var temp1="<table bgcolor=#dedede width=100%><tr><td  width=16%><img src="+home+"image/img7.gif  width="+width7+" height="+height7+" border=0 width=16%><a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a></td></tr>";
      	}




			//var temp1="<table bgcolor=#dedede width=100%><tr><td><img src=image/folder.gif><a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a></td></tr>";
  			document.write(temp1);
  			var childs = getChilds(parentid);
  	    		for(var j=0;j<childs.length;j++)
  	    		{
      			var arr2=(childs[j].split("::"));
				var cname = arr2[1].replace(' ','_');
				if(getChilds(arr2[2]).length > 0)
 	 			 document.write("<tr bgcolor=#fefefe><td><a class=heading1  href='"+parentnam+"/"+cname+"/index.html'>"+arr2[1]+"</a></td></tr>");
	else
	 document.write("<tr bgcolor=#fefefe><td><a class=heading1 href='"+parentnam+"/"+cname+"-"+arr2[2]+"-0.php'>"+arr2[1]+"</a></td></tr>"); 
  }

  	    		document.write("</table></td>");

         	}else if(layout==2){
                   if(foldtyp=="default"){
if(typ7=="updated"){
	    		var temp1="<table bgcolor=#dedede  cellpadding=0 cellspacing=0  width=100%><tr bgcolor=#fefefe><td><img src="+home+"includes/print.php?cnt="+id7+"width="+width7+" height="+$height7+" border=0 > &nbsp;&nbsp;<a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a></td></tr>";
		}else{
	   		var temp1="<table bgcolor=#dedede  cellpadding=0 cellspacing=0  width=100%><tr><td ><img src="+home+"image/img7.gif  width="+width7+" height="+height7+" border=0 width=16%>&nbsp;&nbsp;<a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a></td></tr>";
      	}




			 var temp1="<table cellpadding=0 cellspacing=0 width=100%><tr bgcolor=#fefefe><td><img src=image/img7.gif>&nbsp;&nbsp;<a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a><br></td></tr>";
                   }else{
                   var temp1="<table cellpadding=0 cellspacing=0 width=100%><tr bgcolor=#fefefe><td><img src='"+home+"includes/print.php?cnt=7'>&nbsp;&nbsp;<a class=heading  href='"+parentnam+"/index.html'>"+parentnam+"</a><br></td></tr>";
                   }
  			document.write(temp1);
  			var childs = getChilds(parentid);
  	    		for(var j=0;j<childs.length;j++)
  	    		{
      			var arr2=(childs[j].split("::"));
				var cname = arr2[1].replace(' ','_');
				if(getChilds(arr2[2]).length > 0)
 	 		 document.write("<tr ><td height=20><a class=heading1 style='padding-left:35px;' href='"+parentnam+"/"+cname+"/index.html'>"+arr2[1]+"</a></td></tr>");
	else
	 document.write("<tr><td height=20><a class=heading1 style='padding-left:35px;'  href='"+parentnam+"/"+cname+"-"+arr2[2]+"-0.php'>"+arr2[1]+"</a></td></tr>"); 
  }

  	    		document.write("<br></table></td>");
	  }

	} 
	  document.write("</tr></table>");
}
</script>

Return current item: Create Your Own Directory