Current File : /home/tradevaly/demo.tradevaly.com.bd/resources/views/backend/companies/edit.blade.php
@extends('layouts.backend')
    

    @section('content')  
<!-- Container Fluid-->
            <div class="row">
                <div class="col-lg-12">
                  <!-- Form Basic -->
                  <div class="card mb-4">
                    <div class="card-header card-header-modify py-3 d-flex flex-row align-items-center justify-content-between">
                      <h6 class="m-0 font-weight-bold text-heading-bar">Edit Company</h6>
                        <a href="{{route('companies.index')}}" class="btn btn-default-index  btn-sm text-right "><i class="fas fa-arrow-alt-circle-left"></i> Back</a>
                    </div>
                    <div class="card-body">
                        <!-- @if (count($errors) > 0)
                          <div class="alert alert-danger">
                                <strong>Whoops!</strong> There were some problems with your input.<br><br>
                                <ul>
                                   @foreach ($errors->all() as $error)
                                     <li>{{ $error }}</li>
                                   @endforeach
                                </ul>
                          </div>
                        @endif -->

                         {!! Form::model($company, ['method' => 'PATCH', 'enctype'  => 'multipart/form-data', 'id' => 'saveSompany', 'route' => ['companies.update', $company->id] ]) !!}
                            
                            <div class="row">

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">User<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::select('user_id', [''=>'Select User']+$user,$company->user_id, array('id' => 'user_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible user_id', 'id' => 'user_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 
                                        @error('user_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('user_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-user_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Company Name<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::text('company_name', null, array('placeholder' => 'Enter company name','class' => 'form-control company_name')) !!}
                                        @error('company_name')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('company_name') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-company_name" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Contact Person Name<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::text('person_name', null, array('placeholder' => 'Enter contact person name','class' => 'form-control person_name')) !!}
                                        @error('person_name')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('person_name') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-person_name" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Designation</label>
                                    <div>
                                        {!! Form::text('designation', null, array('placeholder' => 'Enter designation','class' => 'form-control designation')) !!}
                                        @error('designation')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('designation') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-designation" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                

                                
                                
                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Country<span style="color: red"> *</span></label>
                                    <div>
                                         {!! Form::select('country_id', [''=>'Select Country']+$country['countryNameOnly'],$company->country_id, array('id' => 'country_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible country_ids', 'id' => 'country_ids', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 

                                        
                                  
                                        @error('country_ids')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('country_ids') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-country_ids" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                

                                <!-- <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">City<span style="color: red"> *</span></label>
                                    <div>

                                         {!! Form::text('city', null, array('placeholder' => 'Enter city', 'id' => 'city_id', 'class' => 'form-control city_ids')) !!}

                                  
                                        @error('city')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('city') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-city_ids" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div> -->


                                
                                <div class="form-group col-sm-4 price_type_normal">
                                    <label for="exampleInputEmail1">Mobile No.<span style="color: red"> *</span>
                                    </label>
                                    
                                    <div class="input-group mb-3">
                                        
                                        <div class="input-group-prepend">
                                          <span class="input-group-text calling-code">{{ !empty($country['countryCodeOnly'][$company->country_id]) ? $country['countryCodeOnly'][$company->country_id] : '' }}</span>
                                        </div>

                                        {!! Form::text('mobile', null, array('placeholder' => 'Enter mobile no','class' => 'form-control mobile', )) !!}

                                    </div>
                                     
                                    @error('mobile')
                                          <span class="invalid-feedback" role="alert">
                                              <strong>{{ $errors->first('mobile') }}</strong>
                                          </span>
                                    @enderror


                                    <span class="invalid-feedback  alert-mobile" role="alert" style="font-weight: bold;"></span>

                                </div>

                                <!-- <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Mobile No.<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::text('mobile', null, array('placeholder' => 'Enter mobile no','class' => 'form-control mobile')) !!}
                                        @error('mobile')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('mobile') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-mobile" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div> -->

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Alternative Mobile No.</label>
                                    <div>
                                        {!! Form::text('alt_mobile', null, array('placeholder' => 'Enter alternative mobile no','class' => 'form-control alt_mobile')) !!}
                                        @error('alt_mobile')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('alt_mobile') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-alt_mobile" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                
                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Telephone No.</label>
                                    <div>
                                        {!! Form::text('tel', null, array('placeholder' => 'Enter telephone no','class' => 'form-control tel')) !!}
                                        @error('tel')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('tel') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-tel" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Email</label>
                                    <div>
                                        {!! Form::text('email', null, array('placeholder' => 'Enter email','class' => 'form-control email')) !!}
                                        @error('email')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('email') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-email" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Alternative Email</label>
                                    <div>
                                        {!! Form::text('alt_email', null, array('placeholder' => 'Enter alternative email','class' => 'form-control alt_email')) !!}
                                        @error('alt_email')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('alt_email') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-alt_email" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Website</label>
                                    <div>
                                        {!! Form::url('website', null, array('placeholder' => 'Ex: https://www.google.com/','class' => 'form-control website')) !!}
                                  
                                        @error('website')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('website') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-website" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>  


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Established Year</label>
                                    <div>
                                        {!! Form::select('year_id', [null=>'Select Established Year']+$years,$company->year_id, array('id' => 'year_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible year_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 
                                  
                                        @error('year_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('year_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-year_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>



                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">Address<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::text('address', null, array('placeholder' => 'Enter address','class' => 'form-control address')) !!}
                                        @error('address')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('address') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-address" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-6">
                                  <label for="exampleInputEmail1"> Latitude</label>
                                    <div>

                                        {!! Form::text('latitude', null, array('placeholder' => 'Enter latitude','class' => 'form-control latitude')) !!}

                                        @error('latitude')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('latitude') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-latitude" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                 <div class="form-group col-sm-6">
                                  <label for="exampleInputEmail1"> Longitude</label>
                                    <div>
                                         {!! Form::text('longitude', null, array('placeholder' => 'Enter longitude','class' => 'form-control longitude')) !!}

                                        @error('longitude')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('longitude') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-longitude" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1"> Google Map URL</label>
                                    <div>
                                         {!! Form::url('google_map_url', null, array('placeholder' => 'Enter google map URL','class' => 'form-control google_map_url')) !!}

                                        @error('google_map_url')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('google_map_url') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-longitude" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Package<span style="color: red"> *</span></label>
                                    <div>
                                          {!! Form::select('package_id', [''=>'Select Package']+$packages,$company->package_id, array('id' => 'package_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible package_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 


                                        @error('package_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('package_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-package_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Buying / Selling Package </label>
                                    <div>
                                          {!! Form::select('package_buying_selling_id', [0=>'Select Buying / Selling Package']+$packageBuyingSelling,$company->package_buying_selling_id, array('id' => 'package_buying_selling_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible package_buying_selling_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 


                                        @error('package_buying_selling_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('package_buying_selling_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-package_buying_selling_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Banner Ads Package  </label>
                                    <div>
                                          {!! Form::select('package_banner_ad_id', [0=>'Select Banner Ads Package']+$packagePackageBannerAd,$company->package_banner_ad_id, array('id' => 'package_banner_ad_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible package_banner_ad_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 


                                        @error('package_banner_ad_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('package_banner_ad_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-package_banner_ad_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Lead Package  </label>
                                    <div>
                                          {!! Form::select('package_lead_id', [0=>'Select Lead Package']+$packageLead,$company->package_lead_id, array('id' => 'package_lead_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible package_lead_id', 'tabindex' => '-1', 'aria-hidden' => 'true', 'single')) !!} 


                                        @error('package_lead_id')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('package_lead_id') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-package_lead_id" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <!-- <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Expire Date</label>
                                    <div>
                                        @php  $expDate = !empty($company->exp_date) ? date("d-m-Y", strtotime($company->exp_date)) : 'No Exists'; @endphp

                                         {!! Form::text('exp_date',  $expDate, array('placeholder' => '','class' => 'form-control exp_date', 'disabled')) !!}
                                  
                                        @error('exp_date')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('exp_date') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-exp_date" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div> -->


                              

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Company Logo (<span class="image-label-highlight">Max Size: 500KB</span>)</label>
                                    <div>
                                        {!! Form::file('logo', array('class' => 'form-control logo',  'onchange' => 'previewImage("logo", "previewImg", "logo")' )) !!}
                                        @error('logo')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('logo') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-logo" role="alert" style="font-weight: bold;"></span>

                                        <img id="previewImg" width="64px" height="64px" src="{{ asset('storage/app/public/company_logo/'.$company->logo) }}" alt="">

                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Company Cover Photo (<span class="image-label-highlight">Max Size: 500KB</span>)</label>
                                    <div>
                                        {!! Form::file('cover_photo', array('class' => 'form-control cover_photo',  'onchange' => 'previewImage("cover_photo", "previewCoverImg", "cover_photo")' )) !!}
                                        @error('logo')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('logo') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-cover_photo" role="alert" style="font-weight: bold;"></span>

                                        <img id="previewCoverImg" width="64px" height="64px" src="{{ asset('storage/app/public/companies/cover_photo/'.$company->cover_photo) }}" alt="">


                                        
                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Photo Galley 1 (<span class="image-label-highlight">Max Size: 500KB</span>)</label>
                                    <div>
                                        
                                        {!! Form::file('gallery1', array('class' => 'form-control galleries1',  'onchange' => 'previewImage("galleries1", "previewGal1Img", "galleries1")' )) !!}
                                        
                                        @error('galleries')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('galleries') }}</strong>
                                            </span>
                                        @enderror

                                        @php 
                                            $galleries = json_decode($company->galleries) ;

                                            $gal1 = !empty($galleries[0]) ? $galleries[0] : '';
                                            
                                            $gal2 = !empty($galleries[1]) ? $galleries[1] : '';
                                            
                                            $gal3 = !empty($galleries[2]) ? $galleries[2] : '';

                                        @endphp

                                        
                                        <span class="invalid-feedback  alert-galleries1" role="alert" style="font-weight: bold;"></span>
                                        
                                        <img id="previewGal1Img" width="64px" height="64px" src="{{ asset('storage/app/public/company_gallery/'.$gal1) }}" alt="">

                                    </div>
                                </div>

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1"> Photo Galley 2 (<span class="image-label-highlight">Max Size: 500KB</span>)</label>
                                    <div>
                                        {!! Form::file('gallery2', array('class' => 'form-control galleries2', 'onchange' => 'previewImage("galleries2", "previewGal2Img", "galleries2")')) !!}
                                        @error('galleries')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('galleries') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-galleries2" role="alert" style="font-weight: bold;"></span>
                                        
                                         <img id="previewGal2Img" width="64px" height="64px" src="{{ asset('storage/app/public/company_gallery/'.$gal2) }}" alt="">

                                    </div>
                                </div>


                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1"> Photo Galley 3 (<span class="image-label-highlight">Max Size: 500KB</span>)</label>
                                    <div>
                                        {!! Form::file('gallery3', array('class' => 'form-control galleries3', 'onchange' => 'previewImage("galleries3", "previewGal3Img", "galleries3")')) !!}
                                        @error('galleries')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('galleries') }}</strong>
                                            </span>
                                        @enderror
                                        
                                        <span class="invalid-feedback  alert-galleries3" role="alert" style="font-weight: bold;"></span>

                                         <img id="previewGal3Img" width="64px" height="64px" src="{{ asset('storage/app/public/company_gallery/'.$gal3) }}" alt="">

                                    </div>
                                </div>

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Facebook URL</label>
                                    <div>
                                        {!! Form::text('facebook', null, array('placeholder' => 'Ex: https://www.facebook.com//GK4YolHRKoc','class' => 'form-control facebook')) !!}
                                        @error('facebook')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('facebook') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-facebook" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Youtube Channel URL</label>
                                    <div>
                                        {!! Form::text('youtube', null, array('placeholder' => 'Ex: https://youtu.be/GK4YolHRKoc','class' => 'form-control youtube')) !!}
                                        @error('youtube')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('youtube') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-youtube" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>



                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Twitter URL</label>
                                    <div>
                                        {!! Form::text('twitter', null, array('placeholder' => 'Ex: https://twitter.com/','class' => 'form-control twitter')) !!}
                                        @error('twitter')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('twitter') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-twitter" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                
                                <div class="form-group col-sm-4">
                                  <label for="exampleInputEmail1">Corporate Youtube  Video URL</label>
                                    <div>
                                        {!! Form::text('corporate_video', null, array('placeholder' => 'Ex: GK4YolHRKoc','class' => 'form-control corporate_video')) !!}
                                        @error('corporate_video')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('corporate_video') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-corporate_video" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>
                                


                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">Brand</label>
                                    <div>
                                        {!! Form::select('brand_ids[]', [''=>'Select Brand']+$brands,json_decode($company->brand_ids), array('id' => 'brand_id', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible brand_ids', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple')) !!} 
                                  
                                        @error('brand_ids')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('brand_ids') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-brand_ids" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>

                                

                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">Company Category<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::select('company_category_ids[]', [''=>'Select Brand']+$companyCategory,$reArrangeCompanyCategoryDetails, array('id' => 'company_category_ids', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible company_category_ids', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple')) !!} 
                                  
                                       
                                        @error('company_category_ids')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('company_category_ids') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-company_category_ids" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>




                                 <div class="form-group col-sm-4">
                                      <label for="exampleInputEmail1">Product Top Category<span style="color: red"> *</span></label>
                                        <div>
                                            {!! Form::select('product_category_id[]', [''=>'Select Top Category']+$topCatList,$reArrangeCategoryMappingDataIntiger[1], array('id' => 'product_top_category', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible product_top_category', 'tabindex' => '-1', 'aria-hidden' => 'true',  'multiple', 'detect' => 0)) !!} 
                                      
                                            @error('product_category_id')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $errors->first('product_category_id') }}</strong>
                                                </span>
                                            @enderror

                                            <span class="invalid-feedback  alert-product_top_category" role="alert" style="font-weight: bold;"></span>
                                        </div>
                                    </div>


                                    <div class="form-group col-sm-4">
                                      <label for="exampleInputEmail1">Sub Category</label>
                                        <div>
                                            {!! Form::select('second_step_cat_id[]', [''=>'']+$reArrangeCategoryMappingDataString[2],$reArrangeCategoryMappingDataIntiger[2], array('id' => 'sub_category', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible sub_category', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple', 'detect' => 0)) !!} 
                                      
                                            @error('second_step_cat_id')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $errors->first('second_step_cat_id') }}</strong>
                                                </span>
                                            @enderror


                                            <span class="invalid-feedback  alert-sub_category" role="alert" style="font-weight: bold;"></span>
                                        </div>
                                    </div>


                                    <div class="form-group col-sm-4">
                                      <label for="exampleInputEmail1">Child1 Category</label>
                                        <div>
                                            {!! Form::select('third_step_cat_id[]', [''=>'']+$reArrangeCategoryMappingDataString[3],$reArrangeCategoryMappingDataIntiger[3], array('id' => '3rd_cat_id', 'class' => 'child1_category js-example-basic-multiple js-states form-control select2-hidden-accessible', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple', 'detect' => 0)) !!} 
                                      
                                            @error('third_step_cat_id')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $errors->first('third_step_cat_id') }}</strong>
                                                </span>
                                            @enderror

                                            <span class="invalid-feedback  alert-child1_category" role="alert" style="font-weight: bold;"></span>
                                        </div>
                                    </div>


                                    <div class="form-group col-sm-4">
                                      <label for="exampleInputEmail1">Child2 Category</label>
                                        <div>
                                            {!! Form::select('fourth_step_cat_id[]', [''=>'']+$reArrangeCategoryMappingDataString[4],$reArrangeCategoryMappingDataIntiger[4], array('id' => 'child2_category', 'class' => 'child2_category js-example-basic-multiple js-states form-control select2-hidden-accessible', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple')) !!} 
                                      
                                            @error('fourth_step_cat_id')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $errors->first('fourth_step_cat_id') }}</strong>
                                                </span>
                                            @enderror

                                            <span class="invalid-feedback  alert-child2_category" role="alert" style="font-weight: bold;"></span>
                                        </div>
                                    </div>


                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">Related Company</label>
                                    <div>
                                        {!! Form::select('related_company[]', [''=>'Select Related Company']+$companies,json_decode($company->related_company), array('id' => 'related_company', 'class' => 'js-example-basic-multiple js-states form-control select2-hidden-accessible related_company', 'tabindex' => '-1', 'aria-hidden' => 'true', 'multiple')) !!} 
                                  
                                        @error('related_company')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('related_company') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-related_company" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>



                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">Short Summery<span style="color: red"> *</span></label>
                                    <div>
                                        {!! Form::textarea('short_summery', null, array('placeholder' => 'Enter short summery', 'class' => 'short_summery form-control', 'cols' => '5', 'rows' => '5')) !!}
                                        @error('short_summery')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('short_summery') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-short_summery" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-12">
                                  <label for="exampleInputEmail1">About Company</label>
                                    <div>
                                        {!! Form::textarea('about_company', null, array('placeholder' => 'Enter about your company','class' => 'form-control content', 'cols' => '5', 'rows' => '5')) !!}
                                        @error('about_company')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('about_company') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-about_company" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                               

                                <div class="form-group col-sm-3">
                                  <label for="exampleInputEmail1">Feature Company</label>
                                    <div>
                                         {{ Form::checkbox('feature_company',1,null, array('class'=>'feature_company')) }}

                                        @error('feature_company')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('feature_company') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-feature_company" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-3">
                                  <label for="exampleInputEmail1">Special Offer Email</label>
                                    <div>
                                         {{ Form::checkbox('special_email_offer',1,null, array('class'=>'special_email_offer')) }}

                                        @error('special_email_offer')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('special_email_offer') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-special_email_offer" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                <div class="form-group col-sm-3">
                                  <label for="exampleInputEmail1">Membership Agreement</label>
                                    <div>
                                         {{ Form::checkbox('membership_agreements',1,null, array('class'=>'membership_agreements')) }}

                                        @error('membership_agreements')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('membership_agreements') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-membership_agreements" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>


                                


                                 <div class="form-group col-sm-3">
                                  <label for="exampleInputEmail1">Status</label>
                                    <div>
                                          {{ Form::radio('status',0,null, array('class'=>'status')) }} Pending

                                          {{ Form::radio('status',1,null, array('class'=>'status')) }} Listed
                                          
                                          {{ Form::radio('status',2,null, array('class'=>'status')) }} Verified

                                          

                                        @error('status')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $errors->first('status') }}</strong>
                                            </span>
                                        @enderror

                                        <span class="invalid-feedback  alert-status" role="alert" style="font-weight: bold;"></span>
                                    </div>
                                </div>



                                 


                                                                                   
                            </div>                            
                          
                        <button type="submit" class="btn btn-success">Update</button>
                        {!! Form::close() !!}
                    </div>
                  </div>
                </div>
            </div>
          <!--Row-->



      <script type="text/javascript">
        
              $.fn.select2.amd.require([
              
              ], function (Select2, Utils, oldMatcher) {
              var $basicMultiple = $(".js-example-basic-multiple");
              
              var $dataArray = $(".js-example-data-array");
              var $dataArraySelected = $(".js-example-data-array-selected");

              $.fn.select2.defaults.set("width", "100%");

              $basicMultiple.select2();
              $basicMultiple.select2({
                maximumSelectionLength: 4
              });


              
              $(".js-example-disabled").select2();
              $(".js-example-disabled-multi").select2();

              $(".js-example-responsive").select2({
                width: 'resolve' // need to override the changed default
              });

             
            });



           $(document).on('change', '#country_ids', function() {   
                
                var value = [];
                value = $(this).val();

                route = {!! json_encode(url('/')) !!}+'/get-city/'+ value;

                emptyFieldClass = ['city_ids '];
                
                targetShowClass = 'city_ids';

                getAutoDropdownData(targetShowClass, route, emptyFieldClass);

                //alert('Response');

            });


             /*$(document).on('change', '#package_id', function() {   
                $(".exp_date").val('');
                var packageId = $(this).val();

                var APP_URL = {!! json_encode(url('/')) !!}

                $.ajax({
                    type: "GET",
                    url: APP_URL + '/get-package-expire-date/' + packageId,
                    dataType: "JSON",
                    success: function(data) {

                        $(".exp_date").val(data);
                        
                    },

                    error: function() {

                         $(".exp_date").html('');

                    }

                });
            });*/
        
      </script>







      <!-- start form validation -->
        <script type="text/javascript">
             
            $(".country_ids").change(function(){

                var countryCode = {!! json_encode($country['countryCodeOnly']) !!};

                var val = $(this).find(":selected").val();
               $('.calling-code').html(countryCode[val]);
            });


             $(".mobile").keyup(function(e){

                var mobile = $(this).val();
                var firstNum = $(this).val().match(/([\d]+)/g)[0];

                //alert(mobile.charAt(0));

                // start check value type numeric
                if( ! $.isNumeric(mobile) &&  e.keyCode!=9 ){
                    $(this).val('');
                    alert('Invalied number.');

                }                
                // end check value type numeric
                else if(mobile.charAt(0) == 0){
                    
                    $(this).val('');

                    alert('Please ignore 0 from start digit.');
                }

            });

            $("#saveSompany").submit(function(e){
                
                var hasLogo = "<?php echo $company->logo; ?>" ; 
                var hasFieldLogo = $('.logo').val(); 
                //alert(hasFieldLogo);
                var hasGal1 = "<?php echo $gal1; ?>" ; 
                var hasFieldGal1 = $('.galleries1').val(); 

                var hasGal2 = "<?php echo $gal2; ?>"; 
                var hasFieldGal2 = $('.galleries2').val(); 
                //alert(hasFieldGal2);
                //alert(hasFieldGal1);
                var hasGal3 = "<?php echo $gal3; ?>" ;
                var hasFieldGal3 = $('.galleries3').val();  
                //alert(hasFieldLogo);

                if( $('.user_id').val() == '' ){

                    $('.alert-user_id').html('User can not be left blank.');

                    return false;

                }else if( $('.company_name').val() == '' ){

                    $('.alert-company_name').html('Company name can not be left blank.');
                    
                    return false;

                }else if( $('.person_name').val() == '' ){
                    $('.alert-company_name').html('');

                    $('.alert-person_name').html('Contact person name can not be left blank.');
                    
                    return false;

                }else if( $('.country_ids').val() == null  ||  $('.country_ids').val() == '' ){
                    
                    $('.alert-company_name').html('');
                    $('.alert-person_name').html('');
                    

                    $('.alert-country_ids').html('Country can not be left blank.');
                    
                    return false;

                }else if( $('.mobile').val() == '' ){
                    
                    $('.alert-company_name').html('');
                    $('.alert-person_name').html('');
                    
                    $('.alert-country_ids').html('');
                    

                    $('.alert-mobile').html('Mobile no. can not be left blank.');
                    
                    return false;

                }else if( $('.address').val() == '' ){
                        
                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        
                        $('.alert-address').html('Address can not be left blank.');
                        
                        return false;

                }/*else if( $('.package_id').val() == null ||  $('.package_id').val() == '' ){
                    
                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        $('.alert-address').html('');
                        $('.alert-package_id').html('Package can not be left blank.');
                        
                        return false;

                }*/else if( $('.company_category_ids').val() == null ||  $('.company_category_ids').val() == '' ){
                    
                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        
                        $('.alert-address').html('');
                        //$('.alert-package_id').html('');
                        
                        $('.alert-company_category_ids').html('Company category  can not be left blank.');
                        
                        return false;

                }else if( $('.short_summery').val() == '' ){
                    
                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        
                        $('.alert-address').html('');
                        //$('.alert-package_id').html('');
                       
                        $('.alert-company_category_ids').html('');

                        $('.alert-short_summery').html('Short summery can not be left blank.');
                        
                        return false;
                }else if( $('.about_company').val() == '' ){
                    
                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        
                        $('.alert-address').html('');
                        //$('.alert-package_id').html('');
                       
                        $('.alert-company_category_ids').html('');
                        $('.alert-short_summery').html('');

                        $('.alert-about_company').html('About company can not be left blank.');
                        
                        return false;
                }else{

                        $('.alert-company_name').html('');
                        $('.alert-person_name').html('');
                        
                        $('.alert-country_ids').html('');
                        
                        $('.alert-mobile').html('');
                        
                        $('.alert-address').html('');
                        //$('.alert-package_id').html('');
                       
                        $('.alert-company_category_ids').html('');
                        $('.alert-short_summery').html('');
                        

                        return true;
                }


            

            });

        </script>
        
      <!-- end form validation -->


        <script type="text/javascript">
            $(document).on('change', '#product_top_category', function() {   
                
                var value = [];
                value = $(this).val();

                route = {!! json_encode(url('/')) !!}+'/get-product-cat/second_step_cat/'+ value;

                emptyFieldClass = ['sub_category ', 'child1_category', 'child2_category'];
                
                targetShowClass = 'sub_category';

                getAutoDropdownData(targetShowClass, route, emptyFieldClass);

                //alert('Response');

            });



            $(document).on('change', '#sub_category', function() {   
                
                value = $(this).val();
                
                route = {!! json_encode(url('/')) !!}+'/get-product-cat/third_step_cat/'+ value;


                emptyFieldClass = ['child1_category', 'child2_category'];
                
                targetShowClass = 'child1_category';

                getAutoDropdownData(targetShowClass, route, emptyFieldClass);

                //alert('Response');

            });




            $(document).on('change', '#3rd_cat_id', function() {   
                
                value = $(this).val();
                
                route = {!! json_encode(url('/')) !!}+'/get-product-cat/fourth_step_cat/'+ value;


                emptyFieldClass = ['child2_category'];
                
                targetShowClass = 'child2_category';

                getAutoDropdownData(targetShowClass, route, emptyFieldClass);

                //alert('Response');

            });
      </script>


    @endsection