<?php $__env->startSection('title','الاعدادات الاساسية'); ?>
<?php $__env->startSection('content'); ?>
<div class="app-content content ">
    <div class="content-overlay"></div>
    <div class="header-navbar-shadow"></div>
    <div class="content-wrapper container-xxl p-0">
      <div class="content-header row">
        <div class="content-header-left col-md-9 col-12 mb-2">
          <div class="row breadcrumbs-top">
            <div class="col-12">

              <h2 class="content-header-title float-start mb-0">
                الإعدادات الأساسية
             </h2>
              <div class="breadcrumb-wrapper">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="<?php echo e(route('client.home')); ?>">لوحة التحكم </a>
                  </li>
                  <li class="breadcrumb-item active" >  
                    الإعدادت             
                  </li>
                  <li class="breadcrumb-item active" > 
                    الإعدادات الأساسية
                  </li>
                </ol>
              </div>
            </div>
          </div>
        </div>
        <div class="content-header-right text-md-end col-md-3 col-12 d-md-block d-none">

        </div>
    </div>
      <div class="content-body">
        <section class="app-user-view-account">
<div class="row">
  <!-- User Sidebar -->

  <!-- User Content -->
  <?php echo $__env->make('client.settings.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!--/ User Pills -->

    <!-- Project table -->
    <div class="card">
        <div class="card-header">
            <h4 class="card-title">البيانات الاساسية</h4>
        </div>

    <div class="card-body">
        <form id="form" method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>"/>
                <div class="row">
                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="brand_name">اسم الشركة</b>
                        <input type="text" class="form-control" name="company_name" placeholder="اسم الشركة"
                               value="<?php echo e($company->company_name); ?>" 
                               id="brand_name"/>
                    </div>
                </div>
                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="person_name">اسم مدير الشركة</b>
                        <input type="text" class="form-control" name="company_owner"
                               value="<?php echo e($company->company_owner); ?>" placeholder="اسم مدير الشركة"
                               id="person_name"/>
                    </div>
                </div>
                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="location">عنوان الشركة</b>
                        <input type="text" class="form-control" name="company_address"
                               value="<?php echo e($company->company_address); ?>" placeholder="عنوان الشركة"
                               id="location"/>
                    </div>
                </div>
                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="phone_1">رقم موبايل الشركة</b>
                        <input type="text" value="<?php echo e($company->phone_number); ?>"  class="form-control" 
                               name="phone_number" id="phone_1" placeholder="رقم موبايل الشركة" />
                    </div>
                </div>

                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="fileToUpload30">لوجو الشركة</b>
                        <input accept=".jpg,.png,.jpeg" oninput="pic.src=window.URL.createObjectURL(this.files[0])"
                               type="file" class="form-control" name="company_logo"/>
                        <b for="" class="d-block"> معاينة الصورة </b>
                        <img id="pic" src="<?php echo e(asset($company->company_logo)); ?>"
                             style="width: 100px; height:100px;"/>
                    </div>
                </div>

                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="fileToUpload40"> هيدر الطباعة </b>
                        <input accept=".jpg,.png,.jpeg" oninput="pic2.src=window.URL.createObjectURL(this.files[0])"
                               type="file" class="form-control" name="header"/>
                        <b for="" class="d-block"> معاينة الصورة </b>
                        <img id="pic2" src="<?php echo e(asset($company->basic_settings->header)); ?>"
                             style="width: 100%; height:100px;"/>
                    </div>
                </div>

                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="fileToUpload50"> فوتر الطباعة </b>
                        <input accept=".jpg,.png,.jpeg" oninput="pic3.src=window.URL.createObjectURL(this.files[0])"
                               type="file" class="form-control" name="footer"/>
                        <b for="" class="d-block"> معاينة الصورة </b>
                        <img id="pic3" src="<?php echo e(asset($company->basic_settings->footer)); ?>"
                             style="width: 100%; height:100px;"/>
                    </div>
                </div>

                <div class="col-md-4 col-12">
                    <div class="mb-1">
                        <b for="fileToUpload60"> الختم الالكترونى </b>
                        <input accept=".jpg,.png,.jpeg" oninput="pic4.src=window.URL.createObjectURL(this.files[0])"
                               type="file" class="form-control" name="electronic_stamp"/>
                        <b for="" class="d-block"> معاينة الصورة </b>
                        <img id="pic4" src="<?php echo e(asset($company->basic_settings->electronic_stamp)); ?>"
                             style="width: 100px; height:100px;"/>
                    </div>
                </div>

                <div class="clearfix"></div>
                <div class="col-12" align="center">
                    <br>
                      <button type="submit" class="btn btn-success me-1">تعديل</button>
                      <button type="button" class="btn btn-outline-danger" onclick="window.history.back()">رجوع</button>
                    </div>
            </div>
            </form>
        </div>
    </div>
  </div>
  <!--/ User Content -->
</div>
</section>
      </div>
  </div>
  <!-- END: Content-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        var selectForm = $('#form');

if (selectForm) {
    selectForm.validate({

        rules: {
      'company_name': {
        required: true,
      },
      'company_address': {
        required: true
      },
      'company_owner': {
        required: true
      },
      'phone_number': {
        required: true
      },

    
    
    }
  });
}

$("#form").on('submit',(function(e) {

e.preventDefault();

$.ajax({

  url: "<?php echo e(route('client.basic.settings.update')); ?>",

  type: "POST",

  data:  new FormData(this),

  dataType:  'json',

  contentType: false,

  cache: false,

  processData:false,
  
  beforeSend : function (){var ifConnected = window.navigator.onLine;if (!ifConnected) {toastr.info("يتم الآن إعادة الإتصال","لا يوجد إتصال بالإنترنت",{positionClass: "toast-top-right",tapToDismiss: !1,timeOut: 2e3,rtl: $("html").attr("data-textdirection")});}},

  success: function(response) {

    if(response.status){

            toastr.success("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });      
            document.getElementById("addForm").reset();

    }else{
        toastr.warning("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });   
    } 

  },
  error: function(response){
          $.each(response.responseJSON.errors, function (key, item) 
          {
            toastr.error("",item,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });

          });
  },

 });

}));
    </script>

    <?php $__env->stopSection(); ?>
<?php echo $__env->make('client.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/barasys/public_html/resources/views/client/settings/basic.blade.php ENDPATH**/ ?>