<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">ادارة الفواتير</a></li>
            <li class="active">نسب الخصومات على الفواتير</li>
        </ol>

        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">نسب الخصومات على الفواتير</h3>
                <a href="{$youtubes[45]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>

            <div class="panel-body" style="padding: 10px;">

                <form action="sellbillController.php?do=discountcontrolsave" method="post" id="discountcontrolForm" class="form-horizontal">
                    <div class="row"  >

                        <div class="row">
                            <div class="col-lg-6">
                                <h4 class="col-lg-4">نسب الخصم للاجمالى </h4>
                            </div>

                            <div class="col-lg-6">
                                <button type="button" id="addrow" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                            </div>

                        </div>
                        <div class="table-responsive bd-gr">
                            <table class="table billtable table-bordered table-black " id="discountsTable">
                                <thead>
                                    <tr>
                                        <th colspan="2">اجمالى الفاتورة</th>
                                        <th rowspan="2">نسبة الخصم</th>
                                        <th rowspan="2">حذف</th>
                                    </tr>
                                    <tr>
                                        <th>من</th>
                                        <th>الى</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {assign var=i value=1}
                                    {foreach $allDiscounts as $one}
                                    <tr id="row{$i}">
                                        <td><input type="text" class="form-control positivefloat totalFrom" name="total_from{$i}" id="total_from{$i}" data-itr="{$i}" value="{$one->totalFrom}"/></td>
                                        <td><input type="text" class="form-control positivefloat totalTo" name="total_to{$i}" id="total_to{$i}" data-itr="{$i}" value="{$one->totalTo}"/></td>
                                        <td><input type="text" class="form-control positivefloat percentage" name="discount{$i}" id="discount{$i}" data-itr="{$i}" value="{$one->discount}"/></td>
                                        <td><button type="button" class="close flt-none removeicon removeIt" data-itr="{$i}">×</button></td>
                                    </tr>
                                    {assign var=i value=$i+1}
                                    {/foreach}
                                </tbody>
                            </table>
                            <input type="hidden" name="itr" id="itr" value="{$i}"/>
                        </div>
                    </div>
                    <div class="row" align="center">
                        <button type="button" id="saveIt" class="btn btn-primary">  حفظ</button>
                    </div>

                </form>

            </div> <!-- end of panel-body-->

        </div>  <!-- end of panel panel-default-->

    </div> <!-- end of container-->

</div>  <!-- end of row-->
