<commit_before>{% extends '::base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" type="text/css" href="{{ asset('/bundles/app/select2/css/select2.min.css') }}"/>
{% endblock %}

{% block body %}
    {{ parent() }}

    <div class="container content">
        <form method="POST" action="{{ path('statistic') }}">
            <div class="row">
                <div class="col-sm-3"><strong>Աշխատակից</strong></div>
                <div class="col-sm-3"><strong>Խանութ</strong></div>
                <div class="col-sm-2"><strong>From</strong></div>
                <div class="col-sm-2"><strong>To</strong></div>
            </div>
            <div class="row">
                <div class="col-sm-3">
                    <select id="user-select" name="user" class="form-control select2">
                        <option value=0></option>
                        {% for user in users %}
                            <option value="{{ user.id }}" {% if userId is not null and user.id == userId %}selected="selected"{% endif %}>{{ user }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-sm-3">
                    <select id="company-select" name="company" class="form-control select2">
                        <option value=0></option>
                        {% for company in companies %}
                            <option value="{{ company.id }}" {% if companyId is not null and company.id == companyId %}selected="selected"{% endif %}>{{ company }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-sm-2">
                    <input type="date" name="start_date" class="form-control" value="{{ start_date }}"/>
                </div>
                <div class="col-sm-2">
                    <input type="date" name="end_date" class="form-control" value="{{ end_date }}"/>
                </div>
                <div class="col-sm-2">
                    <input type="submit" class="btn btn-primary" value="Filter" />
                </div>
            </div>

            <br />
            <table class="table table-striped table-bordered">
                <tr>
                    <th>Ապրանքի անվանում</th>
                    <th>Միավորի գին</th>
                    <th>Քանակը</th>
                    <th>Գումարը</th>
                </tr>

                {% set i = 1 %}
                {% set totalPrice = 0 %}
                {% for data in result %}
                    <tr>
                        <td>{{ data['name'] }}</td>
                        <td>{{ data['price'] }}</td>
                        <td>{{ data['quantity'] }}</td>

                        {% set totalPrice = totalPrice + data['calculatedPrice'] %}
                        <td>{{ data['calculatedPrice'] }}</td>
                    </tr>

                    {% set i = i + 1 %}
                {% endfor %}

                {% if i > 1 %}
                    <tr>
                        <td></td>
                        <td></td>
                        <td style="font-size: medium"><strong>Ընդհանուր գումարը</strong></td>
                        <td style="font-size: medium" class="total_price"><strong>{{ totalPrice }}</strong></td>
                    </tr>
                {% endif %}

            </table>

            <div class="row">
                <div class="col-sm-11">

                </div>
                <div class="col-sm-1">
                    <br />
                    <input type="submit" name="export_btn" class="btn btn-primary" value="Export"/>
                </div>
            </div>

        </form>

        <br />
    </div>
{% endblock %}


{% block javascripts %}
    {{ parent() }}
    <script src="{{ asset('/bundles/app/select2/js/select2.min.js') }}"></script>
    <script type="text/javascript">
        $('.select2').select2();
    </script>
    <script>
        $('#user-select').on('change', function() {
            if(this.value){
                $('#company-select').val(null);
            }
        });
        $('#company-select').on('change', function() {
            if(this.value){
                $('#user-select').val(null);
            }
        });
    </script><commit_msg>correction<commit_after>{% extends '::base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" type="text/css" href="{{ asset('/bundles/app/select2/css/select2.min.css') }}"/>
{% endblock %}

{% block body %}
    {{ parent() }}

    <div class="container content">
        <form method="POST" action="{{ path('statistic') }}">
            <div class="row">
                <div class="col-sm-3"><strong>Աշխատակից</strong></div>
                <div class="col-sm-3"><strong>Խանութ</strong></div>
                <div class="col-sm-2"><strong>From</strong></div>
                <div class="col-sm-2"><strong>To</strong></div>
            </div>
            <div class="row">
                <div class="col-sm-3">
                    <select id="user-select" name="user" class="form-control select2">
                        <option value=0></option>
                        {% for user in users %}
                            <option value="{{ user.id }}" {% if userId is not null and user.id == userId %}selected="selected"{% endif %}>{{ user }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-sm-3">
                    <select id="company-select" name="company" class="form-control select2">
                        <option value=0></option>
                        {% for company in companies %}
                            <option value="{{ company.id }}" {% if companyId is not null and company.id == companyId %}selected="selected"{% endif %}>{{ company }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-sm-2">
                    <input type="date" name="start_date" class="form-control" value="{{ start_date }}"/>
                </div>
                <div class="col-sm-2">
                    <input type="date" name="end_date" class="form-control" value="{{ end_date }}"/>
                </div>
                <div class="col-sm-2">
                    <input type="submit" class="btn btn-primary" value="Filter" />
                </div>
            </div>

            <br />
            <table class="table table-striped table-bordered">
                <tr>
                    <th>Ապրանքի անվանում</th>
                    <th>Միավորի գին</th>
                    <th>Քանակը</th>
                    <th>Գումարը</th>
                </tr>

                {% set i = 1 %}
                {% set totalPrice = 0 %}
                {% for data in result %}
                    <tr>
                        <td>{{ data['name'] }}</td>
                        <td>{{ data['price'] }}</td>
                        <td>{{ data['quantity'] }}</td>

                        {% set totalPrice = totalPrice + data['calculatedPrice'] %}
                        <td>{{ data['calculatedPrice'] }}</td>
                    </tr>

                    {% set i = i + 1 %}
                {% endfor %}

                {% if i > 1 %}
                    <tr>
                        <td></td>
                        <td></td>
                        <td style="font-size: medium"><strong>Ընդհանուր գումարը</strong></td>
                        <td style="font-size: medium" class="total_price"><strong>{{ totalPrice }}</strong></td>
                    </tr>
                {% endif %}

            </table>

            <div class="row">
                <div class="col-sm-11">

                </div>
                <div class="col-sm-1">
                    <br />
                    <input type="submit" name="export_btn" class="btn btn-primary" value="Export"/>
                </div>
            </div>

        </form>

        <br />
    </div>
{% endblock %}


{% block javascripts %}
    {{ parent() }}
    <script src="{{ asset('/bundles/app/select2/js/select2.min.js') }}"></script>
    <script type="text/javascript">
        $('.select2').select2();
    </script>
    <script>
        $('#user-select').on('change', function() {
            if(this.value){
                $('#company-select').val(null).trigger("change");
            }
        });
        $('#company-select').on('change', function() {
            if(this.value){
                $('#user-select').val(null).trigger("change");
            }
        });
    </script>
{'fraction_non_alphanumeric': 0.1767892128615881, 'fraction_numerical': 0.005992854673274173, 'mean_word_length': 1.2522709576953024, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2364775', 'n_tokens_mistral': 2603, 'n_tokens_neox': 2400, 'n_words': 459}