<?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
	}
}
?>
  <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>Make this payout</small></h1>
 	</div>
		<?php
		$paymail1 = "SELECT `data1` FROM `Web_Gateways` WHERE `id` = '1'";
		$paymail2 = mysql_query($paymail1) or die($paymail1."<br/><br/>".mysql_error());
		$paymail3 = mysql_result($paymail2, 0);
		
		$query = "SELECT * FROM Accounts_Premium_Payments WHERE username='$session_username' LIMIT 1";
		$result = mysql_query($query) or die('Error, query failed');

			if(mysql_num_rows($result)<1){
   		}else{
     		while($row = mysql_fetch_array($result))
				{
					$cashback = $row['paypal_cashback'];
					$cashbackverified = $row['paypal_cashbackverified'];
				}
			}
		if($cashback > $cashbackverified) {
			$back = $cashback - $cashbackverified;
		?>
			<div class="jumbotron">
  				<h1>Cashback</h1>
  				<p>Amount: <?php echo $back;?> <?php echo $acu['ISO']; ?> </p>
  				<p>Send money back to email: <?php echo $paymail3;?></p>
  				<p>Gateway: PayPal</p>
  			</div>
		<?php
		}else {
		?>
			<div class="jumbotron">
  				<h1>Thank you</h1>
  				<h2>You have paid all required money back</h2>
  				<p>Cashback = Money which you won't pay (canceled withdraw)</p>
  				<p>This money you should send back to your Admin</p>
			</div>
		<?php
		}
     	?>
</div>

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