<?php 
$sql=db_query("select * from tbl_country where country_status=1 and parent_childs='0' ");
while($res=mysqli_fetch_array($sql))
{
?>
<h4 class="accordion"><?php echo stripslashes($res['country_name']); ?><span style="float:right;">+</span></h4>
<div class="panel"  id="opencon<?php echo stripslashes($res['country_id']); ?>">
<ul>
<?php 
$sql_pc=db_query("select * from tbl_country where country_status=1 and parent_childs='".stripslashes($res['country_id'])."' ");
while($res_pc=mysqli_fetch_array($sql_pc))
{
$spCountry=str_replace(' ','-',trim(strtolower($res_pc['country_url'])));
?><li><a href="<?php echo SITE_WS_PATH.'/'.$spCountry; ?>">
<?php echo stripslashes($res_pc['country_name']); ?></a></li>
<?php } ?>  
</ul>                            
</div>
<?php } ?>