{% extends "panel/base.html.twig" %}
{% set pageTitle = 'قیمت گذاری فروش' %}
{% block title %}
{{ pageTitle }}
{% endblock %}
{% block body %}
<div class="card">
<div class="card-body">
{{ render(controller('App\\Controller\\Render\\PanelNavbarController::renderTelegramManagementNavbar',{'routeName' : app.request.attributes.get('_route') , 'bot' : bot})) }}
</div>
</div>
<div class="card">
<div class="card-body">
{% if autoPrice is defined %}
{{ form_start(autoPrice) }}
<p class="mb-2">
قیمت گذاری خودکار
<br>
<span class="text-danger">
با قیمت گذاری خودکار سیستم تمام بسته ها را حذف و بر مبنای انتخاب شما بسته های جدید را برای فروش در ربات قیمت گذاری میکنید
</span>
</p>
{% for key, input in autoPrice.children %}
{% if key != 'image' and attribute(autoPrice, key) is defined %}
<div class="mb-3">
{{ form_row(attribute(autoPrice, key)) }}
</div>
{% endif %}
{% endfor %}
<div class="row g-4">
<div class="col-6">
<button type="button" onclick="window.history.back();"
class="btn btn-dim btn-danger btn-block w-100">لغو
</button>
</div>
<div class="col-6">
<button type="submit" class="btn btn-primary btn-block w-100">ذخیره</button>
</div>
<div class="col-12">
<a href="{{ path('app_telegram_agent_public_bot_management_price_delete_all' , {'botId' : bot.id}) }}"
class="btn btn-dim btn-danger btn-block w-100">حذف تمام بسته ها
</a>
</div>
</div>
{{ form_end(autoPrice) }}
{% endif %}
</div>
</div>
<div class="card">
<div class="card-body">
{% if vipForm is defined %}
{{ form_start(vipForm) }}
<p class="mb-2">
قیمت گذاری دستی
</p>
{% for key, input in vipForm.children %}
{% if key != 'image' and attribute(vipForm, key) is defined %}
<div class="mb-3">
{{ form_row(attribute(vipForm, key)) }}
</div>
{% endif %}
{% endfor %}
<div class="row g-4">
<div class="col-6">
<button type="button" onclick="window.history.back();"
class="btn btn-dim btn-danger btn-block w-100">لغو
</button>
</div>
<div class="col-6">
<button type="submit" class="btn btn-primary btn-block w-100">ذخیره</button>
</div>
<div class="col-12">
<a href="{{ path('app_telegram_agent_public_bot_management_price_delete_all' , {'botId' : bot.id}) }}"
class="btn btn-dim btn-danger btn-block w-100">حذف تمام بسته ها
</a>
</div>
</div>
<hr>
<table class="table">
<tbody>
{% for item in botPlans %}
{% if item is defined and item.plan is not null %}
<tr>
{# <td>{{ item.id }}</td> #}
<td>{{ item.plan }}</td>
<td>{{ item.plan.days }} روز</td>
<td>{{ item.plan.size|readableSize }} </td>
<td>
قیمت خرید شما :
{{ dynamicPrice(app.user , item.plan)|number_format }} </td>
<td>
قیمت فروش شما :
{{ item.price|number_format }} </td>
<td>
<a href="{{ path('app_user_agent_bot_plan_remove' , {'planId' : item.id , 'botId' : bot.id}) }}"
class="btn btn-dim btn-danger btn-block w-100">حذف</a>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{{ form_end(vipForm) }}
{% endif %}
</div>
</div>
{% endblock %}