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

}
h4{
    text-align: center;
    color: #0a0944;
    font-weight: 900;
    font-size: 18px;

}
.hrs {
    height: 3px;
        background-color: red;
        border: none;
        margin: 10px 200px;
}

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

        <ol class="breadcrumb">
            <li><a href="#">نظام  الصيانه</a></li>
            <li><a href="maintenances.php?do=show">عرض استلام الضمانات </a></li>
             {if $del == 0}
            <li class="active">تعديل  </li> 
            {else}
            <li class="active">تفاصيل  </li> 
            {/if}
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading">
            {if $del == 0}
            <h3 class="panel-title">تعديل  </h3>
            {else}
            <h3 class="panel-title">تفاصيل  </h3> 
            {/if}
            </div>
            <div class="panel-body">

 {literal}
                <form class="form-horizontal"  action="maintenances.php"  id="saveformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata" data-direction="maintenances.php?do=show">
                    {/literal}

                     <div class="form-group">
                        <h4> ايصال  الضمان   </h4>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">  اسم المستلم </label>
                        <div class="col-lg-4">
                            <input    type="text" class="form-control"   disabled  value="{$maintenancedata->employeename}" />
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">رقم الايصال  </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="receiptnumber" 
                            class="form-control checkcolumn"  placeholder="رقم الايصال "  
                            data-table="maintenances" data-filter=" receiptnumber = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol=""  value="{$maintenancedata->receiptnumber}"/>
                            
                        </div>
                   
                      
                    </div>

                    <div class="form-group">
                          <label for="txtName" class="col-lg-2 control-label">     التاريخ والوقت    </label>
                        <div class="col-lg-2">
                            <input    required="required"    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="" value="{$get_date}" />
                            
                        </div>
                         <div class="col-lg-2">
                           <input type="time" step='3' name="dateatime2" class="form-control " min="00:00:00" value="{$get_time}" >
                        </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=""   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="{$maintenancedata->branchid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="branch" data-tableid="branchId" data-toggle="modal" data-target="#ModalbranchId" data-whatever="@branch" data-formt="formbranch" data-selectitr="">اضافة   فرع</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#ModalbranchId" data-table="branch" data-name="branchId" data-tableid="branchId" data-join="" data-formt="formbranch" data-selectitr="">تعديل   فرع</button>
                    </div>
                    <hr class="hrs">

                    <div class="form-group">
                        <h4> بيانات العميل   </h4>
                    </div>




                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">العملاء  </label>
                        <div class="col-lg-8">
                             <input id="clientid" type="text" 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="{$maintenancedata->clientid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="client" data-tableid="clientid" data-toggle="modal" data-target="#Modalclientid" data-whatever="@client" data-formt="formclient" data-selectitr="">اضافة   عميل</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#Modalclientid" data-table="client" data-name="clientid" data-tableid="clientid" data-join="" data-formt="formclient" data-selectitr="">تعديل   عميل</button>
                    </div>
                      <hr class="hrs">

                    <div class="form-group">
                        <h4> بيانات  المنتجات   </h4>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">المنتجات   </label>
                        <div class="col-lg-8">
                             <input id="productId" type="text" name="product"  class="getselectmultiple productId"  data-placeholder=" المنتجات    "   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="{$maintenancedata->productid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="product" data-tableid="productId" data-toggle="modal" data-target="#ModalproductId" data-whatever="@product" data-formt="formproduct" data-selectitr="">اضافة   منتج</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#ModalproductId" data-table="product" data-name="productId" data-tableid="productId" data-join="" data-formt="formproduct" data-selectitr="">تعديل   منتج</button>
                    </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" class="form-control"  value="{$maintenancedata->quantity}" placeholder="الكمية" />
                            <div class="clearfix"></div>
                        </div>
                   
                        <label for="txtName" class="col-lg-2 control-label"> العيب </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="defect" 
                            class="form-control checkcolumn"  placeholder=" العيب    "  
                            data-table="supplier" data-filter=" defect = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol=""  value="{$maintenancedata->defect}"/>
                            
                        </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="accessories" 
                             class="form-control checkcolumn " placeholder=" الملحقات  " 
                             data-table="supplier" data-filter=" accessories = ? and conditions = 0 "  data-tableid=""
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->accessories}"/>    
                        </div>
                    
                        <label for="txtName" class="col-lg-2 control-label">ملاحظات </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="notes" 
                             class="form-control" placeholder=" ملاحظات  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->notes}"/>    
                            
                        </div>
                    </div>
                     <hr class="hrs">
                    <div class="form-group">
                        <h4> بيانات المدفوع   </h4>
                    </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="estimatedcost" 
                             class="form-control" placeholder=" تكلفة تقديرية  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->estimatedcost}"/>    
                            
                        </div>
                   
                        <label for="txtName" class="col-lg-2 control-label">المدفوع مقدم </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="prepaid" 
                             class="form-control" placeholder=" المدفوع مقدم  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->prepaid}"/>    
                            
                        </div>
                    </div>
                    <hr class="hrs">
                    <div class="form-group">
                        <h4> حالة القطعة : ضمان/صيانة  </h4>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">صيانه او ضمان  </label>
                        <div class="col-lg-4">
                             <div class="radio-inline">
                                <label> <input value="2" class="maintorguar"  name="maintorguar"   type="radio" {if $maintenancedata->maintorguar eq 2} checked="checked" {/if}/>
                                    ضمان   </label>
                            </div>
                            <div class="radio-inline">
                                <label><input value="1"  class="maintorguar" name="maintorguar"  type="radio"  {if $maintenancedata->maintorguar eq 1} checked="checked" {/if} />صيانه   </label>
                            </div>
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">الحالات  </label>
                        <div class="col-lg-2">
                             <input id="maintenancecaseid" type="text" name="maintenancecases"  class="getselectjoin maintenancecaseid"  data-placeholder=" الحالات    "   data-table="maintenancecases" 
                              data-tableid="id"  data-join=""   data-filter="" data-parent="" data-itr=""  
                              data-search="casename"/>
                             <input  type="hidden" name="maintenancecaseid" class="selectedit" data-tableidname="maintenancecaseid" data-itr="" data-join="" data-table="maintenancecases" data-tableid="id" data-search="casename" value="{$maintenancedata->maintenancecaseid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="maintenancecases" data-tableid="maintenancecaseid" data-toggle="modal" data-target="#Modalmaintenancecaseid" data-whatever="@maintenancecases" data-formt="formmaintenancecases" data-selectitr="">اضافة   حاله</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#Modalmaintenancecaseid" data-table="maintenancecases" data-name="maintenancecaseid" data-tableid="id" data-join="" data-formt="formmaintenancecases" data-selectitr="">تعديل   حاله</button>
                    </div>
                      <div class="form-group" id="hidecenter" {if $maintenancedata->maintorguar eq 2} style="display: none;" {/if}>
                        <label for="txtName" class="col-lg-2 control-label">المراكز  </label>
                        <div class="col-lg-4">
                             <input id="maintenancecenterid" required 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="{$maintenancedata->maintenancecenterid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="maintenancecenters" data-tableid="maintenancecenterid" data-toggle="modal" data-target="#Modalmaintenancecenterid" data-whatever="@maintenancecenters" data-formt="formmaintenancecenters" data-selectitr="">اضافة   مركز</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#Modalmaintenancecenterid" data-table="maintenancecenters" data-name="maintenancecenterid" data-tableid="id" data-join="" data-formt="formmaintenancecenters" data-selectitr="">تعديل   مركز</button>
                    </div>

                     <hr class="hrs">
                    <div class="form-group">
                        <h4> بيانات المورد </h4>
                    </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="datepurchase" 
                             class="form-control awdatepicker" placeholder=" تاريخ الشراء   "
                             data-table="" data-tablecol="" data-tableid="" data-date-format="yyyy-mm-dd" 
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->datepurchase}"/>    
                            
                        </div>
                        <label for="txtName" class="col-lg-2 control-label">الموردين  </label>
                        <div class="col-lg-2">
                             <input id="supplierid" type="text" name="supplier"  class="getselectjoin supplierid"  data-placeholder=" الموردين    "   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="{$maintenancedata->supplierid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="supplier" data-tableid="supplierid" data-toggle="modal" data-target="#Modalsupplierid" data-whatever="@supplier" data-formt="formsupplier" data-selectitr="">اضافة   مورد</button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#Modalsupplierid" data-table="supplier" data-name="supplierid" data-tableid="supplierid" data-join="" data-formt="formsupplier" data-selectitr="">تعديل   مورد</button>
                    </div>

                     <hr class="hrs">
                    <div class="form-group">
                         <h4> بيانات الفاتورة </h4>
                    </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="invoicenumber" 
                             class="form-control" placeholder=" رقم الفاتورة  "
                             data-table="" data-tablecol="" data-tableid=""
                            data-parentid="" data-parentcol=""  value="{$maintenancedata->invoicenumber}"/>    
                            
                        </div>
                   
                        <label for="txtName" class="col-lg-2 control-label">تاريخ الفاتورة </label>
                        <div class="col-lg-4">
                            <input    required="required"    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="" value="{$maintenancedata->invoicedate}" />    
                            
                        </div>
                    </div>

                  
                   <hr class="hrs">
                    <div class="form-group">
                         <h4> التعليقات </h4>
                    </div>
                   

                     <div class="row">
                        <div class="col-md-12">
                            <div>
                                <button type="button" class="btn green-meadow btn-sm pull-right add_append" data-controll="maintenances" data-appendname="appentcomment">+تعليق</i></button>
                                <input type="hidden" id="itr_appentcomment" name="commentitr" value="{$maintenancecomments|@count}" />
                            </div>
                            <div class="clearfix"></div>                            
                            <ul class="list-group" id="container_appentcomment">
                                {assign var=itr value=1}
                                {foreach $maintenancecomments as $comment}
                                <input type="hidden" name="maintenancecommentid_{$itr}" value="{$comment->id}" />
                                <li class="list-group"  style="list-style-type: none;">
                                    <div class="col-lg-6">
                                    <input   type="text" name="comments_{$itr}"  class="form-control" value="{$comment->comments}" placeholder="التعليق" />
                                    </div>
                                    <div class="col-lg-2">
                                    <input   type="text"  class="form-control" value="{$comment->maintenancecommentdate}" placeholder="" />
                                    </div>
                                    <div class="col-lg-2">
                                    <input   type="text"   class="form-control" value="{$comment->employeename}" placeholder="التعليق" />
                                    </div>
                                    <div class="col-lg-1">
                                        <a href="javascript:;" data-tableid="id" data-id="{$comment->id}" data-table="maintenancecomments" class="btn btn-xs  removeteble">x
                                        </a>
                                    </div>
                                </li>
                                {capture assign=itr}{$itr+1}{/capture}
                                {/foreach}
                            </ul>
                        </div>
                    </div>

                     
                    <input    type="hidden" type="text" name="maintenanceid" value="{$maintenancedata->id}"/>
                    
                    {if $del == 0}
                    <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>
                    {/if}
                </form>
            </div>
        </div>




    </div>
