<?php
require("../includes/db_connect.php");
require_once("includes/admin_session_token.php");

$accountId = $_SESSION['adm_accountId'];


?>
<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Create Trade</title>
    <?php require_once("includes/header.php"); ?>

    <div class="content ht-100v pd-0">
        <div class="content-header">
        </div><!-- content-header -->

        <div class="content-body">
            <div class="container pd-x-0">
                <div class="d-sm-flex align-items-center justify-content-between mg-b-20 mg-lg-b-25 mg-xl-b-30">
                    <div>
                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb breadcrumb-style1 mg-b-10">
                                <li class="breadcrumb-item"><a href="#">Create Trade</a></li>
                            </ol>
                        </nav>
                        <h4 class="mg-b-0 tx-spacing--1">Create Trade</h4>
                    </div>

                </div>

                <div class="row row-xs">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">

                                <div class="col-md-6">
                                    <div style="display: none;" id="feedbackPrompt"></div>

                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Account ID</label>
                                        <input type="text" id="accountId" class="form-control"
                                            placeholder="Enter account ID here">
                                        <div class="invalid-feedback accountId_feedback">Account ID cannot be empty.
                                        </div>
                                    </div>

                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Trade</label>
                                        <select id="package" class="custom-select">
                                            <option selected value="Monthly">Monthly</option>
                                            <option value="Quarterly">Quarterly</option>
                                            <option value="Annually">Annually</option>
                                            <option value="Bot">Community Bot</option>
                                        </select>
                                    </div>
                                    <div id="leverage-field" class="form-group" style="margin-top: 20px">
                                        <label>Choose leverage</label>
                                        <select class="form-control cus-select" id="leverage">
                                            <option value="1:50" selected="true">1:50</option>
                                            <option value="1:100">1:100</option>
                                            <option value="1:200">1:200 (Recommended)</option>
                                            <option value="1:500">1:500</option>
                                            <option value="1:1000">1:1000</option>
                                        </select>
                                    </div>
                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Amount (USD)</label>
                                        <input type="text" id="amountUSD" class="form-control">
                                        <div class="invalid-feedback amount_feedback">Amount cannot be empty.</div>
                                    </div>
                                    <div style="margin-top: 30px">
                                        <button id="invest_now_btn" class="btn btn-xs btn-primary flex-fill"
                                            style="font-size: .8125rem; font-weight: 600;">Create Trade
                                            <span style="display: none;"
                                                class="button_spinner spinner-border spinner-border-sm" role="status"
                                                aria-hidden="false"></span>
                                            <span class="sr-only">Please wait...</span>
                                        </button>
                                    </div>

                                </div>


                            </div>
                        </div>
                    </div>
                </div>
                <!-- end row -->


                <div class="row row-xs" style="margin-top: 50px;">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">

                                <div class="col-md-6">
                                    <div style="display: none;" id="bt_feedbackPrompt"></div>

                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Account ID</label>
                                        <input type="text" id="bt_accountId" class="form-control"
                                            placeholder="Enter account ID here">
                                        <div class="invalid-feedback bt_accountId_feedback">Account ID cannot be empty.
                                        </div>
                                    </div>

                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Bot</label>
                                        <select id="bot" class="custom-select">
                                            <option selected value="Monthly">Monthly</option>
                                            <option value="Quarterly">Quarterly</option>
                                            <option value="Annually">Annually</option>
                                        </select>
                                    </div>

                                    <div class="form-group" style="margin-top: 20px">
                                        <label>Bot Type</label>
                                        <select id="bot_type" class="custom-select">
                                            <option selected value="Ninja 2.1">Ninja 3.6</option>
                                            <option value="Subzero 3.2">Subzero 5.2</option>
                                            <option value="Rocket 4.1">Rocket 7.1</option>
                                        </select>
                                    </div>
                                    <div style="margin-top: 30px">
                                        <button id="create_bot_btn" class="btn btn-xs btn-primary flex-fill"
                                            style="font-size: .8125rem; font-weight: 600;">Proceed
                                            <span style="display: none;"
                                                class="bt_button_spinner spinner-border spinner-border-sm" role="status"
                                                aria-hidden="false"></span>
                                            <span class="sr-only">Please wait...</span>
                                        </button>
                                    </div>

                                </div>


                            </div>
                        </div>
                    </div>
                </div>
                <!-- end row -->


                <div class="modal fade" id="modalCreateInvestment" tabindex="-1" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-dialog-centered wd-sm-400" role="document">
                        <div class="modal-content">
                            <div class="modal-body pd-20 pd-sm-40">
                                <a href="" role="button" class="close pos-absolute t-15 r-15" data-dismiss="modal"
                                    aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </a>

                                <div>
                                    <h4>Create Trade?</h4>
                                    <div style="display: none;" id="create_errorPrompt"
                                        class="alert alert-danger col-md-12" role="alert">
                                        <p></p>
                                    </div>
                                    <div class="form-group">
                                        <label id="inv_message">Are you sure you want to create trade for user with
                                            account number?</label>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-secondary" style="width: 40%"
                                            data-dismiss="modal">Close</button>
                                        <button id="create_investment_btn" style="width: 40%" type="button"
                                            class="btn btn-primary btn-block">Yes, Create
                                            <span style="display: none;"
                                                class="create_spinner spinner-border spinner-border-sm" role="status"
                                                aria-hidden="false"></span>
                                            <span class="sr-only">Please wait...</span>
                                        </button>
                                    </div>

                                </div>
                            </div><!-- modal-body -->
                        </div><!-- modal-content -->
                    </div><!-- modal-dialog -->
                </div><!-- modal -->

            </div><!-- container -->
        </div>
    </div>


    <div class="modal fade" id="modalCreateBot" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered wd-sm-400" role="document">
            <div class="modal-content">
                <div class="modal-body pd-20 pd-sm-40">
                    <a href="" role="button" class="close pos-absolute t-15 r-15" data-dismiss="modal"
                        aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </a>

                    <div>
                        <h4>Create Bot?</h4>
                        <div style="display: none;" id="cfm_create_errorPrompt" class="alert alert-danger col-md-12"
                            role="alert">
                            <p></p>
                        </div>
                        <div class="form-group">
                            <label id="bot_message">Are you sure you want to create trade for user with
                                account number?</label>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" style="width: 40%"
                                data-dismiss="modal">Close</button>
                            <button id="cfm_create_bot_btn" style="width: 40%" type="button"
                                class="btn btn-primary btn-block">Yes, Create
                                <span style="display: none;" class="cfm_create_spinner spinner-border spinner-border-sm"
                                    role="status" aria-hidden="false"></span>
                                <span class="sr-only">Please wait...</span>
                            </button>
                        </div>

                    </div>
                </div><!-- modal-body -->
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- modal -->

    </div><!-- container -->
    </div>
    </div>

    <?php require_once("includes/footer.php"); ?>
    <script type="text/javascript">
    $(document).ready(function() {
        var classes = $("#mn-create-trade").prop('class');
        $("#mn-create-trade").prop('class', classes + ' active pcoded-trigger');

    });
    </script>
    <script src="../js/admin/create-trade.js?ver=<?php echo (rand()); ?>"></script>

    </body>

</html>