<div class="container" id="page" href="/">
  <div class="reload">
    <div class="container-fluid" id="page-content-wrapper">
      <div class="container">
        <div class="products_list" href="/receipts/product_search">
          <check if="{{(int)@base_settings.kiosk_search==1}}">
            <form name="products_all_search_form" method="GET" class="no_ajax" action="/receipts/product_search">
              <br><br>
              <check if="{{@base_settings.virtual_keyboard==1}}">
                <div class="virtual_keyboard virtual_keyboard_hide virtual_keyboard_product_search full_keyboard">
                  {~@keys='1234567890-+|QWERTYUIOP_|ASDFGHJKL@|ZXCVBNM'~}
                  <div class="eng" align="center">
                    <loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
                      <check if="{{@keys[@i]=='|'}}">
                        <true>
                    <br>
                        </true>
                        <false>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" value="{{@keys[@i]}}" for="form_product_search">{{@keys[@i]}}</button>
                        </false>
                      </check>
                    </loop>
                    <button type="button" class="virtual_key_bks btn btn-light border border-secondary" for="form_product_search">
                      <i class="fas fa-long-arrow-alt-left"></i>
                    </button>
                    <button type="button" class="virtual_key_delete btn btn-light border border-secondary" for="form_product_search" value="CE">CE</button>
                    <br>
                    <button type="button" class="virtual_key_ru btn btn-light border border-secondary" value="RU">RU</button>
                    <button type="button" class="virtual_key virtual_key_space btn btn-light border border-secondary" for="form_product_search" value=" "> </button>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search" value=",">,</button>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search" value=".">.</button>
                    <button type="button" class="virtual_key virtual_key_ok btn btn-light border border-secondary" value="OK">OK</button>
                  </div>
                  {~@keys='1234567890-+|ЙЦУКЕНГШЩЗХЪ|ФЫВАПРОЛДЖЭ_|ЯЧСМИТЬБЮ@'~}
                  <div class="ru" align="center">
                    <loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
                      {~@a=mb_substr(@keys, @i, 1)~}
                        <check if="{{@a=='|'}}">
                          <true>
                    <br>
                          </true>
                          <false>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" value="{{@a}}" for="form_product_search">{{@a}}</button>
                          </false>
                        </check>
                    </loop>
                    <button type="button" class="virtual_key_bks btn btn-light border border-secondary" for="form_product_search">
                      <i class="fas fa-long-arrow-alt-left"></i>
                    </button>
                    <button type="button" class="virtual_key_delete btn btn-light border border-secondary" for="form_product_search" value="CE">CE</button>
                    <br>
                    <button type="button" class="virtual_key_eng btn btn-light border border-secondary" value="ENG">EN</button>
                    <button type="button" class="virtual_key virtual_key_space btn btn-light border border-secondary" for="form_product_search" value=" "> </button>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search" value=",">,</button>
                    <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search" value=".">.</button>
                    <button type="button" class="virtual_key virtual_key_ok btn btn-light border border-secondary" value="OK">OK</button>
                  </div>
                </div>
                </check>
              <div class="input-group">
                <input type="text" name="product_search" class="form_product_search with_full_keyboard" value="{{@GET.product_search}}" placeholder="Наименование" autocomplete="off" required="true">
                <div class="input-group-append">
                  <button class="btn btn-dark" type="submit">Искать</button>
                </div>
                <check if="{{@GET.product_search}}">
                <div class="input-group-append">
                  <a href="/">
                    <button type="button" class="btn btn-light">Очистить</button>
                  </a>
                </div>
                </check>
              </div>
            </form>
          </check>
          <check if="{{!empty(@parent)}}">
          <br>
          <div>
            <a class="btn btn-secondary" href="/">
              <i class="fas fa-home"></i> Начало
            </a>
            <check if="{{@parent['parent_id']>0}}">
            <a class="btn btn-secondary" href="/?category_id={{@parent['parent_id']}}">
              <i class="fas fa-caret-left"></i> Назад
            </a>
            </check>
            <h1>{{@parent['title']}}</h1>
          </div>
          </check>
          <repeat group="{{@categories}}" value="{{@c}}">
            <check if="{{@c['show']==1}}">
            <div class="category_tile category_{{@c['id']}}">
              <div class="images images250">
                <check if="{{@c['img']}}">
                  <true>
                <img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/250_250/{{@c['img']}}" class="small_img">
                  </true>
                  <false>
                <div class="no_img"></div>
                  </false>
                </check>
              </div>
              <br>
              <div>
                <h4><a href="/?category_id={{@c['id']}}" class="text-body">{{@c['title']}}</a></h4>
              </div>
            </div>
            </check>
          </repeat>
          <repeat group="{{@products}}" value="{{@p}}">  
            <div class="product_tile product_{{@p['id']}} product_{{@p['id']}}_total">
              <div class="images images250">
                <check if="{{is_array(@p['img']) && count(@p['img'])>0}}">
                  <true>
                <img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/250_250/{{@p['img'][0]}}" class="small_img">
                  </true>
                  <false>
                <div class="no_img"></div>
                  </false>
                </check>
              </div>
              <br>
              <div>
                <div class="change_count hide">
                  <div class="basket_minus btn btn-primary">
                    <i class="fas fa-minus"></i>
                  </div>
                  <input type="hidden" name="product_id" value="{{@p['id']}}">
                  <input type="number" name="basket_count" value="0">
                  <div class="basket_plus btn btn-primary">
                    <i class="fas fa-plus"></i>
                  </div>
                </div>
                <div class="add_basket">
                  <a href="/receipts/add_line?product_id={{@p['id']}}&count=1" class="w-100 btn btn-dark send_ajax">Заказать</a>
                </div>
                {~@price=@p['price']+(@p['price']*(@p['vat']/100))*max(0, @p['vat_type'])~}
                {~@price=round(@price, 2)~}
                {{number_format(@price, 2, '.', '')}} руб.
              </div>
              <h4><a href="/products/detail?id={{@p['id']}}" class="show_window text-body">{{@p['title']}}</a></h4>
            </div>
            </repeat>
        </div>
      </div>
    </div>
  </div>
