<?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_ADVERTISER_CAMPAIGNS_TITLE"];?>
		<span class="pull-right">
			<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/campaign"><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_NEW"];?></a>
		</span>
	</div>

<div class="panel-content">

<?php if ( !empty ( $campaign ) ) { ?>
	<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_ADVERTISER_CAMPAIGNS_REMOVE_LINE_1"];?> <strong><?php echo $campaign['0']['adv_campaign_title'];?></strong> <?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_REMOVE_LINE_2"];?> <a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/campaigns?id=<?php echo $campaign['0']['adv_campaign_id'];?>&m=yes-delete"><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_REMOVE_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_ADVERTISER_CAMPAIGNS_NAME"];?></th>
          <th><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_DAILY_BUDGET"];?></th>
          <th><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_STATUS"];?></th>
          <th><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_OPTION"];?></th>
        </tr>
      </thead>
      <tbody>


			<?php if ( !empty ( $campaigns ) ) { ?>
			<?php foreach($campaigns as $campaign): ?>
				<tr>
				  <td><?php echo $campaign['adv_campaign_title'];?></td>


<?php if ( MONEY_ALIGN == 'LEFT' ) { ?>
	<td><?php echo MONEY_SYMBOL;?> <?php echo $campaign['adv_campaign_daily_budget'];?></td>
<?php } ?>

<?php if ( MONEY_ALIGN == 'RIGHT' ) { ?>
	<td><?php echo $campaign['adv_campaign_daily_budget'];?> <?php echo MONEY_SYMBOL;?></td>
<?php } ?>


				<td>
	<?php if ( ( $advertiser['0']['adv_profile_deposits'] - $advertiser['0']['adv_profile_spent'] ) > 0 ) { ?>

		<!--<button type="button" class="btn btn-default btn-sm"<?php if ( $campaign['adv_campaign_status'] == '2' ) { ?> disabled<?php } ?>><span class="glyphicon glyphicon-stop"></span> <?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_STOP"];?></button>-->


		<button id="start-<?php echo $campaign['adv_campaign_id'];?>" data-id="<?php echo $campaign['adv_campaign_id'];?>" type="button" class="start-campaign btn btn-default btn-sm"<?php if ( $campaign['adv_campaign_status'] == '1' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-play"></span> <?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_START"];?>
		</button>


		<button id="pause-<?php echo $campaign['adv_campaign_id'];?>" data-id="<?php echo $campaign['adv_campaign_id'];?>" type="button" class="pause-campaign btn btn-default btn-sm"<?php if ( $campaign['adv_campaign_status'] == '2' ) { ?> disabled<?php } ?>>
			<span class="glyphicon glyphicon-pause"></span> <?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_PAUSE"];?>
		</button>


	<?php } else { ?>
		<?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_ADD_MONEY"];?>
	<?php } ?>
				</td>




				<td>

						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/ads?campaign=<?php echo $campaign['adv_campaign_id'];?>"><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_VIEW_ADS"];?></a> / 
						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/campaign?id=<?php echo $campaign['adv_campaign_id'];?>"><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_MANAGE_CAMPAIGN"];?></a> / 
						<a href="<?php echo HTTP_SERVER_WEBSITE;?>dashboard/advertiser/campaigns?id=<?php echo $campaign['adv_campaign_id'];?>&m=delete"><?php echo $LANG["WBS_ADVERTISER_CAMPAIGNS_DELETE_CAMPAIGN"];?></a>

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


      </tbody>
</table>

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

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

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