</div>








<div class="modal fade" id="ModalbranchId" tabindex="-1" role="dialog" aria-labelledby="ModalbranchIdLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalbranchIdLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenances.php"  id="formbranch" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savebranch"  data-direction="">
         <div class="form-group">
            <label for="recipient-name" class="col-form-label"> اسم الفرع  </label>
            <input    required="required"    type="text" name="branchName" 
            class="form-control checkcolumn"  placeholder=" اسم الفرع "  
            data-table="branch" data-filter=" branchName = ? " 
            data-tableid="" data-parentid="" data-parentcol="" />
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label"> رقم الفرع  </label>
            <input    required="required"    type="text" name="branchNo" 
            class="form-control"  placeholder=" رقم الفرع  "  
            data-table="branch" data-filter=" branchNo = ? " 
            data-tableid="" data-parentid="" data-parentcol="" />
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">  رقم الهاتف    </label>
            <input   type="text" name="phone" class="form-control" 
             placeholder="  رقم الهاتف   "  data-table="branch" 
             data-filter=" phone = ? " data-tableid="" data-parentid="" 
             data-parentcol="" />
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">   رقم المويايل  </label>
            <input   type="text" name="mobile" class="form-control" 
             placeholder="  رقم المويايل   "  data-table="branch" 
             data-filter=" mobile = ? " data-tableid="" data-parentid="" 
             data-parentcol="" />
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">   عنوان الفرع   </label>
            <input   type="text" name="branchAddress" class="form-control" 
             placeholder=" عنوان الفرع   "  data-table="branch" 
             data-filter=" branchAddress = ? " data-tableid="" data-parentid="" 
             data-parentcol="" />
          </div>
          
          <input id="popbranch" type="hidden" name="branchId" value=""  />
          <input id="itrbranch" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formbranch"> حفظ</button>
      </div>
    </div>
  </div>
