

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#"> صرف مواد للمشروع</a></li>
            <li><a href="projectoperationControllerreturn.php?do=show">عرض صرف مواد للمشروع </a></li>
            <li class="active">تعديل </li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تعديل </h3>
            </div>
            <div class="panel-body">

                <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                <input type="hidden" name="path" id="path" value="{$path}"/>
                <input name="storenegative" type="hidden" value="{$storenegative}" id="storenegative" />
                <input name="edit_projectmaterialbill" type="hidden" value="1" id="edit_projectmaterialbill" />



                {literal}
                <form class="nameToBeChecked form-horizontal" role="form" id="projectoperation_form" action="projectoperationControllerreturn.php?do=update" method="post" >

                    {/literal}


                    <div class="row">
                        <div class="col-lg-8">
                            <div class="form-group">
                                <label class="col-lg-3 control-label">رقم التسلسل</label>
                                <div class="col-lg-4">
                                    <input type="text" name="serialno" id="serialno" class="form-control" placeholder="رقم التسلسل" value="{$editelement->serilno}" readonly="">
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-lg-3 control-label"> اسم المخزن</label>
                                <div class="col-lg-4">
                                    <select class="select2 wdt100" name="storeid" id="storeid" required>
                                        {foreach $storeData as $store}
                                        <option value="{$store->storeId}" {if {$editelement->storeid} eq {$store->storeId} } selected {/if}>{$store->storeName}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label"> المورد </label>
                                <div class="col-lg-4">
                                    <select class="select2 wdt100" name="supplierid" id="supplierid" >
                                        {foreach $supplierData as $supplier}
                                        <option value="{$supplier->supplierid}" {if {$editelement->supplierid} eq {$supplier->supplierid} } selected {/if}>{$supplier->suppliername}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                        </div>


                        <div class="col-lg-4">
                            <div class="form-group mg-bt5">
                                <label for="clientname" class="col-lg-4 control-label">اسم  المشروع</label>
                                <div class="col-lg-8">
                                    <input type="text" name="projectname" id="project_id"   class="select2product wdt100"  data-placeholder="اختر مشروع" required tabindex="301"/>
                                    <input type="hidden" id="edit_hiddenprojectId" name="edit_hiddenprojectId" value="{$projectData->id}"  />
                                    <input type="hidden" id="edit_hiddenprojectName" name="edit_hiddenprojectName" value="{$projectData->name}"  />

                                </div>
                            </div>
                            <!-- end of form-group-->

                        </div>

                        <div class="col-lg-4">
                            <div class="form-group mg-bt5" >
                                <label class="col-lg-4 control-label">تاريخ الفاتورة</label>
                                <div class="col-lg-8">
                                    <input type="text" class="form-control awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" placeholder="تاريخ الفاتورة" value="{$editelement->projdate}" required="" name="billdate" id="billdate">
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group mg-bt5" >
                                <label class="col-lg-4 control-label">التعليق   </label>
                                <div class="col-lg-8" id="commentproject">
                                    {$projectData->detail}
                                </div>
                            </div>
                        </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="addpro_projectoperation" id="addpro_projectoperation" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                            </div>
                        </div>

                        <input type="hidden" name="offerhidden_itr" id="offerhidden_itr" value="{$allproductcount}"/>
                        <input type="hidden" name="supervision_type" id="supervision_type" value="{$editelement->supervision_type}"/>
                        <input type="hidden" name="supervision_amount" id="supervision_amount" value="{$editelement->supervision_amount}"/>
                        <input type="hidden" name="expensestypes" id="expensestypes" value="yes"/>
                         <input type="hidden" name="expenseexchange" id="expenseexchange" value="1"/>
                        <input type="hidden" name="supervisionamount" id="supervisionamount" value="yes"/>
                        <input type="hidden" name="supervision" id="supervision" value="yes"/>
                        <input type="hidden" name="showprice" id="showprice" value="yes"/>
                        <!-- ======================================Table=============================================================================================== -->

                        <div class="table-responsive bd-gr">
                            <table class="table billtable table-bordered table-black" id="projectoperation_tb">
                                <thead>
                                    <tr>
                                        <th class="wdt120">اسم المنتج</th>
                                        <th class="wdt120"> العدد</th>
                                        <th class="wdt80">السعر</th>
                                        <th class="wdt100n"> الاجمالى</th>
                                        <th class="wdt200"> نوع المصرةف</th>
                                        {if $editelement->supervision_type eq 1}
                                        <th class="wdt100n" id="supervisiontype"> قيمه</th>
                                        {else}
                                        <th class="wdt100n" id="supervisiontype"> النسبة</th>
                                        {/if}
                                        <th class="wdt100n"> الاشراف</th>
                                        <th>حذف</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    {assign var=i value=1}
                                    {foreach $allproductData as $newpro}
                                    <tr>
                                        <td style="width:500px;">
                                            <input type="text" name="projectproudctid{$i}" id="project_proudctid{$i}"  required  class="select2product wdt100 clas_offerproduct" data-itr='1'  data-placeholder="اختر منتج" tabindex="301"/>
                                            <input type="hidden" id="edit_hiddenproductId{$i}" name="edit_hiddenproductId{$i}" value="{$newpro->productid}"  />
                                            <input type="hidden" id="edit_hiddenproductName{$i}" name="edit_hiddenproductName{$i}" value="{$newpro->productName}"  />
                                        </td>

                                        <td>
                                            <input type="text" name="productnumber{$i}" id="productnumber{$i}"  required data-itr="{$i}"  class="form-control txt-nonraduis positiveNo calcprice pro_num" value="{$newpro->pronumber}" />
                                            <input type="hidden" id="proquqntity{$i}"/>
                                            <!-- <input type="hidden" id="probuyprice{$i}"/> -->
                                        </td>
                                           <td>
                                          
                                            <input type="text" id="probuyprice{$i}" name="probuyprice{$i}"  readonly="" class="txt-nonraduis pro_num" data-itr="{$i}" />
                                        </td>
                                        <td>
                                             <input type="text" id="totalbuyprice{$i}"  readonly="" class="txt-nonraduis"/>
                                        </td>
                                        <td>
                                            <input type="text" name="expensestypeid{$i}" required data-itr="{$i}" class="wdt100 expensetypeusers" id="expensetypeuserid{$i}" placeholder="اختر" />
                                            <input type="hidden" id="expensetypeuseridv{$i}"  value="{$newpro->expensestypeid}"  />
                                            <input type="hidden" id="expensetypeusertextv{$i}"  value="{$newpro->expensestypename}"  />
                                        </td>

                                        <td>
                                            <input type="text" name="supervision_amount{$i}"   data-itr="{$i}"  class="wdt100 csupervisionamount" id="supervision_amount{$i}" value="{$newpro->supervision_amount}" />
                                        </td>
                                        <td>
                                            <input type="text" name="supervision{$i}"  data-itr="{$i}"  class="wdt100 csupervision" id="supervision{$i}" placeholder="الاشراف"  value="{$newpro->supervision}" />
                                        </td>


                                        <td>
                                            <!-- <input type="hidden" id="totalbuyprice{$i}"/> -->
                                            <button type="button" id="remove1" class="projectoperation_remove close flt-none" aria-hidden="true"  >&times;</button>
                                        </td>
                                    </tr>
                                    {capture assign=i}{$i+1}{/capture}
                                    {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-primary pull-left ft-nor">
                            اجمالى العدد <span class="badge wht-clo">
                                <div id="div_totalnumber">0</div>
                            </span>
                            <input type="hidden" name="totalpronumber" id="totalpronumber" value="{$editelement->totalnum}">
                            <input type="hidden" name="finalsupervision" id="finalsupervision" value="{$editelement->finalsupervision}">
                        </button>
                    </div>

                      <div class="form-group">
                        <button type="button" class="btn btn-primary pull-left ft-nor">
                         الاجمالى <span class="badge wht-clo">
                                <div id="tfinaltotalprice">{$editelement->finaltotalprice}</div>
                            </span>

                        </button>
                        
                        
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-primary pull-left ft-nor">
                            اجمالى الاشراف <span class="badge wht-clo">
                                <div id="tfinalsupervision">{$editelement->finalsupervision}</div>
                            </span>

                        </button>
                        
                        
                    </div>
                    <!-- =================================================   -->




                    <input type="hidden" name="editid" id="editid" value="{$editelement->id}"/>
                    <input type="hidden" name="entryid" id="entryid" value="{$editelement->entryid}"/>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <input type="submit"   id="offerprice_save" class="btn btn-primary pull-left" value="حفظ">

                        </div>
                    </div>


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




    </div>
</div>


<input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>

<!--{literal}

<script type="text/javascript">
    var name = new Spry.Widget.ValidationTextField("name");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
</script>

{/literal}-->

