{extends "[shared]window.tpl"}

{block tabs}
   {windowTab id='flapReservation'}
{/block}

{block tabsContent}
   {$productId = $body.data.id_product}
   {if !$productId}
       {$productId = $smarty.get.productId}
   {/if}

    <div id="flapReservation" class="tab-pane fade active in boxStatic">
       <div class="row wpj-form-group-flex">
         <div class="col-xs-6">
            <div class="wpj-form-group">
               <label>{'product'|translate}</label>
               <select class="selecter" name="data[id_product]" data-autocomplete="productId" data-preload="products">
                  <option value="{$productId}" selected>{$productId}</option>
               </select>
            </div>
         </div>
          <div class="col-xs-6">
            <div class="wpj-form-group">
               <label>{'variation'|translate:'ProductReservation'}</label>
               <select class="selecter" name="data[id_variation]" data-autocomplete="variationsForProduct"
                       data-autocomplete-params="id_product={$productId}" data-preload="variations">
                  {if $body.data.id_variation}
                     <option value="{$body.data.id_variation}" selected>{$body.data.id_variation}</option>
                  {/if}
               </select>
            </div>
         </div>
       </div>

       <div class="row wpj-form-group-flex">
         <div class="col-xs-6">
            <div class="wpj-form-group">
               <label>{'type'|translate:'ProductReservation'}</label>
               <select class="selecter" name="data[type]">
                  {foreach $body.types as $type => $name}
                      <option value="{$type}">{$name}</option>
                  {/foreach}
               </select>
            </div>
         </div>
          <div class="col-xs-6">
            <div class="wpj-form-group">
               <label>{'quantity'|translate:'ProductReservation'}</label>
               <input class="form-control" name="data[quantity]" value="{$body.data.quantity}">
            </div>
         </div>
       </div>
    </div>
{/block}