</div>



<div class="modal fade" id="Modalsupplierid" tabindex="-1" role="dialog" aria-labelledby="ModalsupplieridLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalsupplieridLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenancesuppliers.php"  id="formsupplier" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savedata"  data-direction="">
           <div class="form-group">
            <label for="recipient-name" class="col-form-label">كود المورد </label>
            <input type="text" name="suppliercode" class="form-control" value=""/>
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">   اسم    المورد   </label>
            <input   required="required"    type="text" name="suppliername" 
                class="form-control checkcolumn"  placeholder="اسم   المورد  "  
                data-table="supplier" data-filter=" suppliername = ? and conditions = 0 " 
                data-tableid="" data-parentid="" data-parentcol="" />
          </div>
         <div class="form-group">
            <label for="recipient-name" class="col-form-label">المحمول</label>
                <input    required="required"    type="text" name="supplierphone" 
                 class="form-control checkcolumn nummbers" placeholder=" المحمول   "  
                 data-table="supplier" data-filter=" supplierphone = ? and conditions = 0 "  data-tableid=""
                data-parentid="" data-parentcol=""/>                
        </div>
        <div class="form-group">
            <label for="recipient-name" class="col-form-label">الارضى</label>
                <input    required="required"    type="text" name="suppliermobile" 
                 class="form-control checkcolumn nummbers" placeholder=" الارضى " 
                 data-table="supplier" data-filter=" suppliermobile = ? and conditions = 0 "  data-tableid=""
                data-parentid="" data-parentcol=""/>    
        </div>
        <div class="form-group">
            <label for="recipient-name" class="col-form-label">عنوان   المورد    </label>
                <input    required="required"    type="text" name="supplieraddress" 
                 class="form-control" placeholder=" عنوان  المورد    "
                 data-table="" data-tablecol="" data-tableid=""
                data-parentid="" data-parentcol=""/>    
                
        </div>
        
         
        <div class="form-group">
            <label for="recipient-name" class="col-form-label">المدينة</label>
             <input id="goverareaid" type="text" name="goverarea"  class="getselectjoin goverareaid"  data-placeholder=" المحافظه    /  المدينة    "   data-table="goverarea" 
              data-tableid="clientareaid" 
              data-join=" LEFT JOIN government on government.governmetid = goverarea.governmentid
              LEFT JOIN clientarea on clientarea.id = goverarea.clientareaid "   data-filter="" 
              data-parent="" data-itr=""  
              data-search="governmentname,'/',name"/>
             <input  type="hidden" name="goverareaid" class="selectedit" data-tableidname="goverareaid"  data-itr="" 
             data-join=" LEFT JOIN government on government.governmetid = goverarea.governmentid
              LEFT JOIN clientarea on clientarea.id = goverarea.clientareaid "
             data-table="goverarea" data-tableid="goverareaid"
              data-search="governmentname,'/',name" value="" />
        </div>
        <div class="form-group">
             <label for="recipient-name" class="col-form-label">اسم المستفيد فى الشيك</label>
            <input type="text" name="namepayeecheck" class="form-control" value=""/>
                <div class="clearfix"></div>
        </div>
        <div class="form-group">
             <label for="recipient-name" class="col-form-label">مسئول الضمانات</label>
                <input type="text" name="warrantyOfficer" class="form-control" value=""/>
                <div class="clearfix"></div>
        </div>
        <div class="form-group">
             <label for="recipient-name" class="col-form-label">موبايل الضمانات</label>
                <input type="text" name="warrantymobile" class="form-control" value=""/>
                <div class="clearfix"></div>
        </div>
        <div class="form-group">
             <label for="recipient-name" class="col-form-label">اسم البائع</label>
                <input type="text" name="sellername" class="form-control" value=""/>
                <div class="clearfix"></div>
        </div>
        <div class="form-group">
            <label for="recipient-name" class="col-form-label">موبايل البائع</label>
                <input type="text" name="sellermobile" class="form-control" value=""/>
                <div class="clearfix"></div>
        </div>
          
          <input id="popsupplier" type="hidden" name="supplierid" value=""  />
          <input id="itrsupplier" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formsupplier"> حفظ</button>
      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="Modalclientid" tabindex="-1" role="dialog" aria-labelledby="ModalclientidLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalclientidLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenanceclients.php"  id="formclient" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savedata"  data-direction="">
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">  اسم  العميل   </label>
                    <input    required="required"    type="text" name="clientname" 
                    class="form-control checkcolumn"  placeholder="اسم  العميل  "  
                    data-table="client" data-filter=" clientname = ? and conditions = 0 " 
                    data-tableid="" data-parentid="" data-parentcol="" />
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">المحمول</label>
                    <input    required="required"    type="text" name="clientphone" 
                     class="form-control checkcolumn nummbers" placeholder=" المحمول   "  
                     data-table="client" data-filter=" clientphone = ? and conditions = 0 "  data-tableid=""
                    data-parentid="" data-parentcol=""/>
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">الارضى</label>
                    <input    required="required"    type="text" name="clientmobile" 
                     class="form-control checkcolumn nummbers" placeholder=" الارضى " 
                     data-table="client" data-filter=" clientmobile = ? and conditions = 0 "  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">عنوان العميل    </label>
                    <input    required="required"    type="text" name="clientaddress" 
                     class="form-control" placeholder=" عنوان العميل    "
                     data-table="" data-tablecol="" data-tableid=""
                    data-parentid="" data-parentcol=""/>  
            </div>
       
          
          <input id="popclient" type="hidden" name="clientid" value=""  />
          <input id="itrclient" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formclient"> حفظ</button>
      </div>
    </div>
  </div>
