<div class="col-sm-3 page-sidebar">
<aside>
<div class="inner-box">
<div class="user-panel-sidebar">
<div class="collapse-box">
<h5 class="collapse-title no-border"> My Classified <a href="#MyClassified" data-toggle="collapse" class="pull-right"><i class="fa fa-angle-down"></i></a></h5>
<div class="panel-collapse collapse in" id="MyClassified">
<ul class="acc-list">
<li><a href="<?php echo $actual_link;?>account_home"  <?php if($curpage=="account_home.php") { echo 'class="active"';} ?>><i class="icon-home"></i> Personal Home </a></li>

<li><a href="<?php echo $actual_link;?>change_pass"  <?php if($curpage=="change_pass.php") { echo 'class="active"';} ?>><i class="fa fa-key"></i>
 Change Password </a></li>
<li><a href="<?php echo $actual_link;?>post_ads"><i class="icon-docs"></i> Create New Ads 
<span class="badge"></span> </a></li>
</ul>
</div>
</div>
 
<div class="collapse-box">
<h5 class="collapse-title"> My Ads <a href="#MyAds" data-toggle="collapse" class="pull-right"><i class="fa fa-angle-down"></i></a></h5>
<div class="panel-collapse collapse in" id="MyAds">
<ul class="acc-list">
<li><a href="<?php echo $actual_link;?>myads" <?php if($curpage=="myads.php") { echo 'class="active"';} ?>><i class="icon-docs"></i> My ads 
<?php 
$sql_appr_ads1=mysql_query("select * from tbl_ads where posted_userid='".$_SESSION['cid']."' and admin_status='Approved'");
$num_appr=mysql_num_rows($sql_appr_ads1);
?>
<span class="badge"><?php echo $num_appr;?></span> </a></li>

<li><a href="<?php echo $actual_link;?>paid_ads" <?php if($curpage=="paid_ads.php") { echo 'class="active"';} ?>><i class="icon-docs"></i> My Paid ads 
<?php
$pacss=mysql_query("select * from tbl_package where amount<1");
$respacss=mysql_fetch_assoc($pacss);
 
$sql_appr_ads11=mysql_query("select * from tbl_ads where posted_userid='".$_SESSION['cid']."' and package!='".$respacss['pid']."'  and admin_status='Approved'");
$num_appr1=mysql_num_rows($sql_appr_ads11);
?>
<span class="badge"><?php echo $num_appr1;?></span> </a></li>

<li><a href="<?php echo $actual_link;?>nonpaid_ads" <?php if($curpage=="nonpaid_ads.php") { echo 'class="active"';} ?>><i class="icon-docs"></i> My Nonpaid ads 
<?php 
$sql_appr_ads12=mysql_query("select * from tbl_ads where posted_userid='".$_SESSION['cid']."' and package='".$respacss['pid']."' and admin_status='Approved'");
$num_appr2=mysql_num_rows($sql_appr_ads12);
?>
<span class="badge"><?php echo $num_appr2;?></span> </a></li>


<li><a href="<?php $actual_link;?>favourite_ads" <?php if($curpage=="favourite_ads.php") { echo 'class="active"';} ?>><i class="icon-heart"></i> Favourite ads 
<?php 
$sql_fav_ads1=mysql_query("select * from tbl_favorite where userid='".$_SESSION['cid']."'");
//$num_fav=mysql_num_rows($sql_fav_ads1);
$kl=0;
while($resfavs=mysql_fetch_assoc($sql_fav_ads1))
{
$sqlads1=mysql_query("select * from tbl_ads where ads_id='".$resfavs['ads_id']."' and admin_status!='Achieved'");
$resads1=mysql_fetch_assoc($sqlads1);

if($resads1['ads_id']>0)
{
	$kl++;
}
}

?>

<span class="badge"><?php echo $kl;?></span> </a></li>
<!--<li><a href="account-saved-search.html"><i class="icon-star-circled"></i> Saved search <span class="badge">42</span> </a></li>-->
<li><a href="<?php echo $actual_link;?>archived_ads" <?php if($curpage=="archived_ads.php") { echo 'class="active"';} ?>><i class="icon-folder-close"></i> Archived ads 
<?php 
$foradd="";
$sqlquery=mysql_query("select * from tbl_queries where querybyid='".$_SESSION['cid']."' and status='accepted'");
if(mysql_num_rows($sqlquery)>0)
{

	while($resquery=mysql_fetch_assoc($sqlquery))
	{
		$for_adid=$resquery['for_adid'];
		
		$foradd.="ads_id=".$for_adid." || ";
	}
	
	$addid=rtrim($foradd," || ");
}
else
{
	$addid="ads_id=''";
}
$sqlads=mysql_query("select * from tbl_ads where (posted_userid='".$_SESSION['cid']."' or $addid) and admin_status='Archived'");

?>

<span class="badge"><?php echo mysql_num_rows($sqlads);?></span></a></li>


<li><a href="<?php echo $actual_link;?>renew_ads"  <?php if($curpage=="renew_ads.php") { echo 'class="active"';} ?>><i class="fa fa-refresh" aria-hidden="true"></i>  Renew Ads </a></li>

</ul>
</div>
</div>
 
<div class="collapse-box">
<h5 class="collapse-title"> Terminate Account <a href="#TerminateAccount" data-toggle="collapse" class="pull-right"><i class="fa fa-angle-down"></i></a></h5>
<div class="panel-collapse collapse in" id="TerminateAccount">
<ul class="acc-list">
<li><a href="<?php echo $actual_link;?>account_close" <?php if($curpage=="account_close.php") { echo 'class="active"';} ?>><i class="icon-cancel-circled "></i> Close account </a></li>
</ul>
</div>
</div>
 
</div>
</div>
 
</aside>
</div>