</div>
<div id="footer" class="w-100 fixed-bottom bg-dark text-light">
  <div id="products_list_arrows" class="bg-dark">
    <div class="container">
      <check if="{{@page>2}}">
      <a class="btn btn-secondary float-left" href="{{@PATH}}?category_id={{@GET.category_id}}&product_search={{@GET.product_search}}&page=1">
        <i class="fas fa-caret-left"></i>
        Стр. 1
      </a>
      </check>
      <check if="{{@page>1}}">
      <a class="btn btn-secondary float-left" href="{{@PATH}}?category_id={{@GET.category_id}}&product_search={{@GET.product_search}}&page={{@page-1}}">
        <i class="fas fa-caret-left"></i>
        Стр. {{@page-1}}
      </a>
      </check>
      <check if="{{@page>1 || @page<@page_all || count(@products)==@base_settings['lines_of_list']}}">
      <div class="page_number text-light btn">
        Стр. {{@page}}
      </div>
      </check>
      <check if="{{@page<@page_all || count(@products)==@base_settings['lines_of_list']}}">
      <a class="btn btn-secondary float-right" href="{{@PATH}}?category_id={{@GET.category_id}}&product_search={{@GET.product_search}}&page={{@page+1}}">
        Стр. {{@page+1}}
        <i class="fas fa-caret-right"></i>
      </a>
      </check>
      <table width="100%"><tr><td></td></tr></table>
    </div>
  </div>
  <div id="basket_reset_timer" class="hide float-left bg-dark text-light">Корзина будет очищена через <span></span></div>
  <div class="container" align="right">
    <button type="button" class="total_button show_window btn btn-primary" href="/receipts/pay?type=1">
      <i class="fas fa-shopping-cart"></i>
      Оформить заказ
    </button>
    <button type="button" class="basket_close_button hide btn btn-secondary">
      <i class="fas fa-shopping-cart"></i>
      Продолжить покупки
    </button>
    <button type="submit" form="basket_pay_form" class="pay_button hide btn btn-primary" disabled="true">
      <i class="fas fa-money-bill-alt"></i>
      Оплатить
    </button>
    <div class="basket_wait_pay hide">
      Ожидание оплаты.
      <button type="button" class="pay_cancel btn btn-secondary">
        <i class="fa fa-times"></i>
        Отменить оплату
      </button>
    </div>
    <include href="{{'receiptlines.htm'}}" />
    <table width="100%"><tr><td></td></tr></table>
  </div>
</div>