
<div class="container">
    <ol class="breadcrumb">
        <li><a href="#">عرض المنتجات</a></li>
        <li><a href="sellbillController.php?do=addsellBill&amp;billnameid=3">فاتورة المبيعات</a></li>
        <li class="active">اضافة عرض</li>
    </ol>
    <hr>
    <form class="form-horizontal " role="form" action="showController.php?do=update" method="post" id="sellbillForm" onsubmit="">
        <input type="hidden"  name="id" value="{$allclient->id}">

        <div class="row">
            <div class="col-lg-8">
                <!-- end of form-group-->
                <div class="form-group" style="display:block">
                    <label class="col-lg-3 control-label">تاريخ العرض</label>
                    <div class="col-lg-4"> <span id="sprydate">
                        <div class="input-group date form_datetime col-md-5" data-date=""
                             data-date-format="yyyy-mm-dd  h:i:s"
                             data-link-field="dtp_input1">
                        <input class="form-control" size="16" type="text" value="2019-09-04 11:24:00" name="mydate"
                               id="bn readonly=" "="" autocomplete="off">
                        <span class="input-group-addon "><span
                                class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-th col-lg-4"></span></span>
                    </div>                                <span class="textfieldRequiredMsg">*</span></span>
                    </div>
                </div>
            </div>
            <div class="form-group mg-bt5">
                <label class="col-lg-1 ">اسم العميل</label>
                <div class="col-lg-3">
                    <input type="hidden" id="client1" name="client" class="select2client wdt100 select2-offscreen" value="" data-placeholder="اختر عميل" tabindex="-1" style="display: inline-block;">
                </div>
            </div>



            <div class="row">
                <div class="row">
                    <hr>
                    <div class="col-lg-6">
                        <h4>عرض المنتجات</h4>
                    </div>
                    <div class="col-lg-6">
                        <button type="button" name="addpr" id="addpr" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                    </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  style="width: 40px">صورة المنتج</th>
                            <th class="wdt400">اسم المنتج</th>
                            <th class="wdt100n check_tr_quantity ">العدد المطلوب</th>
                            <th class="wdt100n check_tr_quantity ">العدد بالمخزن</th>
                            <th class="wdt100n check_tr_quantity ">العدد المتاح</th>
                            <th class="wdt100n check_tr_quantity ">العدد الناقص</th>
                            <th class="wdt100n">السعر</th>
                            <th class="wdt100n">الاجمالى</th>
                            <th>حذف</th>
                        </tr>
                        </thead>

                        <tbody id="pro">
                        {assign var=i value=1}
                        {foreach $allpro as $pro}


                        <tr>
                            <td style="width: 40px">
                                <input class="btn btn-primary"style="width: 30px"  id="images">
                            </td>
                            <td class="productdiv1">
                                <input type="hidden" id="product1" name="product{$i}" class="select2product wdt100 select2-offscreen selproduct quantity" data-itr="1"  value="{$pro->productid}" data-placeholder="اختر منتج" tabindex="-1" style="display: inline-block;" data-itr="{$i}">
                            </td>
                            <td class="quantity1">
                                <input type="text" name="quantity{$i}" id="quantity{$i}" class="form-control  positivefloat quantity quant quantstore"  value="{$pro->quantity}"  data-itr="{$i}">
                            </td>
                            <td class="prostore1">
                                <input type="text" name="prostore{$i}" id="prostore{$i}" class="form-control  positivefloat quantity prostore quantstore"  value="{$pro->storequant}"  data-itr="{$i}">
                            </td>
                            <td class="proavailable1">
                                <input type="text" name="proavailable{$i}" id="proavailable{$i}" class="form-control  positivefloat quantity proavailable"  value="{$pro->availablequant}"  data-itr="{$i}">
                            </td>
                            <td class="prominus1">
                                <input type="text" name="prominus{$i}" id="prominus{$i}" class="form-control  positivefloat quantity prominus "  value="{$pro->miunquant}"  data-itr="{$i}">
                            </td>
                            <td  class="price1">
                                <input type="text" name="price{$i}" id="price{$i}" class="form-control  positivefloat quantity price " value="{$pro->price}"  data-itr="{$i}">
                            </td>
                            <td class="total1">
                                <input name="total{$i}" id="total{$i}" class="form-control  positiveNo quantity total " value="{$pro->total}" type="text" data-itr="{$i}">
                            </td>
                            <td class="remove1">
                                <button id="remove{$i}" type="button" class="close flt-none  remove" aria-hidden="true">×</button>
                            </td>
                        </tr>




