<?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_ADMIN_ADS_DETAILS"];?>

		<button id="start-<?php echo $ad['0']['aau_id'];?>" data-id="<?php echo $ad['0']['aau_id'];?>" type="button" class="start-ad btn btn-default btn-sm"<?php if ( $ad['0']['aau_status'] == '1' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-play"></span> <?php echo $LANG["WBS_ADMIN_ADS_DETAILS_ENABLE"];?>
		</button>	
	
		<button id="stop-<?php echo $ad['0']['aau_id'];?>" data-id="<?php echo $ad['0']['aau_id'];?>" type="button" class="stop-ad btn btn-default btn-sm"<?php if ( $ad['0']['aau_status'] == '3' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-stop"></span> <?php echo $LANG["WBS_ADMIN_ADS_DETAILS_DISABLE"];?>
		</button>
	
	
	<a class="no-decoration pull-right" href="<?php echo HTTP_SERVER_ADMIN ?>ads/filter.php?user=<?php echo $profile['0']['user_id'];?>">
		<?php echo $LANG["WBS_ADMIN_ADS_DETAILS_VIEW"];?> <?php echo $profile['0']['up_first_name'];?> <?php echo $profile['0']['up_last_name'];?> <?php echo $LANG["WBS_ADMIN_ADS_DETAILS_ADS"];?>
	</a>

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


<?php if ( $_GET['rf'] == 'reported' ) { ?>
	<div class="row"><br/></div>
<div class="col-md-12">
	<div class="alert alert-danger" role="alert"><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_MARKED_REPORTED"];?></div>
	<div class="row"></div>
	<pre>
<?php echo $LANG["WBS_ADMIN_ADS_DETAILS_NOTIFY_1"];?>

<?php echo $LANG["WBS_ADMIN_ADS_DETAILS_NOTIFY_2"];?> <button data-id="<?php echo $ad['0']['aau_id'];?>" id="remove-reported-notification" type="button" class="btn btn-danger"><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_REMOVE_NOTIFICATION"];?></button></pre>
</div>

<?php } ?>




<div class="panel-content">
<div class="row"><br/></div>

<input id="adv-max-value" type="text" value="<?php echo ( $advertiser['0']['adv_profile_deposits'] - $advertiser['0']['adv_profile_spent'] );?>" style="display:none;"/>
<input id="ad-ad_id" type="text" value="<?php echo $ad['0']['aau_id'];?>" style="display:none;"/>



<?php if ( $ad['0']['aau_type'] == '1' ) { ?>
<div class="col-md-12">
	<div style="width:460px;" class="pull-left adPreviewKeywords">
			<div id="title_1" class="title"><?php echo $ad['0']['aau_title'];?></div>
			<div id="url_1" class="url"><?php echo $ad['0']['aau_url'];?></div>
			<div id="description_1" class="description"><?php echo $ad['0']['aau_summary'];?> <?php echo $ad['0']['aau_summary_2'];?></div>
	</div>
</div>
<?php } else { ?>
<div class="col-md-12">
	<div id="adPreviewImage" class="pull-left">
		<img src="<?php echo HTTP_SERVER_WEBSITE_UPLOADS_BANNER_ADS;?><?php echo $ad['0']['aau_file'];?>"/>
	</div>
</div>
<?php } ?>


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




<div class="col-md-12">
<legend><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_KEYWORDS_LIST"];?></legend>



<table id="keywords-list" class="table table-hover">
      <thead>
        <tr>
          <th><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_KEYWORD"];?></th>
          <th><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_VALUE"];?></th>
          <th><?php echo $LANG["WBS_ADMIN_ADS_DETAILS_RECOMMENDED_VALUE"];?></th>
        </tr>
      </thead>
      <tbody>

<?php if ( !empty ( $ky ) ) { ?>

<?php foreach($ky as $k): ?>

	<tr id="keword-<?php echo $k['aauk_id'];?>">
		<td class="col-md-4">
			<?php echo $k['aauk_keyword'];?>
		</td>
		<td class="col-md-3">

<?php if ( MONEY_ALIGN == 'LEFT' ) { ?>
				<?php echo MONEY_SYMBOL;?>
<?php } ?>
				
				<?php echo $k['aauk_price'];?>

<?php if ( MONEY_ALIGN == 'RIGHT' ) { ?>
				<?php echo MONEY_SYMBOL;?>
<?php } ?>


		</td>
		<td class="col-md-2">

		<?php
			$price	=	$db->Query("select `aauk_price` from advertisers_ad_units_keywords where aauk_keyword=? and aauk_ad_id!=?","ss",$k['aauk_keyword'],$ad['0']['aau_id']);
		?>
		<?php if ( empty ( $price ) ) { ?>
			???
		<?php } else { ?>
			<?php echo $price['0']['aauk_price'] + INCREASE_VALUE; ?>
		<?php } ?>

		</td>

	</tr>

<?php endforeach; ?>

<?php } ?>

      </tbody>
</table>



</div>







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

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