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

table, th, td {
  border: 1px solid black;
  text-align: center;
}
</style>
<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">نظام  الصيانه</a></li>
            <li><a href="maintenancesends.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="maintenancesends.php"  id="saveformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata" data-direction="maintenancesends.php?do=show">
                    {/literal}
                     
                    <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="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="{$maintenancepolicydata->policydate}" />
                        </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="policynumber" 
                            class="form-control checkcolumn"  placeholder="رقم البوليصة   "  
                            data-table="maintenancepolicys" data-filter="policynumber = ? and conditions = 0 " 
                            data-tableid="" data-parentid="" data-parentcol="" value="{$maintenancepolicydata->policynumber}" />
                        </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=" الموردين    "   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="{$maintenancepolicydata->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>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">شركات الشحن  </label>
                        <div class="col-lg-4">
                             <input id="maintenancecompanieid" 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="{$maintenancepolicydata->maintenancecompanieid}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="maintenancecompanies" data-tableid="maintenancecompanieid" data-toggle="modal" data-target="#Modalmaintenancecompanieid" data-whatever="@maintenancecompanies" data-formt="formmaintenancecompanies" data-selectitr="">اضافة  شركه </button>
                        <button type="button" class="btn btn-primary editdatamodal"  data-model="#Modalmaintenancecompanieid" data-table="maintenancecompanies" data-name="maintenancecompanieid" data-tableid="id" data-join="" data-formt="formmaintenancecompanies" data-selectitr="">تعديل   شركه</button>
                    </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="policystatement" 
                            class="form-control "  placeholder="بيان البوليصة    "  
                            data-table="" data-filter="" 
                            data-tableid="" data-parentid="" data-parentcol="" value="{$maintenancepolicydata->policystatement}"/>
                        </div>
                    </div>
                     <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">قيمة الشحن   </label>
                        <div class="col-lg-4">
                            <input id="shippingvalue"   required="required"    type="text" name="shippingvalue" 
                            class="form-control "  placeholder="قيمة الشحن    "  
                            data-table="" data-filter=""  data-forms="saveformajax"
                            data-tableid="" data-parentid="" data-parentcol="" value="{$maintenancepolicydata->shippingvalue}"/>
                        </div>
                    </div>
                     <table class="table table-black">
                        <thead>
                            <tr>
                                <th style="width:50px;">م</th>
                                <th>سعر الشحنه</th>
                                <th>تكلفة الشحن</th>
                                <th>رقم الشحنه</th>
                                <th>SN</th>
                                <th> المنتج</th>
                                <th>المورد</th>
                                <th>SD</th>
                            </tr>
                        </thead>
                        <tbody>
                            <input type="hidden" name="maintenanceitr" value="{$maintenances|@count}" />
                            
                            {assign var=itr value=1}
                            {foreach $maintenances as $maintenance}
                            <tr>
                                <td><label class="mt-checkbox mt-checkbox-single mt-checkbox-outline">
                                    <input type="checkbox" class="policycheck " data-id="{$maintenance->id}" data-update="1" name="maintenanceid_{$itr}" value="{$maintenance->id}" {if $maintenance->maintenancecaseid gt 1} checked {/if}/>
                                    <span></span>
                                </label>
                                </td>
                                <td><input type="text" name="shipprice_{$itr}" id="shipprice_{$maintenance->id}" class="form-control" value="{$maintenance->shipprice}"></td>
                                <td><input type="text" name="shipcharge_{$itr}" id="shipcharge_{$maintenance->id}" class="form-control" value="{$maintenance->shipcharge}"></td>
                                <td><input type="text" name="shipnumber_{$itr}" id="shipnumber_{$maintenance->id}" class="form-control" value="{$maintenance->shipnumber}"></td>
                                <td>{$maintenance->id}</td>
                                <td>{$maintenance->productName}</td>
                                <td>{$maintenance->suppliername}</td>
                                <td>{$maintenance->id}</td>
                            </tr>
                            {capture assign=itr}{$itr+1}{/capture}
                            {/foreach}


                        </tbody>
                    </table>

                    <div class="clearfix"></div>
                    <input    type="hidden" type="text" id="maintenancepolicyid" name="maintenancepolicyid" value="{$maintenancepolicydata->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="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="Modalmaintenancecompanieid" tabindex="-1" role="dialog" aria-labelledby="ModalmaintenancecompanieidLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h3 class="modal-title" id="ModalmaintenancecompanieidLabel"> اضافة </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="maintenancesends.php"  id="formmaintenancecompanies" 
        method="post"  enctype="multipart/form-data" data-dosave="?do=savecompany"  data-direction="">
          

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">   الشركه       </label>
            <input   required="required"    type="text" name="companyname" 
                class="form-control checkcolumn"  placeholder="الشركه     "  
                data-table="maintenancecompanies" data-filter=" companyname = ? 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="companyphone" 
                 class="form-control checkcolumn nummbers" placeholder=" التليفون   "  
                 data-table="maintenancecompanies" data-filter=" companyphone = ? 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="companyaddress" 
                 class="form-control" placeholder=" العنوان       "
                 data-table="" data-tablecol="" data-tableid=""
                data-parentid="" data-parentcol=""/>    
                
        </div>
        
   
          <input id="popmaintenancecompanies" type="hidden" name="maintenancecompanieid" value=""  />
          <input id="itrmaintenancecompanies" 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="formmaintenancecompanies"> حفظ</button>
      </div>
    </div>
  </div>
</div>