<!-- === here the drop down list that fill the product list === -->
<style>
    .proDetails{
        cursor: pointer;
    }
    .proDetails:hover{
        text-decoration: underline;
        color: blue;
        font-weight: bold;
    }
    .newoption {
        background-color:#CCCCCC !important;
        font-weight:bold !important;
    }
    /*for select2-drop of product*/
    .largeWidthForDropDown{
        width:500px !important;
    }
</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">ادارة الفواتير</a></li>
            <li><a href="billTemplateController.php?do=show">الفواتير المحفوظة</a></li>
            <li class="active">تفاصيل الفواتير المحفوظة</li>
        </ol>
        <h3>تفاصيل الفواتير المحفوظة</h3>
        <hr/>


        <form class="form-horizontal " role="form" action="billTemplateController.php?do=show" method="post" id="billTemplateForm">
            <div class="">
                <div class="form-group">
                    <div class="col-lg-6">
                        <label class="sr-only">الاسم </label>
                        <input type="text" class="form-control" name="name" id="name" value="{$billTemplate->name}" readonly>
                    </div>
                </div>
            </div>

            <!-- end of hidden ===============================-->


            <div class="" {if {$billsettingsData[14]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
                <div class="row mobile-p">
                    <hr/>
                    <div class="col-lg-6 col-sm-4">
                        <h4 id="header4Sell">فاتورة المبيعات</h4>
                    </div>
                </div>
                <!-- end of title row-->
                <div class="table-responsive bd-gr">
                    <table class="table billtable table-bordered  table-black" id="containerpros">
                        <thead>
                            <tr>
                                <th class="wdt120">الرقم</th>
                                <th class="wdt120 check_tr_parcode">الباركود</th>
                                <th class="wdt400">المنتج</th>
                                <th class="wdt100n check_tr_unit hidden">الوحدة</th>
                                <th class="wdt100n check_tr_quantity" >الكمية</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=i value=1}
                            {foreach $billTemplateSell as $item}
                            <tr>
                                <td>{$i}</td>
                                <td>{$item->parcode}</td>
                                <td>{$item->productName}</td>
                                <td class="wdt100n check_tr_unit hidden">
                                    {foreach $myunitdata{$i} as $mymyunitdata}
                                    {if {$item->unitid} eq {$mymyunitdata->productunitid} } {$mymyunitdata->unitName}  {/if}
                                    {/foreach}
                                </td>
                                <td>{$item->quantity}</td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- end of second row-->

            <div class="" {if {$billsettingsData[0]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
                <div class="row">
                    <hr/>
                    <div class="col-lg-6">
                        <h4 id="header4retSell">مردودات المبيعات</h4>
                    </div>
                </div>
                <!-- end of title row-->
                <div class="table-responsive bd-rd">
                    <table class="table billtable table-bordered table-black" id="containerReturn">
                        <thead>
                            <tr>
                                <th class="wdt120">الرقم</th>
                                <th class="wdt120 check_tr_parcode">الباركود</th>
                                <th class="wdt400">المنتج</th>
                                <th class="wdt100n check_tr_unit hidden">الوحدة</th>
                                <th class="wdt100n check_tr_quantity" >الكمية</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=i value=1}
                            {foreach $billTemplateRet as $item}
                            <tr>
                                <td>{$i}<input type="hidden" name="detailidRet{$i}" value="{$item->id}"></td>
                                <td>{$item->parcode}</td>
                                <td>{$item->productName}</td>
                                <td class="wdt100n check_tr_unit hidden">
                                    {foreach $myreunitdata{$i} as $remymyunitdata}
                                    {if $item->productunitid eq $remymyunitdata->productunitid} {$remymyunitdata->unitName}  {/if}
                                    {/foreach}
                                </td>
                                <td>{$item->quantity}</td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
            <input type="hidden" name="id" id="id" value="{$billTemplate->id}"/>
            <!-- end of third row-->
            <div class="clearfix"></div>
            <!-- end of fourth row-->
            <div class="row text-center">
                <button type="submit" id="saveBill" class="btn btn-primary">رجوع</button>
            </div>
            <br/>

        </form>
    </div>
</div>