<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المتجر اونلاين</a></li>
            <li><a href="onlinestoremainsetting.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="nameToBeChecked form-horizontal" role="form" 
                      action="onlinestoremainsetting.php?do=update"
                      method="post" enctype="multipart/form-data" id="jValidate">
                    {/literal}
                    <!-- =================================================   -->
                    
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#info" data-toggle="tab">الاعدادات العامة    </a></li>
                        <li><a href="#Shippingcost" data-toggle="tab"> الشحن   </a></li>
                        <li><a href="#Socialmedialinks" data-toggle="tab"> روابط التواصل الاجتماعي </a></li>
                        <li ><a href="#Mobilesendingsettings" data-toggle="tab">اعدادات الارسال على الموبايل </a></li>
                        <li ><a href="#Emailsendingsettings" data-toggle="tab">اعدادات الارسال على الايميل </a></li>
                    </ul>

                    <div class="tab-content">
                        
                        <div class="tab-pane active" id="info">
                            
                            <div class="form-group">
                                <label for="email" class="col-lg-1 control-label">logo</label>
                                <div class="col-lg-3"><img
                                        src="../upload/onlinestoremainsetting/{$showData->logo}" alt=""
                                        width="122" height="75" />
                                    <input type="file" name="logo" id="logo" class="form-control"
                                           placeholder="logo" />
                                    <input type="hidden" name="logourl" id="logourl"
                                           value="{$showData->logo}" />
                                </div>
                                
                                <label for="email" class="col-lg-1 control-label">logo dark</label>
                                <div class="col-lg-3"><img
                                        src="../upload/onlinestoremainsetting/{$showData->logo_dark}" alt=""
                                        width="122" height="75" />
                                    <input type="file" name="logodark" id="logodark" class="form-control"
                                           placeholder="logo dark" />
                                    <input type="hidden" name="logodarkurl" id="logodarkurl"
                                           value="{$showData->logo_dark}" />
                                </div>
                           
                                <label for="send_type" class="col-lg-1 control-label">نوع الارسال </label>
                                <div class="col-lg-3">
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="send_type" value="1" {if
                                                   {$showData->send_type} eq 1} checked {/if}>
                                            mobile </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="send_type" value="0" {if
                                                   {$showData->send_type} eq 0} checked {/if}>
                                            email  </label>
                                    </div>
                                </div>
                            </div>
                            
                            
                            
                            <div class="form-group">
                                <label for="address_ar" class="col-lg-2 control-label">site name ar </label>
                                <div class="col-lg-4">
                                    <input type="text" name="site_name_ar" id="site_name_ar" required
                                         class="form-control" value="{$showData->site_name_ar}"/>
                                </div>
        
                                <label for="address_en" class="col-lg-2 control-label">site name en </label>
                                <div class="col-lg-4">
                                    <input type="text" name="site_name_en" id="site_name_en" required
                                         class="form-control" value="{$showData->site_name_en}"/>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="address_ar" class="col-lg-2 control-label">address ar </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control" name="address_ar" rows="2"
                                              cols="50">{$showData->address_ar}</textarea>
                                </div>
        
                                <label for="address_en" class="col-lg-2 control-label">address en </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control" name="address_en" rows="2"
                                              cols="50">{$showData->address_en}</textarea>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="header_text_ar" class="col-lg-2 control-label"> النص فى اعلى  الموقع ar </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control " name="header_text_ar" rows="2"
                                              cols="50">{$showData->header_text_ar}</textarea>
                                </div>
        
                                <label for="header_text_en" class="col-lg-2 control-label"> النص فى اعلى  الموقع en </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control " name="header_text_en" rows="2"
                                              cols="50">{$showData->header_text_en}</textarea>
                                </div>
                            </div>
                            
                             <div class="form-group">
                                <label for="footer_text_ar" class="col-lg-2 control-label"> النص فى اسفل  الموقع ar </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control " name="footer_text_ar" rows="2"
                                              cols="50">{$showData->footer_text_ar}</textarea>
                                </div>
        
                                <label for="footer_text_en" class="col-lg-2 control-label"> النص فى اسفل  الموقع en </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control " name="footer_text_en" rows="2"
                                              cols="50">{$showData->footer_text_en}</textarea>
                                </div>
                            </div>
                            
                            
                             <div class="form-group">
                                <label for="working_hours_ar" class="col-lg-2 control-label">مواعيد العمل ar </label>
                                <div class="col-lg-4">
                                    <input type="text" name="working_hours_ar" id="working_hours_ar" required
                                         class="form-control" value="{$showData->working_hours_ar}"/>
                                </div>
        
                                <label for="working_hours_en" class="col-lg-2 control-label">مواعيد العمل en </label>
                                <div class="col-lg-4">
                                    <input type="text" name="working_hours_en" id="working_hours_en" required
                                         class="form-control" value="{$showData->working_hours_en}"/>
                                </div>
                            </div>
                            

                            
                            <div class="form-group">
                           
                                <label for="send_type" class="col-lg-2 control-label">ايقاف الموقع  </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="close_site_status" value="1" {if
                                                   {$showData->close_site_status} eq 1} checked {/if}>
                                            ايقاف </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="close_site_status" value="0" {if
                                                   {$showData->close_site_status} eq 0} checked {/if}>
                                            تشغيل  </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="close_site_ar" class="col-lg-2 control-label"> النص فى حالة ايقاف الموقع ar </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control ckeditor" name="close_site_ar" rows="2"
                                              cols="50">{$showData->close_site_ar}</textarea>
                                </div>
        
                                <label for="close_site_en" class="col-lg-2 control-label"> النص فى حالة ايقاف الموقع en </label>
                                <div class="col-lg-4">
                                    <textarea class="form-control ckeditor" name="close_site_en" rows="2"
                                              cols="50">{$showData->close_site_en}</textarea>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="mobile" class="col-lg-2 control-label">mobile</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mobile" id="mobile" required
                                         class="form-control" value="{$showData->mobile}"/>
                                </div>
        
                                <label for="another_mobile" class="col-lg-2 control-label">another mobile</label>
                                <div class="col-lg-4">
                                        <input type="text" name="another_mobile" id="another_mobile" required
                                         class="form-control" value="{$showData->another_mobile}"/>
                                </div>
                                
                            </div>
                             <div class="form-group">
                                <label for="hotline" class="col-lg-2 control-label">الخط الساخن</label>
                                <div class="col-lg-4">
                                        <input type="text" name="hotline" id="hotline" required
                                         class="form-control" value="{$showData->hotline}"/>
                                </div>
                            </div>
                            
                            
                         
                            
                            
                             <div class="form-group">
                                <label for="email" class="col-lg-2 control-label">email</label>
                                <div class="col-lg-4">
                                        <input type="text" name="email" id="email" required
                                         class="form-control" value="{$showData->email}"/>
                                </div>
        
                                <label for="another_email" class="col-lg-2 control-label">another email</label>
                                <div class="col-lg-4">
                                        <input type="text" name="another_email" id="another_email" required
                                         class="form-control" value="{$showData->another_email}"/>
                                </div>
                            </div>
                            
                              
                            <div class="form-group">
                                <label for="points" class="col-lg-2 control-label">كل جنيه فيه كام نقطة  </label>
                                <div class="col-lg-4">
                                        <input type="text" name="points" id="points" required
                                         class="form-control" value="{$showData->points}"/>
                                </div>
        
                                <label for="point_value" class="col-lg-2 control-label">قيمة النقطة بالجنيه</label>
                                <div class="col-lg-4">
                                        <input type="text" name="point_value" id="point_value" required
                                         class="form-control" value="{$showData->point_value}"/>
                                </div>
                            </div>
                            

                            <div class="form-group">
                                <label for="store_id" class="col-lg-2 control-label">المخزن</label>
                                <div class="col-lg-4">
                                    <select name="store_id" id="store_id" required class="select2">
                                        <option value=""></option>
                                        {foreach $stores as $store}
                                        <option value="{$store['storeId']}" {if {$showData->store} eq {$store['storeId']}} selected {/if}>{$store['storeName']}</option>
                                        {/foreach}
                                    </select>
                                </div>                               
                            </div>  

                            <div class="form-group">
                                <label for="iframe_map" class="col-lg-2 control-label"> الخريطه</label>
                                <div class="col-lg-10">
                                    <textarea class="form-control " name="iframe_map" rows="2"
                                              cols="50">{$showData->iframe_map}</textarea>
                                </div>
                            </div>
                            
                          
                            
                        </div>
                        
                        
                        
                        <div class="tab-pane" id="Shippingcost">
                            
                           
                            
                            
                            <div class="form-group">
                                <label for="shippingfree_numberitems" class="col-lg-2 control-label">الاعفاء من قيمة الشحن حسب عدد القطع </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="shippingfree_numberitems" value="1" {if
                                                   {$showData->shippingfree_numberitems} eq 1} checked {/if}>
                                            yes </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="shippingfree_numberitems" value="0" {if
                                                   {$showData->shippingfree_numberitems} eq 0} checked {/if}>
                                            no  </label>
                                    </div>
                                </div>
                                <label for="numberitems" class="col-lg-2 control-label">عدد القطع</label>
                                <div class="col-lg-4">
                                        <input type="text" name="numberitems" id="numberitems" required
                                         class="form-control" value="{$showData->numberitems}"/>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="shippingfree_totleitems" class="col-lg-2 control-label">الاعفاء من قيمة الشحن حسب اجمالى القطع </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="shippingfree_totleitems" value="1" {if
                                                   {$showData->shippingfree_totleitems} eq 1} checked {/if}>
                                            yes </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="shippingfree_totleitems" value="0" {if
                                                   {$showData->shippingfree_totleitems} eq 0} checked {/if}>
                                            no  </label>
                                    </div>
                                </div>
                                <label for="totleitems" class="col-lg-2 control-label">اجمالى القطع</label>
                                <div class="col-lg-4">
                                        <input type="text" name="totleitems" id="totleitems" required
                                         class="form-control" value="{$showData->totleitems}"/>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="fixedshipping_value" class="col-lg-2 control-label">قيمة شحن ثابته </label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="fixedshipping_value" value="1" {if
                                                   {$showData->fixedshipping_value} eq 1} checked {/if}>
                                            yes </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input type="radio" name="fixedshipping_value" value="0" {if
                                                   {$showData->fixedshipping_value} eq 0} checked {/if}>
                                            no  </label>
                                    </div>
                                </div>
                                <label for="shipping_value" class="col-lg-2 control-label"> قيمة شحن</label>
                                <div class="col-lg-4">
                                        <input type="text" name="shipping_value" id="shipping_value" required
                                         class="form-control" value="{$showData->shipping_value}"/>
                                </div>
                            </div>


                            
                            
                            
                          
                            
                        </div>
                        
                        
                         <div class="tab-pane" id="Socialmedialinks">
                             
                             <div class="form-group">
                                 <label for="facebook" class="col-lg-2 control-label">facebook</label>
                                <div class="col-lg-4">
                                        <input type="text" name="facebook" id="facebook" required
                                         class="form-control" value="{$showData->facebook}"/>
                                </div>
        
                                <label for="twitter" class="col-lg-2 control-label">twitter</label>
                                <div class="col-lg-4">
                                        <input type="text" name="twitter" id="twitter" required
                                         class="form-control" value="{$showData->twitter}"/>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="instagram" class="col-lg-2 control-label">instagram</label>
                                <div class="col-lg-4">
                                        <input type="text" name="instagram" id="instagram" required
                                         class="form-control" value="{$showData->instagram}"/>
                                </div>
        
                                <label for="telegram" class="col-lg-2 control-label">telegram</label>
                                <div class="col-lg-4">
                                        <input type="text" name="telegram" id="telegram" required
                                         class="form-control" value="{$showData->telegram}"/>
                                </div>
                            </div>
                            
                            
                            <div class="form-group">
                                <label for="app_android" class="col-lg-2 control-label">app android</label>
                                <div class="col-lg-4">
                                        <input type="text" name="app_android" id="app_android" required
                                         class="form-control" value="{$showData->app_android}"/>
                                </div>
        
                                <label for="app_ios" class="col-lg-2 control-label">app ios</label>
                                <div class="col-lg-4">
                                        <input type="text" name="app_ios" id="app_ios" required
                                         class="form-control" value="{$showData->app_ios}"/>
                                </div>
                            </div>
                            
                            
                            
                        </div>
                        
                        
                        <div class="tab-pane" id="Mobilesendingsettings">


                            <div class="form-group">
                                <label for="account_sid" class="col-lg-2 control-label">account sid</label>
                                <div class="col-lg-4">
                                        <input type="text" name="account_sid" id="account_sid" required
                                         class="form-control" value="{$showData->account_sid}"/>
                                </div>
                                <label for="auth_token" class="col-lg-2 control-label">auth token</label>
                                <div class="col-lg-4">
                                        <input type="text" name="auth_token" id="auth_token" required
                                         class="form-control" value="{$showData->auth_token}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="twilio_number" class="col-lg-2 control-label">twilio number</label>
                                <div class="col-lg-4">
                                        <input type="text" name="twilio_number" id="twilio_number" required
                                         class="form-control" value="{$showData->twilio_number}"/>
                                </div>
                            </div>
        
                            
                        </div>
                        
                        <div class="tab-pane" id="Emailsendingsettings">
                            
                            <div class="form-group">
                                <label for="mail_host" class="col-lg-2 control-label">mail host</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_host" id="mail_host" required
                                         class="form-control" value="{$showData->mail_host}"/>
                                </div>
                                <label for="mail_port" class="col-lg-2 control-label">mail port</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_port" id="mail_port" required
                                         class="form-control" value="{$showData->mail_port}"/>
                                </div>
                            </div>
        
                            <div class="form-group">
                                <label for="mail_username" class="col-lg-2 control-label">mail username</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_username" id="mail_username" required
                                         class="form-control" value="{$showData->mail_username}"/>
                                </div>
                                <label for="mail_password" class="col-lg-2 control-label">mail password</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_password" id="mail_password" required
                                         class="form-control" value="{$showData->mail_password}"/>
                                </div>
                            </div>
        
                            <div class="form-group">
                                <label for="mail_encryption" class="col-lg-2 control-label">mail encryption</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_encryption" id="mail_encryption" required
                                         class="form-control" value="{$showData->mail_encryption}"/>
                                </div>
        
                                <label for="mail_fromaddress" class="col-lg-2 control-label">mail from address</label>
                                <div class="col-lg-4">
                                        <input type="text" name="mail_fromaddress" id="mail_fromaddress" required
                                         class="form-control" value="{$showData->mail_fromaddress}"/>
                                </div>
                            </div>
                            
                        </div>
                        
                    </div>    

                   
                    
                    
                    

                    <!-- =================================================   -->
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit" class="btn btn-primary pull-left" id="sbt_btn">حفظ</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">

    $(document).ready(function () {
            
        const tgForm = $('#jValidate');
        const sbtBtn = $('#sbt_btn');
    
        tgForm.addEventListener('submit', function (e) {
            e.preventDefault();
               sbtBtn.addClass("processing");
            if ($('#jValidate').valid()) {
                
                // لو كله تمام
                sbtBtn.disabled = true;
                sbtBtn.innerHTML = 'جارى التحميل...';
                tgForm.submit(); // الآن ا$لإرسال الفعلي
            }else{
                sbtBtn.removeClass("processing");
            }
        });
        
        
    });
        
  
</script>
{/literal}