<?php
// INCLUDE HEADER IN PAGE
include('other_header.php');
// GET CURRENT DATE AND TIME
$date = date('Y-m-d H:i:s');
if(isset($_POST['success'])) {
	if($_POST['success'] == 'loggedin') {
	?>
	<div style="margin-top: -80px;" class="alert alert-success" role="alert">
		<strong>Well done!</strong> Successfully logged in.
	</div>
	<?php
	}
}
			$query = "SELECT * FROM Web_Withdraws WHERE manager_username='$session_username'";
			$result = mysql_query($query) or die('Error, query failed');

			// print the random numbers
			$waiting = 0;
   		$paid = 0;
   		$canceled = 0;
			if(mysql_num_rows($result)<1){
   		}else{
     		while($row = mysql_fetch_array($result))
				{
					$status = $row['status'];
				}
       	}
       	
       	$query = "SELECT * FROM Accounts_Premium_Payments WHERE username='$session_username'";
			$result = mysql_query($query) or die('Error, query failed');
			if(mysql_num_rows($result)<1){
   		}else{
     		while($row = mysql_fetch_array($result))
				{
					$got = $row['got'];
					$totallypaid = $row['paid'];
					$ip = $row['ip'];
					if(!isset($got)) {
						$got = 0;
					}
					if(empty($totallypaid)) {
						$totallypaid = 0;
					}
					if(empty($ip)) {
						$ip = 'Not set';
					}
				}
       	}
?>
  <div class="container">
    <div class="text-center">
      <h1><?php echo $title; ?>
      	<small>/Active is: Admin Account
			</small>
		</h1>
 	 </div>
		</br>
	<div class="text-center">
      <h1><small>Start with Payout</small></h1>
 	</div>
	<div class="btn-group btn-group-justified">
  		<?php 
						$query = "SELECT * FROM Web_Gateways WHERE active_withdraw = '1'";
						$result = mysql_query($query) or die('Error, query failed');
						if(mysql_num_rows($result)>0)
   					{
     						while($row = mysql_fetch_array($result))
							{
							?>
									<a class="btn btn-default" href="payments.<?php echo $row['phpname']; ?>">
										<span class="badge">
											<?php 
											if($row['id'] == '1'){
												$labelactual = $labelpaypal;
											}
											if($row['id'] == '2'){
												$labelactual = $labelpayza;
											}
											if($row['id'] == '5'){
												$labelactual = $labelskrill;
											}
											echo $labelactual; 
											?>
										</span>
										<?php echo $row['name']; ?> 
									</a>
							<?php
							}
						}
					?>
	</div>	
	<div class="text-center">
      <h1><small>Start with Cashback</small></h1>
 	</div>
	<div class="btn-group btn-group-justified">
  		<?php 
						$query = "SELECT * FROM Web_Gateways WHERE active_withdraw = '1'";
						$result = mysql_query($query) or die('Error, query failed');
						if(mysql_num_rows($result)>0)
   					{
     						while($row = mysql_fetch_array($result))
							{
							?>
									<a class="btn btn-default" href="payments.Cashback<?php echo $row['phpname']; ?>">
										<span class="badge">
											<?php 
											if($row['id'] == '1'){
												$labelactual = $labelcashbackpp;
											}
											if($row['id'] == '2'){
												$labelactual = $labelcashbackpz;
											}
											if($row['id'] == '5'){
												$labelactual = $labelcashbacksk;
											}
											echo $labelactual; 
											?>
										</span>
										<?php echo $row['name']; ?> 
									</a>
							<?php
							}
						}
					?>
	</div>	
	<div class="text-center">
      <h1><small>Publisher's account</small></h1>
 	</div>
		<div class="col-sm-4">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Waiting to be paid</h3>
            </div>
            <div class="panel-body">
            	<?php echo $waiting;?>
            </div>
          </div>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Received money</h3>
            </div>
            <div class="panel-body">
            	<?php echo $got;?>
            </div>
          </div>
        </div>
        <div class="col-sm-4">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Paid</h3>
            </div>
            <div class="panel-body">
            	<?php echo $paid;?>
            </div>
          </div>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Totally paid</h3>
            </div>
            <div class="panel-body">
            	<?php echo $totallypaid;?>
            </div>
          </div>
        </div>
        <div class="col-sm-4">
        	<div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Canceled</h3>
            </div>
            <div class="panel-body">
            	<?php echo $canceled;?>
            </div>
          </div>
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Your IP</h3>
            </div>
            <div class="panel-body">
            	<?php echo $ip;?>
            </div>
          </div>
        </div>
       
</div>

<?php
include('other_footer.php');
?>
