<?php echo Form::open(['url'=>route('saveProfile'),'method'=>'post','files'=>true, 'class' => 'image-form']); ?>

  <?php echo Form::hidden('image'); ?>

  <section id="profile" class="panel panel-primary">
    <header class="panel-heading">
      <h2><?php echo app('translator')->getFromJson('backend.profile'); ?></h2>
    </header>
    <div class="panel-body">
      <?php if(Session::has('message')): ?>
        <div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <p><?php echo e(Session::get('message')); ?></p>
        </div>
      <?php endif; ?>
      <div class="form-group col-xs-12 col-sm-6">
        <div class="col-xs-12 image-with-preview box-bordered text-center">

          <label for=""><?php echo app('translator')->getFromJson('backend.select-company-logo'); ?></label> <br>
          <img class="prev-img img-bordered" alt="Logo" src="<?php echo e(!empty($masterLogo)?asset($storage_url.'img/'.$masterLogo):'http://via.placeholder.com/200x200'); ?>">
          <div class="<?php echo e($errors->has('companyLogo') ? ' has-error' : ''); ?>">
            <?php echo Form::file('companyLogo',['class'=>'form-control','data-fileinput'=>'image']); ?>

            <?php if($errors->has('companyLogo')): ?>
              <span class="help-block">
                <strong><?php echo e($errors->first('companyLogo')); ?></strong>
              </span>
            <?php endif; ?>
            <br>
            <div class="upload-rules text-left">
              <ul>
                <li><?php echo app('translator')->getFromJson('backend.min-resolution'); ?> <strong>200x200 px</strong></li>
                <li><?php echo app('translator')->getFromJson('backend.file-type'); ?> <strong>PNG/JPG</strong></li>
                <li><?php echo app('translator')->getFromJson('backend.max-file-size'); ?> <strong>500kb</strong></li>
              </ul>
            </div>
          </div>
        </div>

        <div class="col-xs-12 image-with-preview box-bordered text-center">
          <label for=""><?php echo app('translator')->getFromJson('backend.select-company-icon'); ?></label> <br>
          <img class="prev-img img-bordered" alt="Favicon" src="<?php echo e(!empty($masterFavicon)?asset($storage_url.'img/'.$masterFavicon):'http://via.placeholder.com/200x200'); ?>" style="padding:84px">
          <div class="<?php echo e($errors->has('companyFavicon') ? ' has-error' : ''); ?>">
            <?php echo Form::hidden('companyFaviconId',$companyFavicon->id); ?>

            <?php 
              $version = rand(1,100);
             ?>
            <?php echo Form::hidden('faviconVersion', $version); ?>

            <?php echo Form::file('companyFavicon',['class'=>'form-control','data-fileinput'=>'image']); ?>

            <?php if($errors->has('companyFavicon')): ?>
                <span class="help-block">
                    <strong><?php echo e($errors->first('companyFavicon')); ?></strong>
                </span>
            <?php endif; ?>
            <br>
            <div class="upload-rules text-left">
              <ul>
                <li><?php echo app('translator')->getFromJson('backend.min-resolution'); ?> <strong>32 x 32 px</strong></li>
                <li><?php echo app('translator')->getFromJson('backend.file-type'); ?> <strong>*.ico</strong></li>
                <li><?php echo app('translator')->getFromJson('backend.max-file-size'); ?> <strong>50kb</strong></li>
              </ul>
            </div>
          </div>
        </div>
      </div>

      <div class="form-group col-xs-12 col-sm-6<?php echo e($errors->has('companyName') ? ' has-error' : ''); ?>">
        <label class="control-label">
          <i class="fa fa-id-badge" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('backend.company-name'); ?>
        </label>
        <?php echo Form::hidden('companyNameId',$companyName->id); ?>

        <?php echo Form::text('companyName',$companyName->setting_value,['class'=>'form-control']); ?>

        <?php if($errors->has('companyName')): ?>
            <span class="help-block">
                <strong><?php echo e($errors->first('companyName')); ?></strong>
            </span>
        <?php endif; ?>
      </div>

      <div class="form-group col-xs-12 col-sm-6">
        <label class="radio-inline">
          <input type="checkbox" name="logoSetting" <?php echo e($logoSetting == 'yes' ? 'checked' : ''); ?>> <?php echo app('translator')->getFromJson('backend.display-company-logo'); ?>
        </label>
        <label class="radio-inline" style="margin-left: 0">
          <input type="checkbox" name="nameSetting" <?php echo e($nameSetting == 'yes' ? 'checked' : ''); ?>> <?php echo app('translator')->getFromJson('backend.display-company-name'); ?>
        </label>
      </div>

      <div class="form-group col-xs-12 col-sm-6<?php echo e($errors->has('companyDesc') ? ' has-error' : ''); ?>">
        <label class="control-label">
          <i class="fa fa-info-circle" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('backend.company-description'); ?>
        </label>
        <?php echo Form::hidden('companyDescId',$companyDesc->id); ?>

        <?php echo Form::textarea('companyDesc',$companyDesc->setting_value,['class'=>'form-control not-tinymce','max'=>'255']); ?>


        <?php if($errors->has('companyDesc')): ?>
          <span class="help-block">
              <strong><?php echo e($errors->first('companyDesc')); ?></strong>
          </span>
        <?php endif; ?>
      </div>

    </div>
    <footer class="panel-footer text-right">
      <button type="submit" class="btn btn-primary btn-image-submit"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
    </footer>
  </section>
<?php echo Form::close(); ?>

