<style type="text/css">
.modal-header .close {
    margin-top: -24px;
    float: left;

}



</style>

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

        <ol class="breadcrumb">
            <li><a href="#">نظام  الصيانه</a></li>
            <li><a href="maintenancedeliverys.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="maintenancedeliverys.php"  id="saveformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata" data-direction="maintenancedeliverys.php?do=show">
                    {/literal}

                    <div class="form-group"  >
                        <label  class="col-lg-2 control-label"> البحث </label>
                        <div class="col-lg-10">
                              <input id="" type="text" name="maintenances"  class="getselectjoin gettabledata"  data-placeholder="  رقم الايصال او العميل او المورد او المنتج  "   data-table="maintenances" 
                              data-tableid="id" 
                              data-join="   LEFT JOIN client ON maintenances.clientid = client.clientid
                             LEFT JOIN supplier ON maintenances.supplierid = supplier.supplierid
                             LEFT JOIN branch ON maintenances.branchid = branch.branchId 
                             LEFT JOIN maintenancepolicys ON maintenances.maintenancepolicyid = maintenancepolicys.id "   
                            data-filter=" and maintenances.conditions = 0 and maintenances.maintenancecaseid = 3 " 
                              data-parent="" data-itr=""  
                              data-search="receiptnumber,'/',clientname,'/',suppliername"/> 
                        </div>
                    </div>

                    <div class="form-group">     
                        <label for="txtName" class="col-lg-2 control-label">رقم الايصال  </label>
                        <div class="col-lg-2">
                            <input    required="required"  readonly  type="text" name="receiptnumber" 
                            class="form-control checkcolumn"  placeholder="رقم الايصال "  
                            data-table="maintenances" data-filter=" receiptnumber = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                  
                        <label for="txtName" class="col-lg-2 control-label">     التاريخ والوقت    </label>
                        <div class="col-lg-2">
                            <input    required="required"  readonly  type="text" name="dateatime" 
                            class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  placeholder=" التاريخ والوقت  "  
                            data-table="maintenances" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">فروع الاستلام  </label>
                        <div class="col-lg-2">
                             <input id="branchId" type="text" name="branch"  class="getselectjoin branchId"  data-placeholder=" فروع الاستلام    "   data-table="branch" 
                              data-tableid="branchId"  data-join="" disabled  data-filter="" data-parent="" data-itr=""  
                              data-search="branchName"/>
                             <input  type="hidden" name="branchId" class="selectedit" data-tableidname="branchId" data-itr="" 
                             data-join="" data-table="branch" data-tableid="branchId" data-search="branchName" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">العملاء  </label>
                        <div class="col-lg-4">
                             <input id="clientid" type="text" disabled name="client"  class="getselectjoin clientid"  data-placeholder=" العملاء   "   data-table="client" 
                              data-tableid="clientid"  data-join=""   data-filter="" data-parent="" data-itr=""  
                              data-search="clientname,'/',clientphone"/>
                             <input  type="hidden" name="clientid" class="selectedit" data-tableidname="clientid"  data-itr="" 
                             data-join="" data-table="client" data-tableid="clientid" data-search="clientname,'/',clientphone" value="" />
                        </div>

                        <label for="txtName" class="col-lg-2 control-label">المنتجات   </label>
                        <div class="col-lg-4">
                             <input id="productId" type="text" name="product" disabled  class="getselectmultiple productId"  data-placeholder=" المنتجات    "  disabled  data-table="product" 
                              data-tableid="productId"  data-join=""   data-filter="" data-parent="" data-itr=""  
                              data-search="productName"  />
                             <input  type="hidden" name="productid" class="selecteditm" data-tableidname="productId" data-itr=""
                             data-join="" data-table="product" data-tableid="productId" data-search="productName" value="" />
                        </div>

                        
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الكمية </label>
                        <div class="col-lg-4">
                            <input type="text" name="quantity" readonly class="form-control" value="" placeholder="الكمية" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label"> العيب </label>
                        <div class="col-lg-4">
                            <input     readonly type="text" name="defect" 
                            class="form-control checkcolumn"  placeholder=" العيب    "  
                            data-table="supplier" data-filter=" defect = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol="" />
                            
                        </div>
                         
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الملحقات</label>
                        <div class="col-lg-4">
                            <input   readonly   type="text" name="accessories" 
                             class="form-control checkcolumn " placeholder=" الملحقات  " 
                             data-table="supplier" data-filter=" accessories = ? and conditions = 0 "  data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                        </div>
                         
                        <label for="txtName" class="col-lg-2 control-label">ملاحظات </label>
                        <div class="col-lg-4">
                            <input      readonly type="text" name="notes" 
                             class="form-control" placeholder=" ملاحظات  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                        </div>
                    </div>
                      <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">تكلفة تقديرية </label>
                        <div class="col-lg-4">
                            <input    readonly  type="text" name="estimatedcost" 
                             class="form-control" placeholder=" تكلفة تقديرية  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                            
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">تاريخ الشراء </label>
                        <div class="col-lg-4">
                            <input    readonly    type="text" name="datepurchase" 
                             class="form-control awdatepicker" placeholder=" تاريخ الشراء   "
                             data-table="" data-tablecol="" data-tableid="" data-date-format="yyyy-mm-dd" 
                            data-parentid="" data-parentcol=""/>    
                            
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الموردين  </label>
                        <div class="col-lg-4">
                             <input id="supplierid" type="text" name="supplier"  class="getselectjoin supplierid"  data-placeholder=" الموردين    " disabled   data-table="supplier" 
                              data-tableid="supplierid"  data-join=""   data-filter=" and supplier.conditions = 0 "  data-parent="" data-itr=""  
                              data-search="suppliername,'/',supplierphone"/>
                             <input  type="hidden" name="supplierid" class="selectedit" data-tableidname="supplierid"  data-itr="" 
                             data-join="" data-table="supplier" data-tableid="supplierid" data-search="suppliername,'/',supplierphone" value="" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">رقم الفاتورة </label>
                        <div class="col-lg-4">
                            <input   readonly   type="text" name="invoicenumber" 
                             class="form-control" placeholder=" رقم الفاتورة  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                            
                        </div>
                    </div>
                    <div class="form-group">
                    
                        <label for="txtName" class="col-lg-2 control-label">تاريخ الفاتورة </label>
                        <div class="col-lg-4">
                            <input    readonly   type="text" name="invoicedate" 
                             class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  placeholder=" تاريخ الفاتورة  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                            
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">المراكز  </label>
                        <div class="col-lg-4">
                             <input id="maintenancecenterid" disabled type="text" name="maintenancecenters"  class="getselectjoin maintenancecenterid"  data-placeholder=" المراكز    "   data-table="maintenancecenters" 
                              data-tableid="id"  data-join=""   data-filter="" data-parent="" data-itr=""  
                              data-search="centername"/>
                             <input  type="hidden" name="maintenancecenterid" class="selectedit" data-tableidname="maintenancecenterid" data-itr="" data-join="" data-table="maintenancecenters" data-tableid="id" data-search="centername" value="" />
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label">تاريخ البوليصة   ارسال</label>
                        <div class="col-lg-4">
                             <input  readonly   type="text" name="policydate" 
                            class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  placeholder="تاريخ البوليصة  "  data-table="" data-filter="" data-tableid="" data-parentid="" data-parentcol="" value="" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">رقم البوليصة   ارسال</label>
                        <div class="col-lg-4">
                            <input    readonly   type="text" name="policynumber" 
                            class="form-control checkcolumn"  placeholder="رقم البوليصة   "  
                            data-table="maintenancepolicys" data-filter="policynumber = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label">شركات الشحن   ارسال</label>
                        <div class="col-lg-4">
                             <input id="maintenancecompanieid" disabled type="text" name="maintenancecompanies"  class="getselectjoin maintenancecompanieid"  data-placeholder=" شركات الشحن "   data-table="maintenancecompanies" 
                              data-tableid="id"  data-join=""   data-filter=" and maintenancecompanies.conditions = 0 "  data-parent="" data-itr=""  
                              data-search="companyname,'/',companyphone"/>
                             <input  type="hidden" name="maintenancecompanieid" class="selectedit" data-tableidname="maintenancecompanieid"  data-itr="" 
                             data-join="" data-table="maintenancecompanies" data-tableid="id" data-search="companyname,'/',companyphone" value="" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">بيان البوليصة   ارسال</label>
                        <div class="col-lg-4">
                            <input    readonly    type="text" name="policystatement" 
                            class="form-control "  placeholder="بيان البوليصة    "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                    </div>
                   

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">تاريخ البوليصة   استلام</label>
                        <div class="col-lg-4">
                             <input    readonly   type="text" name="bpolicydate" 
                            class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  placeholder="تاريخ البوليصة  "  data-table="" data-filter="" data-tableid="" data-parentid="" data-parentcol="" value="" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">رقم البوليصة  استلام </label>
                        <div class="col-lg-4">
                            <input    readonly   type="text" name="bpolicynumber" 
                            class="form-control checkcolumn"  placeholder="رقم البوليصة   "  
                            data-table="maintenancepolicys" data-filter="policynumber = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">شركات الشحن   استلام</label>
                        <div class="col-lg-4">
                             <input id="bmaintenancecompanieid" disabled type="text" name="maintenancecompanies"  class="getselectjoin maintenancecompanieid"  data-placeholder=" شركات الشحن "   data-table="maintenancecompanies" 
                              data-tableid="id"  data-join=""   data-filter=" and maintenancecompanies.conditions = 0 "  data-parent="" data-itr=""  
                              data-search="companyname,'/',companyphone"/>
                             <input  type="hidden" name="bmaintenancecompanieid" class="selectedit" data-tableidname="bmaintenancecompanieid"  data-itr="" 
                             data-join="" data-table="maintenancecompanies" data-tableid="id" data-search="companyname,'/',companyphone" value="" />
                        </div>                  
                        <label for="txtName" class="col-lg-2 control-label">بيان البوليصة   استلام</label>
                        <div class="col-lg-4">
                            <input    readonly   type="text" name="bpolicystatement" 
                            class="form-control "  placeholder="بيان البوليصة    "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" value="" />
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label"> السداد</label>
                        <div class="col-lg-4">
                           <input    required="required"    type="text" name="repayment" 
                             class="form-control" placeholder="  السداد  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                        </div>
                        <label for="txtName" class="col-lg-2 control-label"> رقم الحافطة </label>
                        <div class="col-lg-4">
                           <input    required="required"    type="text" name="clipnumber" 
                             class="form-control" placeholder="  رقم الحافطة    "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>      
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label"> تاريخ التسليم </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="deliverydate" 
                             class="form-control awdatepicker" placeholder=" تاريخ التسليم :  "
                             data-table="" data-tablecol="" data-tableid="" data-date-format="yyyy-mm-dd" 
                            data-parentid="" data-parentcol="" value="{$date}" />   
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">تكلفة الشحن   الارسال      </label>
                        <div class="col-lg-4">
                           <input    required="required"  id="shipcharge"  type="text" name="shipcharge" 
                            class="form-control totals" placeholder=" تكلفة الشحن  الارسال    "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label">تكلفة الشحن  استلام    </label>
                        <div class="col-lg-4">
                            <input    required="required"  id="bshipcharge"  type="text" name="bshipcharge" 
                            class="form-control totals" placeholder=" تكلفة الشحن  استلام  "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">تكلفة صيانة </label>
                        <div class="col-lg-4">
                           <input    required="required"  id="maintenancecost"  type="text" name="maintenancecost" 
                            class="form-control totals" placeholder=" تتكلفة صيانة "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />   
                            
                        </div>
                    </div>
                    <div class="form-group">    
                        <label for="txtName" class="col-lg-2 control-label">اجمالى التكلفة </label>
                        <div class="col-lg-4">
                            <input    required="required"  id="totalcost"  type="text" name="totalcost" 
                            class="form-control totals" placeholder="اجمالى التكلفة"  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                        </div>
                         <label for="txtName" class="col-lg-2 control-label">المدفوع مقدم </label>
                        <div class="col-lg-4">
                            <input    id="prepaid" readonly  type="text" name="prepaid" 
                             class="form-control" placeholder=" المدفوع مقدم  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""/>    
                            
                        </div>
                        
                    </div>
                    <div class="form-group">  
                        <label for="txtName" class="col-lg-2 control-label">المطلوب من العميل   </label>
                        <div class="col-lg-4">
                            <input    readonly  id="requiredcustomer"  type="text" name="requiredcustomer" 
                            class="form-control totals" placeholder="المطلوب من العميل "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                            
                        </div>  
                        <label for="txtName" class="col-lg-2 control-label">المدفوع لاحقا   </label>
                        <div class="col-lg-4">
                            <input  required="required"   id="paidlater"  type="text" name="paidlater" 
                            class="form-control totals" placeholder="المدفوع لاحقا   "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                            
                        </div>
                    </div>
                    <div class="form-group">  
                        <label for="txtName" class="col-lg-2 control-label">اجمالى الدفع </label>
                        <div class="col-lg-4">
                            <input    readonly  id="paidall"  type="text" name="paidall" 
                            class="form-control totals" placeholder="اجمالى الدفع  "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                            
                        </div>  
                        <label for="txtName" class="col-lg-2 control-label">المتبقى   </label>
                        <div class="col-lg-4">
                            <input  readonly   id="residual"  type="text" name="residual" 
                            class="form-control" placeholder="المتبقى "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" />  
                            
                        </div>
                    </div>
                    
                    <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="saveformajax">حفظ الامر</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function () {
        residual();
     });
</script>

