<?php
/**
 * deposit.php -- Deposit page
 */

include '../inc/config.inc.php'; // Configuration

ob_start();
session_start();

//date_default_timezone_set('Africa/Lagos');

error_reporting(E_ALL);
ini_set('display_errors', 1);

if ( !isset($_SESSION['user']) || $_SESSION["loggedin"] !== true || trim($_SESSION['user']) == '' ){
	header('Location: ' . $BASE_URL . 'signin');
	exit;
}

// User Details
$stmt = $db_con->prepare("SELECT * FROM users WHERE id=:user_id");
$stmt->execute(array(":user_id"=>$_SESSION['user']));
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);

// Admin Details
$getAdmin = $db_con->prepare("SELECT * FROM admin WHERE id=2"); // view details for only 2nd admin
$getAdmin->execute();
$adminRow = $getAdmin->fetch(PDO::FETCH_ASSOC);

?>

<!doctype html>
<html lang="en-uk">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">-->
    <meta name="description" content="">
    <meta name="keywords" content="investment, Forex, Trading, Bitcoin, Cryptocurrency, Global investment, Live Trade, Trading class, indics">
    <meta name="author" content="Paul HubWeb & Tech">
    <meta name="theme-color" content="#313131" />
    <!-- Site Properties -->
    <title>Deposit Funds - Acesignal</title>
    <link rel="shortcut icon" href="../img/Signals-Alert-3.png" type="image/x-icon" />
    <link rel="apple-touch-icon-precomposed" href="../img/Signals-Alert-3.png" />
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Typography CSS -->
    <link rel="stylesheet" href="css/typography.css">
    <!-- Style CSS -->
    <link rel="stylesheet" href="css/style.css">
    <!-- Responsive CSS -->
    <link rel="stylesheet" href="css/responsive.css">
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }

        .header {
            overflow: none;
            background-color: none;
            padding: 20px 10px;
            padding-left: 5px;
            position: fixed;
        }

                /*.header a {
        float: center;
        width:30px;
        color: #fff;
        text-align: center;
        padding: 12px;
        text-decoration: none;
        font-size: 18px; 
        line-height: 25px;
        border-radius: 4px;
        background-color:rgb(196, 0, 0);
        border-color: rgb(196, 0, 0);
        }*/

        .header a.logo {
            font-size: 25px;
            font-weight: bold;
        }

                /*.header a:hover {
        background-color:  #010847;
        color: #fff;
        }*/

                /*.header a.active {
        background-color: dodgerblue;
        color: white;
        }*/

        .header-center {
            float: left;
        }

        @media screen and (max-width: 500px) {
            .header a {
                float: none;
                display: block;
                text-align: left;
            }

            .header-right {
                float: none;
            }
        }
    </style>

    <script src="../plugins/sweetalerts/promise-polyfill.js"></script>
    <link href="../plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" rel="stylesheet" />
    <style>
        /*------ Google Font Style ------ */
        body {font-family:'Roboto'!important;}
    </style>

</head>
<body class="sidebar-main-active right-column-fixed">
    <!-- loader Start -->
    <!-- loader END -->
    <!-- Wrapper Start -->
    <div class="wrapper">
