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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u342410624/domains/srareauctionmarket.com/public_html/us/admin/edit-deposit.php

<?php




$pageName  = "Edit Deposit Transactions";
include($_SERVER['DOCUMENT_ROOT']."/admin/layout/header.php");

$id = $_GET['id'];
$sql = "SELECT * FROM wallet d LEFT JOIN users u ON d.username = u.username  WHERE refrence_id =:id";
$data = $conn->prepare($sql);
$data->execute([
        'id'=>$id
]);

$result = $data->fetch(PDO::FETCH_ASSOC);

$sql = "SELECT d.*, c.payment_name FROM wallet d INNER JOIN payment c ON d.payment_id = c.payment_id WHERE refrence_id='$id'";
$stmt = $conn->prepare($sql);
$stmt->execute();

$row = $stmt->fetch(PDO::FETCH_ASSOC);

$email = $result['acct_email'];



if($row['wallet_status'] == '0'){
    $tran_status = 'Processing';
}else if($row['wallet_status'] == '1'){
    $tran_status = 'Approved';
}else if($row['wallet_status']== '3'){
    $tran_status = 'Declined';
}else if($row['wallet_status']== '2') {
    $tran_status = 'On Hold';
}


if(isset($_POST['accept'])){
    $status_value = 1;
    $amount_balance = $row['amount'] + $result['balance'];
    $username = $row['username'];

    $refrence_id = $row['refrence_id'];
    $sql = "UPDATE wallet SET wallet_status=:wallet_status WHERE refrence_id=:id";
    $stmt = $conn->prepare($sql);
    $stmt->execute([
        'wallet_status' =>$status_value,
        'id'=>$id
    ]);

    if(true) {
        $sql = "UPDATE users SET balance=:balance WHERE username=:username";
        $stmt = $conn->prepare($sql);
        $stmt->execute([
            'balance' => $amount_balance,
            'username' => $username
        ]);

        if (true) { 
            $amount = $row['amount'];
            $payment_name = $row['payment_name'];
            // $APP_NAME = $pageTitle;
            
            $tran_status = "Approved";
            // $refrence_id = $row['refrence_id'];
            // $message = $sendMail->depositMsg($amount,$amount_balance, $payment_name, $APP_NAME,$tran_status,$refrence_id);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail($email, $message, $subject);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail(WEB_EMAIL, $message, $subject);

            if (true) {
                toast_alert('success', 'Deposit Approve Successfully', 'Approved');

            } else {
                toast_alert('error', 'Sorry Something Went Wrong');
            }
        }
    }
}


if(isset($_POST['decline'])){
    $status_value = 3;
    $refrence_id = $row['refrence_id'];
    $sql = "UPDATE wallet SET wallet_status=:wallet_status WHERE refrence_id=:id";
    $stmt = $conn->prepare($sql);
    $stmt->execute([
        'wallet_status' =>$status_value,
        'id'=>$id
    ]);


        if (true) { 
            $amount = $row['amount'];
            $payment_name = $row['payment_name'];
            $APP_NAME = $pageTitle;
            
            $tran_status = "Declined";
            // $refrence_id = $row['refrence_id'];
            // $message = $sendMail->depositMsg($amount,$amount_balance, $payment_name, $APP_NAME,$tran_status,$refrence_id);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail($email, $message, $subject);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail(WEB_EMAIL, $message, $subject);

        if (true) {
            toast_alert('success', 'Deposit Decline Successfully', 'Decline');

        } else {
            toast_alert('error', 'Sorry Something Went Wrong');
        }
    }
}

if(isset($_POST['hold'])){
        $status_value = 2;
    $refrence_id = $row['refrence_id'];
    $sql = "UPDATE wallet SET wallet_status=:wallet_status WHERE refrence_id=:id";
    $stmt = $conn->prepare($sql);
    $stmt->execute([
        'wallet_status' =>$status_value,
        'id'=>$id
    ]);


        if (true) { 
            $amount = $row['amount'];
            $payment_name = $row['payment_name'];
            $APP_NAME = $pageTitle;
            
            $tran_status = "Hold";
            // $refrence_id = $row['refrence_id'];
            // $message = $sendMail->depositMsg($amount,$amount_balance, $payment_name, $APP_NAME,$tran_status,$refrence_id);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail($email, $message, $subject);
            // $subject = "[DEPOSIT APPROVED] - $APP_NAME";
            // $email_message->send_mail(WEB_EMAIL, $message, $subject);


        if (true) {
            toast_alert('success', 'Deposied on Hold Successfully', 'Hold');
            // header("location:./dashboard.php");

        } else {
            toast_alert('error', 'Sorry Something Went Wrong');
        }
    }
}



?>



<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Edit Deposit Transactions 
        </h1>
        <ol class="breadcrumb">
            <li><a href="./dashboard"><i class="fa fa-dashboard"></i> Dashboard</a></li>
        </ol>
    </section>



    <!-- Main content -->
    <section class="content">

        <!-- SELECT2 EXAMPLE -->
        <div class="box box-default">
            <form method="POST">
                <div class="box-header with-border">
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i
                                class="fa fa-minus"></i></button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="row">
                    
                        <div class="col-md-6">
                            
                            <table class="table table-bordered mb-4">
                                                <tbody>
                                                <tr>
                                                    <th>Name</th>
                                                    <th><?= $result['username'] ?></th>
                                                </tr>
                                                <tr>
                                                    <th>Amount</th>
                                                    <th>$<?=$row['amount'] ?></th>
                                                </tr>

                                                <tr>
                                                    <th>Transaction ID</th>
                                                    <th><?= $row['refrence_id'] ?></th>
                                                </tr>

                                                <tr>
                                                    <th>Wallet Address</th>
                                                    <th><?= $row['wallet_address'] ?></th>
                                                </tr>
                                                
                                                </tbody>
                                            </table>
                            
                            
                            <!-- /.form-group -->
                        </div>
                        <!-- /.col -->
                        <div class="col-md-6">
                            
                            <table class="table table-bordered mb-4">
                                                <tbody>
                                                
                                                <tr>
                                                    <th>Crypto Name</th>
                                                    <th><?= $row['payment_name'] ?></th>
                                                </tr>
                                                <tr>
                                                    <th>Receipt</th>
                                                    <th><?php
                                                        if(empty($row['image'])) {
                                                            echo "<p>No Receipt Submitted</p>"
                                                        ?>
                                                        <?php
                                                        }
                                                        ?>

                                                        <a href="../assets/front/img/uploads/<?=$row['image']?>" target="_blank"><img src="../assets/front/img/uploads/<?=$row['image']?>" width="20%" alt=""></a>
                                                    </th>

                                                </tr>
                                                <tr>
                                                    <th>Created At</th>
                                                    <th><?= $row['createdAt'] ?></th>
                                                </tr>
                                                <tr>
                                                    <th>Status</th>
                                                    <th><?= $tran_status ?></th>
                                                </tr>
                                                </tbody>
                                            </table>
                            
                            

                        </div>
                        <!-- /.col -->
                    </div>
                    <!-- /.row -->
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <button type="submit" name="accept" class="btn btn-success">Accept</button>
                
                    <button type="submit" name="hold" class="btn btn-warning">Hold</button></form>
                    <button type="submit" name="decline" class="btn btn-danger">Decline</button>
                    
          
        </div>
        </form>
</div>
<!-- /.box -->




</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->



<?php
include($_SERVER['DOCUMENT_ROOT']."/admin/layout/footer.php");

?>
Back to Directory=ceiIENDB`