<?php include("header.php");
if(!isset($_SESSION['cid']))
{
	?>
		<script>
        	window.location="<?php echo $actual_link?>index";
        </script>
	<?php
}


?>
 
<div class="main-container">
<div class="container">
<div class="row">
<?php include("profileside.php");?>
 
<div class="col-sm-9 page-content">
<div class="inner-box">
<h2 class="title-2"><i class="icon-docs"></i> My Ads </h2>
<div class="table-responsive">
<div class="table-action">
<label for="checkAll">
<input type="checkbox" onclick="checkAll(this)" id="checkAll">
Select: All | <a  class="btn btn-xs btn-danger deleteAll">Delete <i class="glyphicon glyphicon-remove "></i></a> </label>
<div class="table-search pull-right col-xs-7">
<div class="form-group">
<label class="col-xs-5 control-label text-right">Search <br>
<a title="clear filter" class="clear-filter" href="#clear">[clear]</a> </label>
<div class="col-xs-7 searchpan">
<input type="text" class="form-control" id="filter">
</div>
</div>
</div>
</div>
<table id="addManageTable" class="table table-striped table-bordered add-manage-table table demo" data-filter="#filter" data-filter-text-only="true">
<thead>
<tr>
<th data-type="numeric" data-sort-initial="true"> </th>
<th> Photo </th>
<th data-sort-ignore="true"> Adds Details </th>
<th data-type="numeric"> Price </th>
<th> Option </th>
</tr>
</thead>
<tbody>
<?php 
$pacss=mysql_query("select * from tbl_package where amount<1");
$respacss=mysql_fetch_assoc($pacss);

$sqlads=mysql_query("select * from tbl_ads where posted_userid='".$_SESSION['cid']."' and package!='".$respacss['pid']."' and admin_status='Approved'");

if(mysql_num_rows($sqlads)>0)
{

while($resads=mysql_fetch_assoc($sqlads))
{
$title = str_replace(' ', '-', $resadd['title']);
?>
<tr>
<td style="width:2%" class="add-img-selector"><div class="checkbox">
<label>
<input type="checkbox" name="adsDetails" class="adsDetails" id="<?php echo $resads['ads_id'];?>">
</label>
</div></td>
<td style="width:14%" class="add-img-td">
<a href="<?php echo $actual_link;?>ads_details/<?php echo $title;?>/<?php echo $resads['ads_id'];?>">
	<img class="thumbnail  img-responsive" src="<?php echo $actual_link."postedfile/".$resads['file1']?>" alt="img"></a></td>
<td style="width:58%" class="ads-details-td">
    <div>
        <p><strong> <a href="<?php echo $actual_link;?>ads_details/<?php echo $title;?>/<?php echo $resads['ads_id'];?>" title="<?php echo $resads['title'];?>"><?php echo ucfirst($resads['title']);?></a> </strong></p>
        <p> <strong> Posted On </strong>:
        <?php echo date('d M Y',strtotime($resads['postdate']));?> </p>
        <?php $sqllocat=mysql_query("select * from tbl_users where userid='".$_SESSION['cid']."'");
			  $reslocat=mysql_fetch_assoc($sqllocat);
			  
			  
			  $sqllcits=mysql_query("select * from tbl_cities where city_id='".$reslocat['city']."'");
			  $reslcits=mysql_fetch_assoc($sqllcits);
			  
			  
		?>
        <p> <!--<strong>Visitors </strong>: 221--> <strong>Located In:</strong> <?php echo $reslcits['cityname']?> </p>
    </div>
</td>
<td style="width:16%" class="price-td"><div><strong> <i class="fa fa-inr"></i>&nbsp; <?php echo $resads['price'];?></strong></div></td>
<td style="width:10%" class="action-td"><div>
<p><a class="btn btn-primary btn-xs" href="<?php echo $actual_link;?>post_ads/<?php echo $resads['ads_id'];?>"> <i class="fa fa-edit"></i> Edit </a></p>
<!--<p> <a class="btn btn-info btn-xs"> <i class="fa fa-mail-forward"></i> Share </a></p>-->
<p> <a class="btn btn-danger btn-xs deleteAd" id="<?php echo $resads['ads_id'];?>"> <i class=" fa fa-trash"></i> Delete </a></p>
</div></td>
</tr>

<?php }
}
else
{
	?>
		<tr align="center">
          <td colspan="5"><?php echo "No records available";?></td>
        </tr>
	<?php 
}
 ?>
</tbody>
</table>
</div>
 
</div>
</div>
 
</div>
 
</div>
 
</div>
 
<?php include("footer.php");?>
 