<?php include 'navbar2.php' ?>
        <!-- Page Content  -->
        <div id="content-page" class="content-page">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12 col-lg-9">
                        <div class="iq-card">
                            <div class="iq-card">
                                <div class="iq-card-header d-flex justify-content-between">
                                    <div class="iq-header-title">
                                        <h4 class="card-title" style="font-family: 'Roboto'!important;">Deposit</h4>
                                    </div>
                                </div>
                                <div class="iq-card-body">
                                    <p style="font-size:40px;"><b>Deposit Method</b></p>
                                    <form action="" method="post" autocomplete="off" id="withdrawal-form" class="was-validated" enctype="multipart/form-data">
                                        <div class="form-group">
                                            <select name="depositmethod" id="withdrawalMethod" class="form-control" required>
                                                <option value="" style="font-size:30px;"><b>---Select Method---</b></option>
                                                <option value="Bitcoin">Bitcoin</option>
                                                <option value="Ethereum">Ethereum</option>
                                                <option value="Litecoin">USDT</option>
                                                <option value="BitcoinCash">BitcoinCash</option>
                                                <!--<option value="Paypal">Paypal</option>-->
                                            </select>
                                        </div>
                                        <div id="field1" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Bitcoin Wallet barcode</label><br>
                                            <img src="../wp-admin/uploads/<?= $adminRow['bitcoin_file']; ?>" alt="bitcoin code" style="max-width:40%;">
                                        </div>
                                        <div id="field12" class="mb-3" style="display: None;">
                                            <label for="validationDefault01">BTC Wallet Address</label>
                                            <input type="text" class="form-control" id="validationDefault01" value="<?= $adminRow['bitcoin_address']; ?>" disabled>
                                        </div>
                                        <div id="field2" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Ethereum Wallet barcode</label><br>
                                            <img src="../wp-admin/uploads/<?= $adminRow['ethereum_file']; ?>" alt="Ethereum code" style="max-width:40%;">
                                        </div>
                                        <div id="field13" class="mb-3" style="display: None;">
                                            <label for="validationDefault01">Ethereum Wallet Address</label>
                                            <input type="text" class="form-control" id="validationDefault01" value="<?= $adminRow['ethereum_address']; ?>" disabled>
                                        </div>
                                        <div id="field3" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">USDT Wallet Barcode</label><br>
                                            <img src="../wp-admin/uploads/<?= $adminRow['litecoin_file']; ?>" alt="LiteCoin code" style="max-width:40%;">
                                        </div>
                                        <div id="field14" class="mb-3" style="display: None;">
                                            <label for="validationDefault01">USDT Wallet Address</label>
                                            <input type="text" class="form-control" id="validationDefault01" value="<?= $adminRow['litecoin_address']; ?>" disabled>
                                        </div>
                                        <div id="field4" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">BitcoinCash Wallet Barcode</label><br>
                                            <img src="../wp-admin/uploads/<?= $adminRow['bitcoincash_file']; ?>" alt="BitcoinCash code" style="max-width:40%;">
                                        </div>
                                        <div id="field15" class="mb-3" style="display: None;">
                                            <label for="validationDefault01">BitcoinCash Wallet Address</label>
                                            <input type="text" class="form-control" id="validationDefault01" value="<?= $adminRow['bitcoincash_address']; ?>" disabled>
                                        </div>
                                        <!--<div id="field5" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Skrill Email</label>
                                            <input type="text" class="form-control is-invalid" id="address" id="validationTextarea" placeholder="Skrill Email" required>
                                        </div>-->
                                        <div id="field6" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">PayPal Payment</label>
                                            <div id="smart-button-container">
                                                <div style="text-align: center"><label for="description">Deposit </label><input type="text" name="descriptionInput" id="description" maxlength="127" value=""></div>
                                                <p id="descriptionError" style="visibility: hidden; color:red; text-align: center;">Please enter a description</p>
                                                <div style="text-align: center"><label for="amount">input Amount </label><input name="amountInput" type="number" id="amount" value=""><span> GBP</span></div>
                                                <p id="priceLabelError" style="visibility: hidden; color:red; text-align: center;">Please enter a price</p>
                                                <div id="invoiceidDiv" style="text-align: center; display: none;"><label for="invoiceid"> </label><input name="invoiceid" maxlength="127" type="text" id="invoiceid" value=""></div>
                                                <p id="invoiceidError" style="visibility: hidden; color:red; text-align: center;">Please enter an Invoice ID</p>
                                                <div style="text-align: center; margin-top: 0.625rem;" id="paypal-button-container"></div>
                                            </div>
                                            <script src="https://www.paypal.com/sdk/js?client-id=sb&currency=GBP" data-sdk-integration-source="button-factory"></script>
                                            <script>
                                                function initPayPalButton() {
                                                    var description = document.querySelector('#smart-button-container #description');
                                                    var amount = document.querySelector('#smart-button-container #amount');
                                                    var descriptionError = document.querySelector('#smart-button-container #descriptionError');
                                                    var priceError = document.querySelector('#smart-button-container #priceLabelError');
                                                    var invoiceid = document.querySelector('#smart-button-container #invoiceid');
                                                    var invoiceidError = document.querySelector('#smart-button-container #invoiceidError');
                                                    var invoiceidDiv = document.querySelector('#smart-button-container #invoiceidDiv');

                                                    var elArr = [description, amount];

                                                    if (invoiceidDiv.firstChild.innerHTML.length > 1) {
                                                        invoiceidDiv.style.display = "block";
                                                    }

                                                    var purchase_units = [];
                                                    purchase_units[0] = {};
                                                    purchase_units[0].amount = {};

                                                    function validate(event) {
                                                        return event.value.length > 0;
                                                    }

                                                    paypal.Buttons({
                                                        style: {
                                                            color: 'gold',
                                                            shape: 'rect',
                                                            label: 'paypal',
                                                            layout: 'vertical',

                                                        },

                                                        onInit: function(data, actions) {
                                                            actions.disable();

                                                            if (invoiceidDiv.style.display === "block") {
                                                                elArr.push(invoiceid);
                                                            }

                                                            elArr.forEach(function(item) {
                                                                item.addEventListener('keyup', function(event) {
                                                                    var result = elArr.every(validate);
                                                                    if (result) {
                                                                        actions.enable();
                                                                    } else {
                                                                        actions.disable();
                                                                    }
                                                                });
                                                            });
                                                        },

                                                        onClick: function() {
                                                            if (description.value.length < 1) {
                                                                descriptionError.style.visibility = "visible";
                                                            } else {
                                                                descriptionError.style.visibility = "hidden";
                                                            }

                                                            if (amount.value.length < 1) {
                                                                priceError.style.visibility = "visible";
                                                            } else {
                                                                priceError.style.visibility = "hidden";
                                                            }

                                                            if (invoiceid.value.length < 1 && invoiceidDiv.style.display === "block") {
                                                                invoiceidError.style.visibility = "visible";
                                                            } else {
                                                                invoiceidError.style.visibility = "hidden";
                                                            }

                                                            purchase_units[0].description = description.value;
                                                            purchase_units[0].amount.value = amount.value;

                                                            if (invoiceid.value !== '') {
                                                                purchase_units[0].invoice_id = invoiceid.value;
                                                            }
                                                        },

                                                        createOrder: function(data, actions) {
                                                            return actions.order.create({
                                                                purchase_units: purchase_units,
                                                            });
                                                        },

                                                        onApprove: function(data, actions) {
                                                            return actions.order.capture().then(function(details) {
                                                                alert('Transaction completed by ' + details.payer.name.given_name + '!');
                                                            });
                                                        },

                                                        onError: function(err) {
                                                            console.log(err);
                                                        }
                                                    }).render('#paypal-button-container');
                                                }
                                                initPayPalButton();
                                            </script>
                                        </div>
                                        <!--<div id="field7" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Bank Name</label>
                                            <input type="text" class="form-control is-invalid" id="address" id="validationTextarea" placeholder="Bank Name" required>
                                        </div>
                                        <div id="field8" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Account Number</label>
                                            <input type="text" class="form-control is-invalid" id="address" id="validationTextarea" placeholder="Account Number" required>
                                        </div>
                                        <div id="field9" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Country</label>
                                            <input type="text" class="form-control is-invalid" id="address" id="validationTextarea" placeholder="Country" required>
                                        </div>
                                        <div id="field10" class="mb-3" style="display: None;">
                                            <label for="validationTextarea">Swift Code</label>
                                            <input type="text" class="form-control is-invalid" id="address" id="validationTextarea" placeholder="Swift Code" required>
                                        </div>-->
                                        <div class="mb-3">
                                            <label for="validationTextarea">Amount (<?= $userRow['currency']; ?>)</label>
                                            <input type="text" class="form-control is-invalid" name="amount" placeholder="Amount without (<?= $userRow['currency']; ?>)" required>
                                        </div>
                                        <div class="form-group">
                                            <label>Upload Your Proof of payment:</label>
                                            <input type="file" class="form-control" name="depositProof" accept="image/*" required>
                                        </div>
                                        <div class="mb-3">
                                            <label for="validationTextarea">Description</label>
                                            <textarea class="form-control is-invalid" id="validationTextarea" name="narration" placeholder="Narration" required></textarea>
                                        </div>
                                        <div class="form-group">
                                            <button class="btn btn-primary" name="deposit" type="submit">Submit form</button>
                                        </div>
                                    </form>
                                    <?php
                                    if ( isset($_POST['deposit']) ){
                                        error_reporting(E_ALL);

                                        $depositmethod = $_POST['depositmethod'];
                                        $amount = $_POST['amount'];
                                        $narration = $_POST['narration'];
                                        $time = date('H:i:s');
                                        $date = date('Y/m/d');
                                        $created = date('Y-m-d H:i:s');

                                        $targetDir = "uploads/"; // Directory to save in uploads
                                        $allowedExts = array('jpg', 'jpeg', 'png'); // Allowed File Types

                                        if ( !empty($_FILES['depositProof']['name']) ){
                                            $extDepositProof = pathinfo(basename($_FILES['depositProof']['name']), PATHINFO_EXTENSION); // Get the extension
                                            if ( !in_array(strtolower($extDepositProof), $allowedExts) ){
                                    ?>
                                                <script>
                                                    setTimeout(function(){
                                                        noticePop('Invalid File Type. Upload an Image.', 'error');
                                                    }, 2000);
                                                </script>
                                    <?php
                                            } else {
                                                $newDepositProof = 'deposit_' . randDoc($extDepositProof); // Randomization

                                                $insert = "INSERT INTO user_transactions(user_id, fullname, type, method, amount, file, narration, time, date, created) VALUES ('".$userRow['id']."', '".$userRow['fullname']."', 'Deposit', '$depositmethod', '$amount', '$newDepositProof', '$narration', '$time', '$date', '$created')";

                                                /*if ( file_exists($target_dir) ){
                                                    echo 'Dir Exists<br>';
                                                } else { echo 'Does not exits<br>'; }
                                                if ( is_writable($target_dir) ){
                                                    echo 'Dir is writable<br>';
                                                } else { echo 'Dir not writable<br>'; }*/
                                                if ( move_uploaded_file($_FILES['depositProof']['tmp_name'], $targetDir . $newDepositProof) ){
                                                    $db_con->exec($insert);
                                                    //$trans_id = $db_con->lastInsertId();

                                                    //$updateLastDeposit = $db_con->prepare("UPDATE user_last_deposit SET amount='$amount', trans_id='$trans_id', status='Pending' WHERE user_id='".$userRow['id']."'");
                                                    //$updateLastDeposit->execute();
                                    ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('Deposit Proof (<?= $depositmethod; ?>) Has Been Sent. Await Confirmation.', 'success');
                                                        }, 2000);
                                                    </script>
                                    <?php
                                                } else {
                                    ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('Something Went Wrong. Try again.', 'error');
                                                        }, 2000);
                                                    </script>
                                    <?php
                                                }
                                            }
                                        } else {
                                    ?>
                                            <script>
                                                setTimeout(function(){
                                                    noticePop('Proof of Payment Must Be Selected for Upload.', 'error');
                                                }, 2000);
                                            </script>
                                    <?php
                                        }
                                    }
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Wrapper END -->
    <?php include 'footer.php' ?>
    <!-- Optional JavaScript -->
    <script src="../plugins/jquery-3.1.1.min.js"></script>
    <script src="../plugins/sweetalerts/sweetalert2.min.js"></script>
    <script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>

    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <!--<script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>-->
    <script src="js/bootstrap.min.js"></script>
    <!-- Appear JavaScript -->
    <script src="js/jquery.appear.js"></script>
    <!-- Countdown JavaScript -->
    <script src="js/countdown.min.js"></script>
    <!-- Counterup JavaScript -->
    <script src="js/waypoints.min.js"></script>
    <script src="js/jquery.counterup.min.js"></script>
    <!-- Wow JavaScript -->
    <script src="js/wow.min.js"></script>
    <!-- Apexcharts JavaScript -->
    <script src="js/apexcharts.js"></script>
    <!-- Slick JavaScript -->
    <script src="js/slick.min.js"></script>
    <!-- Select2 JavaScript -->
    <script src="js/select2.min.js"></script>
    <!-- Owl Carousel JavaScript -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- Magnific Popup JavaScript -->
    <script src="js/jquery.magnific-popup.min.js"></script>
    <!-- Smooth Scrollbar JavaScript -->
    <script src="js/smooth-scrollbar.js"></script>
    <!-- lottie JavaScript -->
    <script src="js/lottie.js"></script>
    <!-- am core JavaScript -->
    <script src="js/core.js"></script>
    <!-- am charts JavaScript -->
    <script src="js/charts.js"></script>
    <!-- am animated JavaScript -->
    <script src="js/animated.js"></script>
    <!-- am kelly JavaScript -->
    <script src="js/kelly.js"></script>
    <!-- am maps JavaScript -->
    <script src="js/maps.js"></script>
    <!-- am worldLow JavaScript -->
    <script src="js/worldLow.js"></script>
    <!-- Style Customizer -->
    <script src="js/style-customizer.js"></script>
    <!-- Chart Custom JavaScript -->
    <script src="js/chart-custom.js"></script>
    <!-- Custom JavaScript -->
    <script src="js/custom.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#withdrawalMethod").change(function() {
                if ($(this).val() == "Bitcoin") {
                    $("#field1").fadeIn();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").fadeIn();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Bitcoin");
                    //$('#amount-fees').val('2%')

                } else if ($(this).val() == "Ethereum") {
                    $("#field2").fadeIn();
                    $("#field1").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").fadeIn();
                    $("#field14").hide();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Ethereum");
                    //$('#amount-fees').val('4%')
                } else if ($(this).val() == "Litecoin") {
                    $("#field3").fadeIn();
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").fadeIn();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Litecoin");
                    //$('#amount-fees').val('4%')
                } else if ($(this).val() == "BitcoinCash") {
                    $("#field4").fadeIn();
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").fadeIn();
                    $('#wallet-number').attr("placeholder", "BitcoinCash");
                    //$('#amount-fees').val('4%')
                } else if ($(this).val() == "Skrill") {
                    $("#field5").fadeIn();
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Skrill");
                    //$('#amount-fees').val('3%')
                } else if ($(this).val() == "Paypal") {
                    $("#field6").fadeIn();
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Paypal");
                    //$('#amount-fees').val('2%')
                } else if ($(this).val() == "Bank Transfer") {
                    $("#field7").fadeIn();
                    $("#field8").fadeIn();
                    $("#field9").fadeIn();
                    $("#field10").fadeIn();
                    $("#field11").fadeIn();
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").hide();
                    $('#wallet-number').attr("placeholder", "Bank Transfer");
                    //$('#amount-fees').val('5%')
                } else {
                    $("#field1").hide();
                    $("#field2").hide();
                    $("#field3").hide();
                    $("#field4").hide();
                    $("#field5").hide();
                    $("#field6").hide();
                    $("#field7").hide();
                    $("#field8").hide();
                    $("#field9").hide();
                    $("#field10").hide();
                    $("#field11").hide();
                    $("#field12").hide();
                    $("#field13").hide();
                    $("#field14").hide();
                    $("#field15").hide();
                }
            });

            $("#amount-gram").keyup(function() {
                //var usd = this.val();
                var usd = $("#amount-gram").val();
                //var course = '2.0682345991368067';
                var course = '0.00011';
                $("#amount-usd").val(usd * course);
            });


            /*$('#withdrawal-form').on('submit', function(event) {

                var totalGgram = $('#total-gram').data('balance'),
                    amountGram = $("#amount-usd").val();
                console.log(totalGgram + '===' + amountGram);

                if (totalGgram <= amountGram) {
                    event.preventDefault();
                    //$('#notEnough .card-body h2').text('Not enough Gram')
                    //$('#notEnough').modal('toggle');
                    Swal.fire({
                        title: "Error!",
                        text: "Not enough Gram",
                        type: "error",
                        confirmButtonClass: 'btn btn-primary',
                        buttonsStyling: false,
                    });

                } else {*/
                    //$('#notEnough .card-body h2').text('Not available')
                    ///$('#notEnough').modal('toggle')
                    /* Swal.fire({
                        title: "Error!",
                        text: "Not available",
                        type: "error",
                        confirmButtonClass: 'btn btn-primary',
                        buttonsStyling: false,
                        });  */
                //}
            //});
        });
    </script>

    <script>
        function noticePop( value, type ){
            swal({
                html: '<span style="font-size:18px!important;">'+ `${value}` +'</span>',
                type: `${type}`,
                timer: 4000,
                showConfirmButton: false,
                allowOutsideClick: false,
                allowEscapeKey: false,
            }).then(function(){
                window.location.href = 'deposit';
            });
        }
    </script>

</body>
</html>