{literal}
<script>
$(function() {
    $("table input,textarea").each(function(index, element) {
        $(this).attr('disabled',true);
    });
});
</script>
{/literal}




<div style="display:none" id="suppliersdiv">
  {foreach $supplierData as $data}
    <option value="{$data->supplierid}">{$data->suppliername}</option>
  {/foreach}

</div>

<div class="row noprint">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading headercolorx">
                <h6 class="text-center"><a href="#"  id="client" ><strong> ضمان عميل</strong></a></h6>
                    
            </div>
            <div class="panel-body" id="clientdiv" {if empty($clientdata)}style="display:none"{else} style="display:block"{/if}>
                <div class="table-responsive">
                    <!-- hidden values -->
                    <input type="hidden" name="clint_insure_no" id="clint_insure_no" value="{$clientitr}">
                    <input type="hidden" name="clint_tabindex_no" id="clint_tabindex_no" value="5">
                    <table class="table table-condensed" >
                        <thead>
                            <tr>
                                <td><strong>اسم المنتج</strong></td>
                                <td class="text-center"><strong>سيريل</strong></td>
                                <td class="text-center"><strong>فاتوره البيع</strong></td>
                                <td class="text-center"><strong>فاتوره الشراء</strong></td>
                                <td class="text-center"><strong>مده ضمان</strong></td>
                                <td class="text-center"><strong>الحاله</strong></td>
                                <td class="text-center"><strong>العيب</strong></td>
                                <td class="text-center"><strong>ملاحظات</strong></td>
                                <td class="text-center"><strong>ملاحقات</strong></td>
                                <td class="text-center"><strong>تكلفه مبدئيه</strong></td>
                                <td class="text-center"><strong>تكلفه شحن</strong></td>
                                <td class="text-center"><strong> المرحله الحاليه</strong></td>
                                <td class="text-center"><strong>مورد</strong></td>
                                
                            </tr>
                        </thead>
                        <tbody id="client_insure_container">
                        	<input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                            <input type="hidden" name="clientitr" id="clientitr" value="{$clientitr}"/>
                          
                           
                             {assign var=y value=1}
                            {foreach $clientdata as $data}
                            {if $data->currentstage == 11}<tr class="danger"> 
                            {else}<tr> 
                            {/if}
                                <td>
                                
                                 <div id="returnproductdiv{$y}">
                                    <input type="hidden" class="select2ajax select2-offscreen" name="product{$y}" id="product{$y}" tabindex="5" data-placeholder="اختر منتج{$y}"  disabled="disabled">
                                  <label id="selectfirst" style="display:none" > من فضلك اختر المنتج اولا</label>
                                	
                                     <input type="hidden" id="reoldproduct{$y}" name="reoldproduct{$y}" value="{$data->productId}"  />
                                       <input type="hidden" id="reoldname{$y}" name="reoldname{$y}"  value="{$data->productName}"  />
                                       
                                        <input type="hidden" id="productname{$y}" name="productname{$y}"  value="{$data->ourserial}"  />
                                          <input type="hidden" id="detailid{$y}" name="detailid{$y}"  value="{$data->id}"  />
                                                  </div>
                                
                                </td>
                                <td class="text-center">
                                    <input type="text" class="form-control client_serial" name="client_serial{$y}" id="client_serial{$y}" tabindex="5" placeholder="السيريل" data-no='{$y}' value="{$data->productserial}" >
                                </td>
                                
                                <td class="text-center">
                              		<input type="hidden" class="form-control  pull-right" tabindex="5" name="client_sellbill_type{$y}" id="client_sellbill_type{$y}" placeholder="نوع الفاتوره" />
                                    <input type="text" class="form-control  pull-right" name="client_sellbill_serial{$y}" id="client_sellbill_serial{$y}" tabindex="5" placeholder="رقم الفاتوره" value="{$data->sellbillid}"/>
                                    <div class="clearfix"></div>
                                    <input type="text" class=" pull-right awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" value="2014-09-06" placeholder="{$today}"  tabindex="5" name="client_sellbill_date{$y}" id="client_sellbill_date{$y}" value="{$data->sellbilldate}"/>
                               		
                                </td>
                                <td class="text-center">
                           			<input type="hidden" class="form-control  pull-right" tabindex="5" name="client_buybill_type{$y}" id="client_buybill_type{$y}" placeholder="نوع الفاتوره" />
                                    <input type="text" class="form-control  pull-right" tabindex="5" name="client_buybill_serial{$y}" id="client_buybill_serial{$y}" placeholder="رقم الفاتوره" value="{$data->buybillid}" />
                                    <div class="clearfix"></div>
                                    <input type="text" class=" pull-right awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" value="{$today}" placeholder="تاريخ الفاتورة"  tabindex="5" name="client_buybill_date{$y}" id="client_buybill_date{$y}" value="{$data->buybilldate}"/>
                              
                                </td>
                                
                                <td class="text-center">
                                    <input type="text" class="form-control"  placeholder="مده الضمان" tabindex="5" name="client_insurce_duration{$y}" id="client_insurce_duration{$y}" value="{$data->insduration}">
                                </td>
                                <td class="text-center" nowrap>
                                    <div class="radio">
                                        <label>
                                         <input type="hidden" name="optionsRadiostype{$y}" id="optionsRadiostype{$y}"  tabindex="5" >
                                            <input type="radio" name="optionsRadios{$y}" id="optionsRadios{$y}" value="0" tabindex="5" {if {$data->insstatus} eq 0 } checked {/if}>
                                            خاضع
                                        </label>
                                    </div>
                                    <div class="radio">
                                        <label>
                                            <input type="radio" name="optionsRadios{$y}" id="optionsRadiosx{$y}" value="1" tabindex="5" {if {$data->insstatus} eq 1 } checked {/if} >
                                            غير خاضع
                                        </label>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <textarea class="form-control" name="clinet_error{$y}" id="clinet_error{$y}"  tabindex="5">{$data->problem}</textarea>
                                </td>
                                <td class="text-center">
                                    <textarea class="form-control" name="client_note{$y}" id="client_note{$y}" tabindex="5">{$data->comment}</textarea>
                                </td>
                                <td class="text-center">
                                    <textarea class="form-control" name="client_attch{$y}" id="client_attch{$y}" tabindex="5">{$data->attach}</textarea>
                                </td>
                                <td class="text-center">
                                    <input type="text" class="form-control intinal_value" value="{$data->initialcost}" name="client_intinal_cost{$y}" id="client_intinal_cost{$y}" tabindex="5" placeholder="تكلفه مبدئيه" >
                                    <input type="hidden" class="form-control intinal_valuex" value="{$data->initialcost}" name="client_intinal_costx{$y}" id="client_intinal_costx{$y}" tabindex="5" placeholder="تكلفه مبدئيه" >
                                </td>
                                <td class="text-center">
                                    <input type="text" class="form-control ship_value" value="{$data->shipcost}" name="client_ship_cost{$y}" id="client_ship_cost{$y}" tabindex="5" placeholder="تكلفه الشحن">
                                     <input type="hidden" class="form-control ship_valuex" value="{$data->shipcost}" name="client_ship_costx{$y}" id="client_ship_costx{$y}" tabindex="5" placeholder="تكلفه الشحن">
                                </td>
                                
                                 <td class="text-center">
                                    <input type="text" class="form-control" value="{$data->title}" name="currentstage{$y}" id="currentstage{$y}" tabindex="5" >
                                   
                                </td>
                                <td class="text-center">
                                <div id="supplierIdDiv{$y}">
                                <input type="hidden" class="select2ajax select2-offscreen client_supplier" name="client_supplier{$y}" id="client_supplier{$y}" tabindex="5" data-placeholder="اختر مورد" data-no='{$y}' value="{$data->suppliername}" disabled="disabled">
                               
                               		 <input type="hidden" id="reoldsupplierclient{$y}" name="reoldsupplierclient{$y}" value="{$data->supplierid}"  />
                                       <input type="hidden" id="reoldnamesupplierclient{$y}" name="reoldnamesupplierclient{$y}"  value="{$data->suppliername}"  />
                               </div>
                               
                               <input type="hidden" id="stagefrom{$y}" name="stagefrom{$y}"  value="{$data->stageFrom}"  />
                               <input type="hidden" id="stageto{$y}" name="stageto{$y}"  value="{$data->stageTo}"  />
                               <input type="hidden" id="currentstage{$y}" name="currentstage{$y}"  value="{$data->currentstage}"  />
                                <input type="hidden" id="status{$y}" name="status{$y}"  value="{$data->status}"  />
                                 <input type="hidden" id="cost{$y}" name="cost{$y}"  value="{$data->cost}"  />
                                <!--<div id="supplierIdDiv1">
                                    <select data-placeholder="اختر المورد" data-no="1" class="select2 pull-left client_supplier"  tabindex="5" name="client_supplier1"  id="client_supplier1" required>
                                        <option value=""></option>
                                        <option value="-2" class="newoption">إضافة مورد جديد</option>
                                        {foreach $supplierData as $data}
                                        	<option value="{$data->supplierid}">{$data->suppliername}</option>
                                        {/foreach}
                                      
                                    </select>
                                    </div>-->
                                </td>
                           
                               
                                
                       
                            </tr>
                             {capture assign=y}{$y+1}{/capture} 
						{/foreach}
                        </tbody>
                    </table>
                    <table class="table table-condensed">
                        <tbody>
                            <tr>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow"></td>
                                <td class="highrow text-center totaltxt"><strong>اجمالى التكلفه المبدئيه</strong></td>
                                <td class="highrow text-right totalvalue" id="client_total_intial" >0</td>
                                <input type="hidden" name="client_total_intial" id="client_total_intialx" value="0"/>
                                <td class="highrow text-center totaltxt"><strong>اجمالى  تكلفه الشحن</strong></td>
                                <td class="highrow text-right totalvalue" id="client_total_ship">0</td>
                                <input type="hidden" name="client_total_ship" id="client_total_shipx"/>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