</div>



<div class="modal fade" id="ModalproductId" tabindex="-1" role="dialog" aria-labelledby="ModalproductIdLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalproductIdLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenanceproducts.php"  id="formproduct" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savedata"  data-direction="">
       
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">التصنيفات</label>
                    <input  type="text" name="productcat" id="productCatId"  class="getselectjoin gettabledata"  data-placeholder=" البحث عن   منتج   "   data-table="productcat" 
                      data-tableid="productCatId" 
                      data-join=""   data-filter="" 
                      data-parent="" data-itr=""  
                      data-search="productCatName"/> 
            </div>

             <div class="form-group"  >
                <label  for="recipient-name" class="col-form-label"> المنتجات  </label>
                      <input  type="text" name="productId"  class="getselectjoin gettabledata"  data-placeholder=" البحث عن   منتج   "   data-table="product" 
                      data-tableid="productId" 
                      data-join=""   data-filter=" and product.conditions = 0 " 
                      data-parent="productCatId" data-itr=""  
                      data-search="productName"/>               
            </div>
            
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">  اسم    المنتج   </label>
                   <input    required="required"    type="text" name="productName" 
                    class="form-control checkcolumn"  placeholder="اسم  المنتج  "  
                    data-table="product" data-filter=" productName = ? and conditions = 0 " 
                    data-tableid="" data-parentid="" data-parentcol="" />                    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">وصف المنتج</label>
                    <input       type="text" name="productDescription" 
                     class="form-control" placeholder=" وصف المنتج   "  
                     data-table="product" data-filter=""  
                     data-tableid="" data-parentid="" data-parentcol=""/>
                    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label"> Run Query</label>
                    <input     type="text" name="runquery" 
                     class="form-control" placeholder=" Run Query " 
                     data-table="product" data-filter=""  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
          <input id="popproduct" type="hidden" name="productId" value=""  />
          <input id="itrproduct" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formproduct"> حفظ</button>
      </div>
    </div>
  </div>
