<?php
require_once("../../app/config.php");
$trx=$_GET['id'];
$data = mysqli_fetch_array(mysqli_query($dbc, "SELECT * FROM deposits WHERE trx='$trx'"));
$gatewayData=mysqli_fetch_array(mysqli_query($dbc,"SELECT * FROM gateways WHERE id='".$data['gateway_id']."'"));
$user = mysqli_fetch_array(mysqli_query($dbc, "SELECT * FROM users WHERE id='".$data['user_id']."'"));
?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php $set['site_name'];?></title>
</head>

<body>
<form action="https://perfectmoney.is/api/step1.asp" method="POST" id="payment_form">
    <input type="hidden" name="PAYEE_ACCOUNT" value="<?php echo $gatewayData['val1'];?>">
    <input type="hidden" name="PAYEE_NAME" value="<?php echo $set['site_name'];?>">
    <input type="hidden" name="PAYMENT_ID" value="<?php echo $trx;?>">
    <input type="hidden" name="PAYMENT_AMOUNT" value="<?php echo $data['amount'];?>">
    <input type="hidden" name="PAYMENT_UNITS" value="<?php echo $scan2['currency'];?>">
    <input type="hidden" name="STATUS_URL" value="<?php echo $url.'/app/payment?id=ipnperfect';?>">
    <input type="hidden" name="PAYMENT_URL" value="<?php echo $url.'/user/fund/1';?>">
    <input type="hidden" name="PAYMENT_URL_METHOD" value="POST">
    <input type="hidden" name="NOPAYMENT_URL" value="<?php echo $url.'/user/fund/1';?>">
    <input type="hidden" name="NOPAYMENT_URL_METHOD" value="POST">
    <input type="hidden" name="SUGGESTED_MEMO" value="<?php echo $user['username'];?>">
    <input type="hidden" name="BAGGAGE_FIELDS" value="IDENT"><br>
</form>

<script>
    document.getElementById("payment_form").submit();
</script>
</body>

</html>

