<?php echo $header;?>
<div id="dashboard">
	<div class="container">
<div class="row"><br/></div>
<div class="panel">

	<div class="panel-header">
			<?php echo $LANG["WBS_PUB_ADS_MANAGE_ADS"];?> <strong><?php echo $channel['0']['pc_title'];?></strong> ( <?php echo $channel['0']['pc_domain'];?> ).
		<span class="pull-right">
			<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/publisher/ad"><?php echo $LANG["WBS_PUB_ADS_CREATE_AD"];?></a>
		</span>
	</div>
	
<div class="panel-content">
<div class="row"><br/></div>
<div class="col-md-12">
<div class="row"></div>
	<blockquote><?php echo $channel['0']['pc_details'];?></blockquote>
</div>





<?php if ( !empty ( $ad ) ) { ?>
	<div class="row"></div>
	<div class="col-md-12">
		<div class="alert alert-danger" role="alert">
		<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only"></span></button>
			  <?php echo $LANG["WBS_PUB_ADS_RMV_LINE_1"];?> <strong><?php echo $ad['0']['pau_name'];?></strong> <?php echo $LANG["WBS_PUB_ADS_RMV_LINE_2"];?> <a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/publisher/ads?channel=<?php echo $prepare->sanitize($_GET['channel'],'input');?>&id=<?php echo $ad['0']['pau_id'];?>&m=yes-delete"><?php echo $LANG["WBS_PUB_ADS_RMV_LINE_3"];?></a>
		</div>
	</div>
	<div class="row"></div>
<?php } ?>





<div id="campaigns-list" class="col-md-12">


<table class="table">
      <thead>
        <tr>
          <th><?php echo $LANG["WBS_PUB_ADS_AD_NAME"];?></th>
          <th><?php echo $LANG["WBS_PUB_ADS_AD_IMPRESSIONS"];?></th>
          <th><?php echo $LANG["WBS_PUB_ADS_AD_CLICKS"];?></th>
          <th><?php echo $LANG["WBS_PUB_ADS_AD_TOTAL_RECEIVED"];?></th>
          <th></th>
        </tr>
      </thead>
      <tbody>


			<?php if ( !empty ( $ads ) ) { ?>
			<?php foreach($ads as $ad): ?>
				<tr>
				  <td><?php echo $prepare->utf_substr($ad['pau_name'],30);?></td>



	<td><?php echo $ad['paus_impressions'];?></td>
	<td><?php echo $ad['paus_clicks'];?></td>

<?php if ( MONEY_ALIGN == 'LEFT' ) { ?>
	<td><?php echo MONEY_SYMBOL;?> <?php echo sprintf(NUMBER_FORMAT, $ad['paus_money']);?></td>
<?php } ?>

<?php if ( MONEY_ALIGN == 'RIGHT' ) { ?>
	<td><?php echo sprintf(NUMBER_FORMAT, $ad['paus_money']);?> <?php echo MONEY_SYMBOL;?></td>
<?php } ?>




				<td>
						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/publisher/ad?id=<?php echo $ad['pau_id'];?>"><?php echo $LANG["WBS_PUB_ADS_AD_MANAGE"];?></a> / 

						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/publisher/ads?channel=<?php echo $prepare->sanitize($_GET['channel'],'input');?>&id=<?php echo $ad['pau_id'];?>&m=delete"><?php echo $LANG["WBS_PUB_ADS_AD_DELETE"];?></a>

				</td>
				</tr>
			<?php endforeach; ?>
			<?php } ?>


      </tbody>
</table>

<?php if ( $paginator['rows'] > 10 ) { ?>
<div class="row"></div>
	<?php echo $paginator['pager'];?>
<?php } ?>


<div class="row"></div>
<div class="pull-right">
	<?php echo $paginator['pager'];?>
</div>

</div>
<div class="row"><br/></div>
</div>

</div>
</div>
</div>
<?php echo $footer;?>