<?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_C_ADS_MANAGE"];?> <strong><?php echo $campaign['0']['adv_campaign_title'];?></strong>.
		<span class="pull-right">
			<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ad"><?php echo $LANG["WBS_C_ADS_NEW_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 $campaign['0']['adv_campaign_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_C_ADS_LINE_1"];?> <strong><?php echo $ad['0']['aau_title'];?></strong> <?php echo $LANG["WBS_C_ADS_LINE_2"];?> <a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ads?campaign=<?php echo $prepare->sanitize($_GET['campaign'],'input');?>&id=<?php echo $ad['0']['aau_id'];?>&m=yes-delete"><?php echo $LANG["WBS_C_ADS_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_C_ADS_AD_NAME"];?></th>
          <th><?php echo $LANG["WBS_C_ADS_AD_IMPRESSIONS"];?></th>
          <th><?php echo $LANG["WBS_C_ADS_CLICKS"];?></th>
          <th><?php echo $LANG["WBS_C_ADS_TOTAL_SPENT"];?></th>
          <th></th>
          <th></th>
        </tr>
      </thead>
      <tbody>


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



	<td><?php echo $ad['aaus_impressions'];?></td>
	<td><?php echo $ad['aaus_clicks'];?></td>

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

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




				<td>
<?php if ( $ad['aau_status'] == '3' ) { ?>

	<?php echo $LANG["WBS_C_ADS_DISABLE_BY_ADMIN"];?>

<?php } else { ?>
		<button id="start-<?php echo $ad['aau_id'];?>" data-id="<?php echo $ad['aau_id'];?>" type="button" class="start-ad btn btn-default btn-sm"<?php if ( $ad['aau_status'] == '1' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-play"></span> <?php echo $LANG["WBS_C_ADS_START"];?>
		</button>
<!--		
		<button id="stop-<?php echo $ad['aau_id'];?>" data-id="<?php echo $ad['aau_id'];?>" type="button" class="stop-ad btn btn-default btn-sm"<?php if ( $ad['aau_status'] == '3' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-stop"></span> Stop
		</button>
-->
		<button id="pause-<?php echo $ad['aau_id'];?>" data-id="<?php echo $ad['aau_id'];?>" type="button" class="pause-ad btn btn-default btn-sm"<?php if ( $ad['aau_status'] == '2' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-pause"></span> <?php echo $LANG["WBS_C_ADS_PAUSE"];?>
		</button>
<?php } ?>
				</td>




				<td>
	<?php if ( $ad['aau_type'] == 1 ) { ?>
						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ad?id=<?php echo $ad['aau_id'];?>"><?php echo $LANG["WBS_C_ADS_MANAGE_AD"];?></a> / 
	<?php } else { ?>
						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ad/banner?id=<?php echo $ad['aau_id'];?>"><?php echo $LANG["WBS_C_ADS_MANAGE_AD"];?></a> / 
	<?php } ?>

						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ads?campaign=<?php echo $prepare->sanitize($_GET['campaign'],'input');?>&id=<?php echo $ad['aau_id'];?>&m=delete"><?php echo $LANG["WBS_C_ADS_DELETE_AD"];?></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;?>