</div>



<div class="modal fade" id="Modalmaintenancecenterid" tabindex="-1" role="dialog" aria-labelledby="ModalmaintenancecenteridLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalmaintenancecenteridLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenances.php"  id="formmaintenancecenters" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savecenter"  data-direction="">

            <div class="form-group">
                <label for="recipient-name" class="col-form-label">  اسم المركز    </label>
                    <input    required="required"    type="text" name="centername" 
                    class="form-control checkcolumn"  placeholder="اسم المركز "  
                    data-table="maintenancecenters" data-filter=" centername = ? and conditions = 0 " 
                    data-tableid="" data-parentid="" data-parentcol="" />
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">المحمول</label>
                    <input    required="required"    type="text" name="centerphone" 
                     class="form-control checkcolumn nummbers" placeholder=" المحمول   "  
                     data-table="maintenancecenters" data-filter=" centerphone = ? and conditions = 0 "  data-tableid=""
                    data-parentid="" data-parentcol=""/>
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">الارضى</label>
                    <input    required="required"    type="text" name="centermobile" 
                     class="form-control checkcolumn nummbers" placeholder=" الارضى " 
                     data-table="maintenancecenters" data-filter=" centermobile = ? and conditions = 0 "  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">العنوان</label>
                    <input    required="required"    type="text" name="centeraddress" 
                     class="form-control" placeholder=" العنوان   "  
                     data-table="maintenancecenters" data-filter=""  data-tableid=""
                    data-parentid="" data-parentcol=""/>
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">اسم المسئول </label>
                    <input    required="required"    type="text" name="administrator" 
                     class="form-control" placeholder=" اسم المسئول  " 
                     data-table="maintenancecenters" data-filter=""  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">تليفونه </label>
                    <input    required="required"    type="text" name="administratorphone" 
                     class="form-control" placeholder=" تليفونه " 
                     data-table="maintenancecenters" data-filter=""  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">الدين الحالى</label>
                    <input    required="required"    type="text" name="administratordebt" 
                     class="form-control  nummbers" placeholder=" الدين الحالى " 
                     data-table="maintenancecenters" data-filter=""  data-tableid=""
                    data-parentid="" data-parentcol=""/>    
            </div>
           
          <input id="popmaintenancecenters" type="hidden" name="maintenancecenterid" value=""  />
          <input id="itrmaintenancecenters" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formmaintenancecenters"> حفظ</button>
      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="Modalmaintenancecaseid" tabindex="-1" role="dialog" aria-labelledby="ModalmaintenancecaseidLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalmaintenancecaseidLabel"> اضافة </h3>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form class="form-horizontal"  action="maintenances.php"  id="formmaintenancecases" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savecase"  data-direction="">
            <div class="form-group">
                <label for="recipient-name" class="col-form-label">  الحاله     </label>
                    <input    required="required"    type="text" name="casename" 
                    class="form-control checkcolumn"  placeholder="الحاله  "  
                    data-table="maintenancecases" data-filter=" casename = ? and conditions = 0 " 
                    data-tableid="" data-parentid="" data-parentcol="" />
            </div>
       
           
          <input id="popmaintenancecases" type="hidden" name="maintenancecaseid" value=""  />
          <input id="itrmaintenancecases" type="hidden" name="selectitr" value=""  />

        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
        <button type="button" class="btn btn-primary saveformajax" data-form="formmaintenancecases"> حفظ</button>
      </div>
    </div>
  </div>
</div>


