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

        <ol class="breadcrumb">
            <li><a href="#">نظام المطالبة</a></li>
            <li><a href="claimController.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">
                {literal}
                <form class="form-horizontal" action="claimController.php" id="claimformajax" method="post"
                    enctype="multipart/form-data" data-dosave="?do=savedata" data-direction="">

                    {/literal}


                      <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">من تاريخ  </label>
                        <div class="col-lg-4"> <span id="sprydate">
                                <input type="text" class="form-control awdatepicker changetypeclientid" id="from_date" autocomplete="off"
                                    data-table="claims" data-date-format="yyyy-mm-dd" placeholder=" "
                                    name="from_date" id="bn" required   value="{$claim->from_date}">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> الى تاريخ </label>
                        <div class="col-lg-4"> <span id="sprydate">
                                <input type="text" class="form-control awdatepicker changetypeclientid" id="to_date" autocomplete="off"
                                    data-table="claims" data-date-format="yyyy-mm-dd" placeholder=" "
                                    name="to_date" id="bn" required value="{$claim->to_date}">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الجهات المختصة </label>
                        <div class="col-lg-4">
                            <input id="typeclientids" type="text" multiple="" name="typeclientids" class="getselectmultiple changetypeclientid"  data-placeholder=" اختر     "  data-table="typeclient" data-tableid="typeId"  fornvalids="{$claim->typeclientids}" 
                            data-join="  "   urlgetdata="claimController.php?do=gettypeclientids" 
                            data-filter=" and typeclient.conditions = 0 " editforn="{$claim->id}" 
                            data-parent="" data-itr=""  data-search="typeName,'/',comments"/>  
                          
                        </div>
                    </div>

                    <div id="changetypeclientidhtml">
                        <table class="table table-black" >
                            <thead>
                                <tr style="background: #ccc;">
                                    <th style="width:50px;">م</th>
                                    <th>العميل </th>
                                    <th>جهة التعاقد</th>
                                    <th>المتبقى </th>
                                    <th>حذف </th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=itr value=1}
                                {foreach $sellbills as $sellbill}
                                <tr id="removerowtable{$sellbill['id']}">
                                    <td >{$sellbill@iteration}</td>
                                    <td >{$sellbill['clientname']}</td>
                                    <td >{$sellbill['typeName']}</td>
                                    <td >{$sellbill['valueclaimed']}</td>
                                    <td > <a href="javascript:;"  data-id="{$sellbill['id']}" data-url="claimController.php?do=removeclaimsclientbills" class="btn btn-xs red pull-right removerowtable"> x
                                            </a></td>
                                    <input type="hidden"  name="claimsclientbillid_{$itr}" value="{$sellbill['id']}">
                                    <input type="hidden"  name="clientid_{$itr}" value="{$sellbill['clientid']}">
                                    <input type="hidden"  name="typeclientid_{$itr}" value="{$sellbill['typeclientid']}">
                                    <input type="hidden"  name="sellbillids_{$itr}" value="{$sellbill['sellbillidsprices']}">
                                    <input type="hidden"  name="sellbillfinalbill_{$itr}" value="{$sellbill['sellbillfinalbill']}">
                                    <input type="hidden"  name="returnsellbillids_{$itr}" value="{$sellbill['returnsellbillidsprices']}">
                                    <input type="hidden"  name="returnsellbillfinalbill_{$itr}" value="{$sellbill['returnsellbillfinalbill']}">
                                    <input type="hidden"  name="valueclaimed_{$itr}" value="{$sellbill['valueclaimed']}">
                                </tr>
                                {capture assign=itr}{$itr+1}{/capture}
                                {/foreach}
                                <tr>
                                    <td  colspan="5" class="text-center" style="background: #00dcff;font-size: 20px;"> اجمالى المتبقي     : {$claim->claim_value}</td>
                                    <input type="hidden" id="allvalueclaimed" name="allvalueclaimed" value="{$claim->claim_value}">
                                    <input type="hidden" id="sellbills" name="sellbills" value="{count($sellbills)}">
                                </tr>

                            </tbody>
                        </table>

                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">رقم المطالبة  </label>
                        <div class="col-lg-4"> <span id="sprydate">
                                <input required="required" type="text" name="claim_number" digits="true"
                                class="form-control checkcolumn nummbers" placeholder=""
                                data-table="claims" data-tablecol="claim_number" data-tableid="{$claim->id}" data-parentid=""
                                data-parentcol="" value="{$claim->claim_number}">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">قيمة المطالبة    </label>
                        <div class="col-lg-4"> <span id="sprydate">
                                <input required="required" type="text" name="claim_value" 
                                class="form-control  nummbers" placeholder="" readonly 
                                data-table="claims" id="claim_value" data-tableid="" data-parentid=""
                                data-parentcol="" value="{$claim->claim_value}">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>

                

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">
                            <textarea class="form-control" name="claim_comment" rows="2" placeholder="">{$claim->claim_comment}</textarea>
                        </div>
                    </div>



              

                    <input type="hidden" name="claimid" id="claimid" value="{$claim->id}" />
                  <!--   {if $charitydata->del neq 5}
                    <input type="hidden" class="deldata" value="{$charitydata->del}" />
                    {/if} -->



                    {if $claim->del lt 2}
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" class="btn btn-primary pull-left saveformajax" data-form="claimformajax" data-action="0">تعديل </button>
                        </div>
                    </div>
                    {/if}
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        // deldata();
        selecteditMulti();
    });
</script>