<!--                        <tr>-->

<!--                            <td style="width: 40px">-->
<!--                                <input class="btn btn-primary"style="width: 30px"  id="images">-->
<!--                            </td>-->
<!--                            <td class="productdiv{$i}">-->
<!--                                <input type="hidden" id="product{$i}" name="product{$i}" class="select2product wdt100 select2-offscreen selproduct quantity" data-itr="1"  data-placeholder="اختر منتج" tabindex="-1" style="display: inline-block;" >-->
<!--                            </td>-->
<!--                            <td class="quantity1">-->
<!--                                <input type="text" name="quantity{$i}" id="quantity{$i}" class="form-control  positivefloat quantity quant quantstore"  value="{$pro->quantity}"  data-itr="1">-->
<!--                            </td>-->
<!--                            <td class="prostore1">-->
<!--                                <input type="text" name="prostore{$i}" id="prostore{$i}" class="form-control  positivefloat quantity prostore quantstore"  value="{$pro->storequant}"  data-itr="1">-->
<!--                            </td>-->
<!--                            <td class="proavailable1">-->
<!--                                <input type="text" name="proavailable{$i}" id="proavailable{$i}" class="form-control  positivefloat quantity proavailable"  value="{$pro->availablequant}"  data-itr="1">-->
<!--                            </td>-->
<!--                            <td class="prominus1">-->
<!--                                <input type="text" name="prominus{$i}" id="prominus" class="form-control  positivefloat quantity prominus "  value="{$pro->miunquant}"  data-itr="1">-->
<!--                            </td>-->
<!--                            <td  class="price1">-->
<!--                                <input type="text" name="price{$i}" id="price{$i}" class="form-control  positivefloat quantity price " value="{$pro->price}"  data-itr="1">-->
<!--                            </td>-->
<!--                            <td class="total1">-->
<!--                                <input name="total{$i}" id="total{$i}" class="form-control  positiveNo quantity total  " value="{$pro->total}" type="text" data-itr="1">-->
<!--                            </td>-->
<!--                            <td class="remove1">-->
<!--                                <button id="remove1" type="button" class="close flt-none  remove" aria-hidden="true">×</button>-->
<!--                            </td>-->


