<!--{literal}
<script>
$(function() {
    $('#comp_clientedit_form').submit(function() {
	
		//noradiv
			 $('#noraeditdiv').html2canvas({
				             
            onrendered: function (canvas) {
				 $('#img_valx1').val(canvas.toDataURL("image/png"));
				 	 mydata=document.getElementById('img_valx1').value;
					
	
					$.ajax({
						  url: "saveimage.php?",
						  type: "post",
						  data: {name: mydata},
						  success: function(data){
							alert(data);  
							$("#img_valx").val(data);
						return true;	
							
					  }  
					}); 
		
            }
        });
        // DO STUFF
        //return true; // return false to cancel form action
		return false;
    });
});
</script>
{/literal}
-->
<input name="img_val1" type="hidden" value=""  id="img_val1"/>
<div id="noradiv" style="text-align: right !important;"> 

 
<div class="container comp_mant">
    <form action="billreceiptController.php?do=update" method="post" id="comp_client_form">
    <input name="img_val" type="hidden" value=""  id="img_val"/>
   
        <div class="row">
            <div class="col-lg-12">
                <div class="text-center">
                    <!--<ol class="breadcrumb">
                        <li><a href="#">إدارة الفواتير</a></li>
                        <li><a href="#">فاتورة الاستلام</a></li>
                        <li class="active">تعديل فاتورة</li>
                    </ol>-->
                </div>
                <hr>
                <div class="row">
                    <div class="col-xs-12 col-md-3 col-lg-3">
                        <div class="panel panel-default">
                            <div class="panel-heading headercolorx">
                                بيانات الفاتوره
                            </div>
                            <input type="hidden" name="totalship" id="totalship" value="{$allrecept->shipcost}">
                            <input type="hidden" name="receptstatus" id="receptstatus" value="{$allrecept->status}">
                            <div class="panel-body">
                                <label class="aw_lb comp_width"><div class="aw_label pull-right">رقم الايصال :  </div>
                                <input name="receptnumber" class="comp_info_width pull-left"  type="text" tabindex="1" value="{$allrecept->receiptserial}" readonly="readonly" style="background-color:#999999"/>
                                   <!-- <input name="receptnumber" class="comp_info_width pull-left" type="number" tabindex="1" value="{$todayx}" required/>-->
                                </label>
                                <label class="aw_lb comp_width"><div class="aw_label pull-right">رقم مستندى :   </div>
                                    <input name="documentnumber" class="comp_info_width pull-left" type="text" tabindex="2" value="{$allrecept->documentid}" required/>
                                </label>
                            </div>
                        </div>
                    </div>
                     <input type="hidden" id="receptid" name="receptid"  value="{$allrecept->id}"  />
                     <input type="text" id="totalcost" name="totalcost"  value="{$allrecept->totalCost}"  />
                    <div class="col-xs-12 col-md-3 col-lg-3 pull-left">
                        <div class="panel panel-default ">
                            <div class="panel-heading headercolorx">بيانات الفاتوره</div>
                            <div class="panel-body">
                                <label class="aw_lb comp_width"><div class="aw_label pull-right">تاريخ الايصال :  </div>
                                    <input type="text" name="receptdate" required class="comp_info_width pull-left awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" value="{$allrecept->receiptdat}" placeholder="تاريخ الفاتورة"  tabindex="3"/>
                                </label>
                                <label class="aw_lb comp_width"><div class="aw_label pull-right">اسم العميل :  </div>
                                <div id="clientIdDiv">
                                    <select name="comp_client" id="comp_client" data-placeholder="اختر العميل" required class="select2 comp_info_width pull-left"  tabindex="4">
                                        <option value=""></option>
                                        <option value="-2" class="newoption">إضافة عميل جديد</option>
                                        
                                        {foreach $clientsData as $data}
                                        	<option value="{$data->clientid}" {if {$allrecept->clientid} eq {$data->clientid}} selected {/if}>{$data->clientname}</option>
                                        {/foreach}
                             
                                    </select>
                                    </div>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
