<div class="container" id="page" href="/">
  <div class="d-flex reload">

    <div class="container-fluid" id="page-content-wrapper">
      <div class="container">
        <div class="products_list">
          <form name="products_all_search_form" method="GET" action="/products/search_barcodes">
            <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_page">{{@keys[@i]}}</button>
                      </false>
                    </check>
                  </loop>
                  <button type="button" class="virtual_key_bks btn btn-light border border-secondary" for="form_product_search_page">
                    <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_page" 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_page" value=" "> </button>
                  <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search_page" value=",">,</button>
                  <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search_page" 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_page">{{@a}}</button>
                        </false>
                      </check>
                  </loop>
                  <button type="button" class="virtual_key_bks btn btn-light border border-secondary" for="form_product_search_page">
                    <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_page" 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_page" value=" "> </button>
                  <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search_page" value=",">,</button>
                  <button type="button" class="virtual_key btn btn-light border border-secondary" for="form_product_search_page" 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_page 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>

          <div class="basket_list" href="{{@URI}}">
            <div class="reload">
              <table width="100%" class="border-bottom">
              <repeat group="{{@products}}" value="{{@p}}">
                <tr class="card_div product_{{@p['product_id']}} product_{{@p['product_id']}}_parent_{{@p['parent_id']}} product_{{@p['product_id']}}_line_{{@p['id']}} {{@p['parent_id']==0?'border-top':''}} {{@p['parent_id']==0 && !isset(@mods[@p['id']])?'border-bottom':''}}">
                  <td width="40" valign="middle" align="center" class="border-left">
                    <check if="{{@p['parent_id']==0}}">
                      <true>
                    <div class="images images40 d-flex">
                      <check if="{{is_array(@p['img']) && count(@p['img'])>0}}">
                        <true>
                      <img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/40_40/{{@p['img'][0]}}" class="small_img">
                        </true>
                        <false>
                      <div class="no_img"></div>
                        </false>
                      </check>
                    </div>
                      </true>
                      <false>
                        <i class="fas fa-plus"></i>
                      </false>
                    </check>
                  </td>
                  <td width="40">
                    <check if="{{@p['parent_id']>0}}">
                    <div class="images images40 d-flex">
                      <check if="{{is_array(@p['img']) && count(@p['img'])>0}}">
                        <true>
                      <img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/40_40/{{@p['img'][0]}}" class="small_img">
                        </true>
                        <false>
                      <div class="no_img"></div>
                        </false>
                      </check>
                    </div>
                    </check>
                  </td>
                  <td valign="middle">
                    <check if="{{@p['combo_id']>0}}">
                      <true>
                    {{@p['description']}}
                    <br>
                    <a href="/products/detail?id={{@p['product_id']}}" class="show_window text-body small">{{@p['product_title']}}</a>
                      </true>
                      <false>
                    <a href="/products/detail?id={{@p['product_id']}}" class="show_window text-body">{{@p['product_title']}}</a>
                      </false>
                    </check>
                  </td>
                  <td valign="middle" width="100">
                    {~@price=@p['price0']+(@p['price0']*(@p['vat']/100))*max(0, @p['vat_type'])~}
                          {~@price=round(@price, 2)~}
                      <big>{{number_format(@price, 2, '.', '')}}</big> руб.
                  </td>
                  <td valign="middle" width="180" class="border-right" align="right">
                    <div class="change_count">
                      <div class="basket_minus btn btn-primary" parent_id="{{@p['parent_id']}}" line_id="{{@p['id']}}">
                        <i class="fas fa-minus"></i>
                      </div>
                      <input type="hidden" name="product_id" value="{{@p['product_id']}}">
                      <input type="number" name="basket_count" value="{{@p['count']>floor(@p['count'])?str_replace(',', '.', @p['count']):@p['count']}}">
                      <div class="basket_plus btn btn-primary" parent_id="{{@p['parent_id']}}" line_id="{{@p['id']}}">
                        <i class="fas fa-plus"></i>
                      </div>
                    </div>
                  </td>
                </tr>
              </repeat>
              </table>
            </div>
          </div>

        </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>