<!--                        </tr>-->

                        {assign var=i value=$i+1}
                        <input type="hidden" id="itr" name="itr" value="{$i}">

                        {/foreach}

                        </tbody>
                    </table>
                </div>
                <button type="button" class="btn btn-primary pull-left ft-nor " >
                    اجمالى العرض <span class="badge wht-clo total " id="total">
                        <div id="sellbilltotal totals">{$allclient->alltotal}</div>
                    </span>
                    <input type="hidden" name="alltotal" id="tal" class="totall" value="0">
                </button>
            </div>

            <img  style="width: 200px;height: 200px;display:none"   id="logo">

            <table class="table" >
                <thead>
                <tr>
                    <th   style="text-align: center" colspan="2">الطلوب</th>
                    <th  style="text-align: center" colspan="2">المخزن</th>
                    <th  style="text-align: center" colspan="2">المتاح</th>
                    <th  style="text-align: center" colspan="2">الناقص</th>
                </tr>
                </thead>
                <tbody >
                <tr style="text-align: center">
                    <td  style="color: blue;width: 12.5%" > <span class="allquantity" style="color: #000;padding-left:10px" >{$allclient->allquantity}</span>الكميه</td>
                    <input type="hidden" name="allquantity"  class="allquantity" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="total"   style="color: #000;padding-left:10px" >{$allclient->alltotal}</span>السعر</td>
                    <td  style="color: blue;width: 12.5%" > <span class="allquantstore" style="color: #000;padding-left:10px" >{$allclient->allquantstore}</span>الكميه</td>
                    <input type="hidden" name="allquantstore"  class="allquantstore" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="pricestore" style="color: #000;padding-left:10px" >{$allclient->pricestore}</span>السعر</td>
                    <input type="hidden" name="pricestore"  class="pricest" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="allquantavailable" style="color: #000;padding-left:10px" >{$allclient->allquantavailable}</span>الكميه</td>
                    <input type="hidden" name="allquantavailable"  class="allquantavailable" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="priceavailable" style="color: #000;padding-left:10px" >{$allclient->priceavailable}</span>السعر</td>
                    <input type="hidden" name="priceavailable"  class="priceavailable" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="allquantminus" style="color: #000;padding-left:10px" >{$allclient->allquantmiun}</span>الكميه</td>
                    <input type="hidden" name="allquantminus"  class="allquantminus" value="0">
                    <td  style="color: blue;width: 12.5%" > <span class="pricestminus" style="color: #000;padding-left:10px" >{$allclient->pricemiun}</span>السعر</td>
                    <input type="hidden" name="pricestminus" class="pricestminus" value="0">
                </tr>
                </tbody>
            </table>
        </div>
        <!-- end of second row-->
        <div style="clear: both"></div>
        <div class="col-md-12">
            <div class="dt-buttons">
                <a class="dt-button buttons-print" tabindex="0" aria-controls="show_stores" href="showController.php?do=pdf" style="color: red">
                    <span><i class="fa fa-print dt-button tooltips" data-container="body" data-placement="top" data-original-title=" طباعه" aria-hidden="true"></i></span>
                </a>
                <a class="dt-button buttons-copy buttons-html5" tabindex="0" aria-controls="show_stores" href="#"><span><i class="fa fa-files-o dt-button tooltips" data-container="body" data-placement="top" data-original-title="نسخ" aria-hidden="true"></i></span>
                </a>
                <a class="dt-button" tabindex="0" aria-controls="show_stores" href="#"><span><i class="fa fa-file-pdf-o dt-button tooltips" data-container="body" data-placement="top" data-original-title="pdf" aria-hidden="true"></i></span>
                </a>
                <a class="dt-button buttons-excel buttons-html5" tabindex="0" aria-controls="show_stores" href="#"><span><i class="fa fa-file-excel-o dt-button tooltips" data-container="body" data-placement="top" data-original-title="EXCEL" aria-hidden="true"></i></span>
                </a>
            </div>
        </div>
        <div class="row" style="padding-top: 30px;text-align: center">
            <input name="Receipt" onclick="print_Custom('mycustomheader');" value="طباعه"  class="btn btn-primary" type="button">
            <button type="submit" id="saveBill" onclick="return addDataOnly();" class="btn btn-primary">حفظ</button>
            <button type="submit" id="saveAndNew" onclick="return addDataAndReturn();" class="btn btn-success">حفظ وجديد</button>

            <!-- <button type="button" onclick="printData();" class="btn btn-info">طباعة</button>-->
        </div>
        <br>
        <div class="row">
            <style>
                .unsufficient{
                    background-color: #f59a99 !important;
                }
                .note-warning{
                    background-color: #faeaa9;
                    border-color: #f3cc31;
                    color: #000;
                    border-right: 5px solid #f3cc31;
                    border-radius: 4px 0 0 4px;
                    margin: 0 0 20px;
                    padding: 15px 15px 15px 30px;
                }
            </style>
            <input type="hidden" name="storenegative" id="storenegative" value="1">
            <div class="note-warning" style="display: none" id="check_store_div">
                <h4 class="block" id="check_store_msg"></h4>
            </div>
        </div>
        <!-- end of fifth row-->

    </form>
</div>