
{assign var=i value=1}
{foreach $restaurantOrderDetails as $details}
<tr class="{if $i is even}odd{else}even{/if}" id="orderid{$details->id}">
    <td>{$i}</td>
    <td><!--class="increaseProQuantity" data-productId="{$details->productId}"-->
        {$details->productName}<span>&nbsp;&nbsp;</span>
        {if $Programsettingdata->isCafe == 1}<img class="drinkDetails" data-productId="{$details->productId}" data-itr="{$i}" width="40px" height="40px" src="../views/default/assets/img/notes2.png" alt=""/>{/if}</td>
       {if $Programsettingdata->quantitynew == 0}
        
        <td class="increaseProQuantity quantity" data-productId="{$details->productId}">{$details->quantity}</td>
       
        {else}
        <td >
         <input type="number" class="increaseProQuantitynew quantity" id="quantity_{$details->productId}" data-productId="{$details->productId}" value="{$details->quantity}"> </td>
        {/if}

    <!--  -->
    {if $details->catid|in_array:$allowedCatIds}
        <td>
            <input type="number" class="increasePropricenew price" id="price_{$details->productId}" data-productId="{$details->productId}" value="{$details->price}">
        </td>
    {else}
        <td class="price_pro">{$details->price}</td>
    {/if}
    <td class="total_product">{$details->total}</td>
    <td><span name="notes{$i}" id="notes{$i}">{$details->notesStr}</span><input type="hidden" name="hiddenNotes{$i}" id="hiddenNotes{$i}" value="{$details->notes}"/></td>
    <td class="decreaseProQuantity" data-productId="{$details->productId}">
        <img src="../views/default/assets/img/resturant/subtract.png" style="width: 16px;height: 16px">
    </td>
    <td class="removeOrderProduct" data-productId="{$details->productId}">
        {if $details->isPrinted == 0}<img src="../views/default/assets/img/resturant/cancel.png" >{/if}
    </td>
     <td    {if $Programsettingdata->changeOrderproduct == 0} style="display: none" {/if}>
        <input type="checkbox" class="changeOrderProduct" data-id="{$details->id}" >
      </td>
</tr>
{assign var=i value=$i+1}
{/foreach}

<tr style="display: none" id="tempTr">
    <td colspan="8" >
        <input type='hidden' id='playstation' value='{$playstation}'/>

        {if $tableIdCheckService > 0}
        {assign var=tableIdCheckService value=1}
        {/if}
        <input type="hidden" id="tableServiceOn" value="{if ($tableIdCheckService|in_array:$Programsettingdata->restaurantServiceOn)}1{else}0{/if}"/>
    </td>
</tr>
{literal}
<script>
    $('#playStationDiv').hide();
    $('#totalOfTotalsDiv').hide();
    $('#playStationText').text('');
    var playstation = JSON.parse($('#playstation').val());
    if (playstation && Number(playstation.id) > 0) {
        $('#psPrice').val(playstation.netPrice - playstation.cardPayed);
        $('#psPriceCardPayed').val(playstation.cardPayed);
        $text = 'حجز بلاى ستيشن رقم ' + playstation.id + ' بمبلغ ' + playstation.netPrice + ' ';
        if (playstation.cardPayed > 0) {
            $text += 'مدفوع بالباقة ' + playstation.cardPayed;
        }
        $('#playStationText').text($text);
        $('#playStationDiv').show();
        $('#totalOfTotalsDiv').show();
    }
    hasService();

    //finally
    $('#tempTr').remove();


    //functions
    function hasService() {
        var thereIsRestTax = $('#thereIsRestTax').val();
        var tableServiceOn = $('#tableServiceOn').val();
        if (thereIsRestTax == 1) {
            if (tableServiceOn == 1) {
                $('.shownServiceForTable').show();
                $('.hiddenServiceForTable').hide();
            } else {
                $('.shownServiceForTable').hide();
                $('.hiddenServiceForTable').show();
            }
        }
    }
</script>
{/literal}