{% include 'header.twig' %}

<div class="content">
    <div class="row">
        <div class="col-lg-4">
            <div class="card card-stats">
                <div class="card-body ">
                    <div class="row">
                        <div class="col-12">
                            <div class="numbers">
                                <p class="card-category">Welcome</p>
                                <p class="card-title">{{ user['username'] }}
                                </p>
                                <p>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-footer ">
                    <hr>
                    <div class="stats">
                        <i class="fa fa-refresh"></i>Welcome to {{ user['username'] }}
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="card card-stats">
                <div class="card-body ">
                    <div class="row">
                        <div class="col-5 col-md-4">
                            <div class="icon-big text-center icon-warning">
                                <i class="fa fa-money"></i>
                            </div>
                        </div>
                        <div class="col-7 col-md-8">
                            <div class="numbers">
                                <p class="card-category">Current Balance</p>
                                <p class="card-title">{{ user['balance'] }}
                                    <p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-footer ">
                    <hr>
                    <div class="stats">
                        <i class="fa fa-calendar-o"></i> Total Balance in the Account
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="card card-stats">
                <div class="card-body ">
                    <div class="row">
                        <div class="col-5 col-md-4">
                            <div class="icon-big text-center icon-warning">
                                <i class="fa fa-credit-card"></i>
                            </div>
                        </div>
                        <div class="col-7 col-md-8">
                            <div class="numbers">
                                <p class="card-category">Amount Spent</p>
                                <p class="card-title">{{ user['spent'] }}
                                    <p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-footer ">
                    <hr>
                    <div class="stats">
                        <i class="fa fa-refresh"></i> Total Amount Spent
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="card ">
                <div class="card-header ">
                    {% if user['balance']
                    < 5 %} <div class="alert alert-dismissible alert-danger">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <strong>Sevgili @{{ user['username'] }}, </strong> <br>
Your balance seems to have decreased, do not forget to load the balance for trouble free service.
                </div>
                {% endif %} {% if error %}
                <div class="alert alert-dismissible alert-danger">
                    {{ errorText }}
                </div>
                {% endif %} {% if data["order"]["success"] == 1 %}
                <div class="alert alert-dismissible alert-success">
                    <strong> {{ lang["neworder.success.id"] }}: </strong> {{ data['order']['id'] }} <br>
                    <strong> {{ lang["neworder.success.service"] }}: </strong> {{ data['order']['service'] }} <br>
                    <strong> {{ lang["neworder.success.link"] }}: </strong> {{ data['order']['link'] }} <br>
                    <strong> {{ lang["neworder.success.quantity"] }}: </strong> {{ data['order']['quantity'] }} <br>
                    <strong> {{ lang["neworder.success.link"] }}: </strong> {{ data['order']['price'] }} <br>
                    <strong> {{ lang["neworder.success.balance"] }}: </strong>{{ data['order']['balance'] }} <br>
                </div>
                {% endif %} {% if data["order"]["success"] == 2 %}
                <div class="alert alert-dismissible alert-success">
                    <strong> {{ lang["neworder.success.id"] }}: </strong> {{ data['order']['id'] }} <br>
                    <strong> {{ lang["neworder.success.service"] }}: </strong> {{ data['order']['service'] }} <br>
                    <strong> {{ lang["neworder.success.username"] }}: </strong> {{ data['order']['link'] }} <br>
                    <strong> {{ lang["neworder.success.quantity"] }}: </strong> {{ data['order']['min'] }} - {{ data['order']['max'] }} <br>
                    <strong> {{ lang["neworder.success.posts"] }}: </strong> {{ data['order']['posts'] }} <br>
                    <strong> {{ lang["neworder.success.delay"] }}: </strong>{{ data['order']['delay'] }} <br>
                </div>
                {% endif %}

                <div class="well">

                    <form method="post" action="">

                        <div class="form-group">
                            <label for="orderform-category" class="control-label">{{ lang["neworder.category"] }}</label>
                            <select class="form-control" id="neworder_category" name="categories">
                {% for category in categories %}
                    <option value="{{ category["category_id"] }}" {% if category["category_id"] == data['categories'] %} selected {% endif %} >{{ category["category_name"] }}</option>
                {% endfor %}
                </select>
                        </div>
                        <div class="form-group">
                            <label for="orderform-service" class="control-label">{{ lang["neworder.service"] }}</label>
                            <select class="form-control" id="neworder_services" name="services">

              </select>
                        </div>

                        <div id="neworder_fields"></div>

                        <div class="form-group" id="charge_div">
                            <label for="charge" class="control-label">{{ lang["neworder.charge"] }}</label>
                            <input type="text" class="form-control" id="charge" readonly>
                        </div>



                        <button type="submit" class="btn btn-primary">{{ lang["neworder.button"] }}</button>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="card ">
    {{ contentText }}
</div>

</div>

<style>
    .hidden {
    display: none !important;
}
</style>


{% include 'footer.twig' %}