<div class="container" id="page" href="/">
  <div class="d-flex reload">
    <div id="sidebar-wrapper">
      <div class="list-group">
        <repeat group="{{@categories}}" value="{{@c}}">
          <check if="{{@c['show']==1 && @c['products']}}">
        <a data-href="category{{@c['id']}}" class="list-group-item list-group-item-action bg-light">
          {{@c['title']}}
        </a>
          </check>
        </repeat>
      </div>
    </div>

    <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">
                  <button class="btn btn-light" type="reset">Очистить</button>
                </div>
                </check>
              </div>
            </form>
          </check>
          <repeat group="{{@categories}}" value="{{@c}}">
            <check if="{{isset(@c['products']) && @c['show']==1}}">
              <br><br>
              <a name="category{{@c['id']}}"></a>
              <h2>{{@c['title']}}</h2>
              <repeat group="{{@c['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>
            </check>
          </repeat>
        </div>
      </div>
    </div>
  </div>
</div>
<div id="footer" class="w-100 fixed-bottom bg-dark text-light">
  <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>