templates/agency.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3.     <div class="container-main">
  4.         {% include '/parts/menu.html.twig' %}
  5.         <div class="datagrid-header-tools">
  6.             <div class="content-panel">
  7.                 <div class="content-panel-body with-rounded-top with-min-h-250">
  8.                     <div class="description-wrapper">
  9.                         <div class="description-text">{{ description|raw }}</div>
  10.                         {% if own is not defined %}
  11.                         {% if network is defined and network == 'tat' %}
  12.                         {% if manager is null %}
  13.                             <div class="description-text">Сповіщення про нові заявки в Telegram <a
  14.                                         href="http://t.me/TAT_birzha_bot?start" class="telegram-link-inner"
  15.                                         target="_blank">http://t.me/TAT_birzha_bot</a>
  16.                                 <br /><a class="telegram-link-inner" target="_blank" href="https://youtu.be/5hF6C57A_L4">Відео інструкція</a> як працювати з Біржею
  17.                             </div>
  18.                         {% else %}
  19.                             <div class="description-text">Сповіщення про нові заявки в Telegram <a
  20.                                         href="http://t.me/TAT_birzha_bot?start={{ manager.id }}"
  21.                                         class="telegram-link-inner"
  22.                                         target="_blank">http://t.me/TAT_birzha_bot</a>
  23.                                 <br /><a class="telegram-link-inner" target="_blank" href="https://youtu.be/5hF6C57A_L4">Відео інструкція</a> як працювати з Біржею
  24.                             </div>
  25.                         {% endif %}
  26.                         {% else %}
  27.                         {% if manager is null %}
  28.                             <div class="description-text">Сповіщення про нові заявки в Telegram <a
  29.                                         href="http://t.me/OtpuskProBot?start" class="telegram-link-inner"
  30.                                         target="_blank">http://t.me/OtpuskProBot</a>
  31.                                 <br /><a class="telegram-link-inner" target="_blank" href="https://youtu.be/5hF6C57A_L4">Відео інструкція</a> як працювати з Біржею
  32.                             </div>
  33.                         {% else %}
  34.                             <div class="description-text">Сповіщення про нові заявки в Telegram <a
  35.                                         href="http://t.me/OtpuskProBot?start={{ manager.id }}"
  36.                                         class="telegram-link-inner"
  37.                                         target="_blank">http://t.me/OtpuskProBot</a>
  38.                                 <br /><a class="telegram-link-inner" target="_blank" href="https://youtu.be/5hF6C57A_L4">Відео інструкція</a> як працювати з Біржею
  39.                             </div>
  40.                         {% endif %}
  41.                         {% endif %}
  42.                             <div class="reboot-time-block">
  43.                                 <div class="page-update">Сторінка оновиться через <span class="time"
  44.                                                                                         id="reboot-time">10:00</span>
  45.                                 </div>
  46.                                 {# <div onclick="location.reload();" class="btn-primar addition-action-btn">Обновить сейчас</div> #}
  47.                                 {# <div onclick="$('#reboot-time').removeAttr('id'); stopReload = true;" class="btn-primar  not-update-button"></div> #}
  48.                                 <div id="update-timer" class="btn-primar  update-timer-button">
  49.                                     <i class="update-timer-icon"></i>
  50.                                 </div>
  51.                             </div>
  52.                             <script type="text/javascript">
  53.                                 $(document).ready(function () {
  54.                                     $('#update-timer').on('click', function () {
  55.                                         // $('#reboot-time').removeAttr('id');
  56.                                         stopReload = !stopReload;
  57.                                         $('.update-timer-icon').toggleClass('stop-timer');
  58.                                     });
  59.                                 });
  60.                                 var timerr = "10:00";
  61.                                 stopReload = false;
  62.                                 var interval = setInterval(function () {
  63.                                     if (!stopReload) {
  64.                                         var timer = timerr.split(':');
  65.                                         //by parsing integer, I avoid all extra string processing
  66.                                         var minutes = parseInt(timer[0], 10);
  67.                                         var seconds = parseInt(timer[1], 10);
  68.                                         if (minutes >= 0) {
  69.                                             --seconds;
  70.                                             if (seconds < 0)
  71.                                                 minutes = (seconds < 0) ? --minutes : minutes;
  72.                                             if (minutes >= 0) {
  73.                                                 seconds = (seconds < 0) ? 59 : seconds;
  74.                                                 seconds = (seconds < 10) ? '0' + seconds : seconds;
  75.                                                 //minutes = (minutes < 10) ?  minutes : minutes;
  76.                                                 $('#reboot-time').html(minutes + ':' + seconds);
  77.                                                 timerr = minutes + ':' + seconds;
  78.                                             } else {
  79.                                                 if (!stopReload) {
  80.                                                     clearInterval(interval);
  81.                                                     location.reload();
  82.                                                     clearInterval(interval);
  83.                                                 }
  84.                                             }
  85.                                         }
  86.                                     }
  87.                                 }, 1000);
  88.                             </script>
  89.                         {% endif %}
  90.                     </div>
  91.                     <div class="table datagrid with-rounded-top">
  92.                         <div class="table-items-container">
  93.                             {% include '/parts/reguests-filter.html.twig' %}
  94.                             {% for request in requests %}
  95.                                 {% if(request.debits is defined or request.agency is defined) %}
  96.                                     {% set agencies = [] %}
  97.                                     {% if manager is not null %}
  98.                                         {% set agency = manager.agency %}
  99.                                         {% if request.debits is defined %}
  100.                                             {% for debit in request.debits %}
  101.                                                 {% set agencies = agencies|merge([debit.agency.id]) %}
  102.                                             {% endfor %}
  103.                                         {% else %}
  104.                                             {% set agencies = [request.agency.id] %}
  105.                                         {% endif %}
  106.                                         {% if (request.debits is defined and request.debits is not empty) and (manager.agency.id in agencies) %}
  107.                                             {% include '/parts/request-full.html.twig' %}
  108.                                         {% elseif(request.auctionRequest is defined) %}
  109.                                             {% include '/parts/request-full.html.twig'  with { 'request': request.auctionRequest, 'debit':request } %}
  110.                                         {% else %}
  111.                                             {% include '/parts/request-part.html.twig' %}
  112.                                         {% endif %}
  113.                                     {% else %}
  114.                                         {% include '/parts/request-part.html.twig' %}
  115.                                     {% endif %}
  116.                                 {% endif %}
  117.                             {% endfor %}
  118.                         </div>
  119.                     </div>
  120.                 </div>
  121.                 {{ knp_pagination_render(requests) }}
  122.             </div>
  123.         </div>
  124.     </div>
  125.     <div class="modal-buy form-price modal">
  126.         <div class="modal-dialog">
  127.             <div class="modal-content">
  128.                 <div class="modal-header">
  129.                     <div class="modal-title">Сума
  130.                         <span class="modal-title time" id="modal-price"></span> грн буде списана з вашого балансу
  131.                     </div>
  132.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  133.                         <span aria-hidden="true">&times;</span>
  134.                     </button>
  135.                 </div>
  136.                 <div class="modal-body">
  137.                     <div class="message-text hide"></div>
  138.                     <div class="btn-primar primary-action-btn" id="modal-confirm" data-id="" data-price="">Підтвердити
  139.                         <div class="spinner-border text-secondary" role="status">
  140.                             <span class="sr-only">Loading...</span>
  141.                         </div>
  142.                     </div>
  143.                     <div class="btn-secondary addition-action-btn close">Скасувати</div>
  144.                 </div>
  145.             </div>
  146.         </div>
  147.     </div>
  148.     <div class="modal-cancellation modal">
  149.         <div class="modal-dialog">
  150.             <div class="modal-content">
  151.                 <div class="modal-header">
  152.                     <div class="modal-title">
  153.                     </div>
  154.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  155.                         <span aria-hidden="true">&times;</span>
  156.                     </button>
  157.                 </div>
  158.                 <div class="help-for-refund">
  159.                     <div class="help-for-refund-title">Запит на повернення коштів</div>
  160.                     Запит буде розглянутий, якщо:
  161.                     <ol>
  162.                         <li>
  163.                             Ви намагалися зв'язатися з клієнтом не більше ніж через 3 години після придбання заявки (без
  164.                             урахування нічного часу).
  165.                         </li>
  166.                         <li>
  167.                             Ви зробили не менше 3-х спроб зв'язатися, як мінімум 2-ма різними способами зв'язку (телефон та
  168.                             месенджер)
  169.                         </li>
  170.                         <li>
  171.                             Ви можете надати докази: скріншот історії дзвінків з телефону або сервісу IP-телефонії, скріншот
  172.                             вайбер або телеграм-чату, файл із записом дзвінка.
  173.                         </li>
  174.                     </ol>
  175.                 </div>
  176.                 <div class="modal-body"></div>
  177.             </div>
  178.         </div>
  179.     </div>
  180.     <script>
  181.         $(document).ready(function () {
  182.             $('.close').on('click', function () {
  183.                 $('.request-modal-btn').find('span.main').show();
  184.                 $('.request-modal-btn').find('span.secondary').hide();
  185.                 $('.modal-buy').hide();
  186.                 $('.modal-cancellation').hide();
  187.             });
  188.             $('.request-modal-btn').on('click', function () {
  189.                 $requestId = $(this).data("request");
  190.                 $requestPrice = $(this).find('span.main').html();
  191.                 $(this).find('span.main').hide();
  192.                 $(this).find('span.secondary').html($requestPrice);
  193.                 $(this).find('span.secondary').show();
  194.                 $('#modal-price').html($requestPrice);
  195.                 $('#modal-confirm').data("id", $requestId).data("price", $requestPrice);
  196.                 $('.modal-buy').show();
  197.             });
  198.             $('#modal-confirm').on('click', function () {
  199.                 $requestId = $(this).data("id");
  200.                 $requestPrice = $(this).data("price");
  201.                 $('.spinner-border').show();
  202.                 $.ajax({
  203.                     method: 'POST',
  204.                     url: '/api/buy-request',
  205.                     data: {'price': $requestPrice, 'id': $requestId},
  206.                 }).done(function (data) {
  207.                     $('.spinner-border').hide();
  208.                     if (data['status'] == 'error') {
  209.                         $('.modal-buy .message-text').html(data['text']).show();
  210.                     } else if (data['status'] == 'success') {
  211.                         $('.modal-buy .message-text').html(data['text']).show();
  212.                         $('#modal-confirm').hide();
  213.                         setTimeout(function () {
  214.                             window.location.replace('/birzha/my-own');
  215.                         }, 1000);
  216.                     }
  217.                 });
  218.             });
  219.             $('.btn-cancellation').on('click', function () {
  220.                 var form = $(this).data("form");
  221.                 $.ajax({
  222.                     method: 'POST',
  223.                     url: '/api/request-cancellation-modal',
  224.                     data: $("form[name=" + form + "]").serializeArray(),
  225.                 }).done(function (data) {
  226.                     $(".modal-cancellation .modal-body").html(data);
  227.                     $(".help-for-refund").show();
  228.                     $(".modal-cancellation").show();
  229.                 });
  230.             });
  231.             addBit = function (form, minBit) {
  232.                 console.log(minBit);
  233.                 var notReturn = true;
  234.                 notReturn = true;
  235.                 if ($("form[name=" + form + "]").find('input').prop('required')
  236.                     && $("form[name=" + form + "]").find('input').val().length == 0) {
  237.                     $("form[name=" + form + "] .form_error").text("Поле обов'язково");
  238.                     notReturn = false;
  239.                     return;
  240.                 }
  241.                 if ($("form[name=" + form + "]").find('input').prop('required')
  242.                     && $("form[name=" + form + "]").find('input').val() < minBit) {
  243.                     $("form[name=" + form + "] .form_error").text("Мінімальна ставка " + minBit + "  грн");
  244.                     notReturn = false;
  245.                     return;
  246.                 }
  247.                 if (notReturn) {
  248.                     $("form[name=" + form + "]" + ' .spinner-border').show();
  249.                     $.ajax({
  250.                         method: 'POST',
  251.                         url: '/api/bid-add',
  252.                         data: $("form[name=" + form + "]").serializeArray(),
  253.                     }).done(function (data) {
  254.                         if ('message' in data) {
  255.                             console.log(form);
  256.                             $("form[name=" + form + "] .form_error").text(data['message']);
  257.                             $('.spinner-border').hide();
  258.                         } else {
  259.                             location.reload();
  260.                         }
  261.                     });
  262.                 }
  263.             }
  264.             buyRequest = function (form) {
  265.                 $.ajax({
  266.                     method: 'POST',
  267.                     url: '/api/buy-request',
  268.                     data: $("form[name=" + form + "]").serializeArray(),
  269.                 }).done(function (data) {
  270.                     window.location.replace('/birzha/my-own');
  271.                 });
  272.             }
  273.             deleteBid = function (id) {
  274.                 $.ajax({
  275.                     method: 'POST',
  276.                     url: '/api/bid-remove',
  277.                     data: {'id': id}
  278.                 }).done(function (data) {
  279.                     location.reload();
  280.                 });
  281.             }
  282.             cancellation = function (form) {
  283.                 console.log(form);
  284.                 if ($("form[name=" + form + "]").find('input').prop('required')
  285.                     && $("form[name=" + form + "]").find('input').val().length == 0) {
  286.                     $("form[name=" + form + "] .form_error").text("Поле обов'язково");
  287.                     return;
  288.                 }
  289.                 $.ajax({
  290.                     method: 'POST',
  291.                     url: '/api/request-cancellation',
  292.                     data: $("form[name=" + form + "]").serializeArray(),
  293.                 }).done(function (data) {
  294.                     location.reload();
  295.                 });
  296.             }
  297.             // $('.first a').html('');
  298.         });
  299.     </script>
  300. {% endblock %}
  301. {% block javascripts %}
  302.     {{ parent() }}
  303. {% endblock %}