<?php $__env->startSection('content'); ?>
<!-- consultants content -->
<style type="text/css">
 .imageThumb {

   border: 2px solid;

    padding: 1px;

    width: 100%;

    cursor: pointer;

  }



  .pip {

    display: inline-block;

    margin: 10px 10px 0 0;

    width: 30%;

    vertical-align: top;

}

.remove {

    width: 100%;

    display: block;

    background: #444;

    border: 1px solid black;

    color: white;

    text-align: center;

    cursor: pointer;

    }



    .position {

      width: 100%;

    }
 .clr {
  padding:5px;
  border: 1px solid #CCC;
 }
</style>
<div class="right_col" role="main">
  <div class="row x_panel">
    <div class="col-md-12 col-sm-12 col-xs-12">
    <h1>Consultants</h1>
<?php if(isset($data)){ ?>
<form action="<?php echo url('/'); ?>/admin/consultants/edit" id="" class="form-horizontal " method="post" enctype="multipart/form-data">
<?php echo e(csrf_field()); ?>

<input type="hidden" name="con_id" value="<?php echo $data->con_id; ?>">


<!-- Con_name Start -->
<div class="form-group">
  <label for="con_name" class="col-sm-3 control-label"> Name <span style="color:red">*</span></label>
  <div class="col-sm-4">
    <input type="text" class="form-control" id="con_name" name="con_name" value="<?php echo e($data->con_name); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_name")); ?></div>
      </div>
</div> 
<!-- Con_name End -->



<!-- Con_email Start -->
<div class="form-group">
  <label for="con_email" class="col-sm-3 control-label"> Email <span style="color:red">*</span></label>
  <div class="col-sm-4">
    <input type="email" class="form-control" id="con_email" name="con_email" value="<?php echo e($data->con_email); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_email")); ?></div>
      </div>
</div> 
<!-- Con_email End -->



<!-- Con_second_email Start -->
<div class="form-group">
  <label for="con_second_email" class="col-sm-3 control-label"> Second Email </label>
  <div class="col-sm-4">
    <input type="email" class="form-control" id="con_second_email" name="con_second_email" value="<?php echo e($data->con_second_email); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_second_email")); ?></div>
      </div>
</div> 
<!-- Con_second_email End -->



<!-- Con_phone Start -->
<div class="form-group">
  <label for="con_phone" class="col-sm-3 control-label"> Mobile <span style="color:red">*</span></label>
  <div class="col-sm-4">
    <input type="number" class="form-control" id="con_phone" name="con_phone" value="<?php echo e($data->con_phone); ?>" onkeydown="if(this.value.length==10 && event.keyCode!=8 && event.keyCode!=9) return false;" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_phone")); ?></div>
      </div>
</div> 
<!-- Con_phone End -->



    <!-- Con_avatar Start -->
    <div class="form-group">
      <label for="con_avatar" class="control-label col-md-3"> Avatar </label>
        <div class="col-md-4">
          <input type="file" id="con_avatar" name="con_avatar" class="form-control" /><br>
          <div class="field" align="left">
          <?php if($data->con_avatar!=''){
            echo '<img src="'.url('/')."/uploads/{$data->con_avatar}".'" style="width:100px;">'; 
            } ?>
            <input type="hidden" name="old_con_avatar" value="<?php echo $data->con_avatar; ?>">
          </div>
      </div>
      <div class="col-sm-5">
          <div class="label label-danger"><?php echo e($errors->first("con_avatar")); ?></div>
      </div>
    </div>
    <!-- Con_avatar End -->

    

<!-- Con_location Start -->
<div class="form-group">
  <label for="con_location" class="col-sm-3 control-label"> Location <span style="color:red">*</span></label>
  <div class="col-sm-4">
    <textarea class="form-control" id="con_location" name="con_location"><?php echo e($data->con_location); ?></textarea>
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_location")); ?></div>
      </div>
</div> 
<!-- Con_location End -->



<!-- Con_fb_link Start -->
<div class="form-group">
  <label for="con_fb_link" class="col-sm-3 control-label"> Fb Link </label>
  <div class="col-sm-4">
    <input type="text" class="form-control" id="con_fb_link" name="con_fb_link" value="<?php echo e($data->con_fb_link); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_fb_link")); ?></div>
      </div>
</div> 
<!-- Con_fb_link End -->



<!-- Con_linkedin_link Start -->
<div class="form-group">
  <label for="con_linkedin_link" class="col-sm-3 control-label"> Linkedin Link </label>
  <div class="col-sm-4">
    <input type="text" class="form-control" id="con_linkedin_link" name="con_linkedin_link" value="<?php echo e($data->con_linkedin_link); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_linkedin_link")); ?></div>
      </div>
</div> 
<!-- Con_linkedin_link End -->



<!-- Con_login_type Start -->
<!-- <div class="form-group">
  <label for="con_login_type" class="col-sm-3 control-label"> Login Type </label>
  <div class="col-sm-4">
    <input type="text" class="form-control" id="con_login_type" name="con_login_type" value="<?php echo e($data->con_login_type); ?>">
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_login_type")); ?></div>
      </div>
</div>  -->
<!-- Con_login_type End -->


  <!-- gender Start -->
  <div class="form-group">
        <label class="col-sm-3 control-label">Select Gender</label>
        <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" <?php echo $data->con_gender=="1"?'checked="checked"':""; ?> name="con_gender" value="1"> Male </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" <?php echo $data->con_gender=="2"?'checked="checked"':""; ?> name="con_gender" value="2"> Female </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" <?php echo $data->con_gender=="3"?'checked="checked"':""; ?> name="con_gender" value="3"> Other </span>
        </div>
  </div>
  <!-- gender End -->

<!-- Con_describe_profession Start -->

<div class="form-group">
  <label for="con_describe_profession" class="col-sm-3 control-label"> Describe Profession <span style="color:red">*</span></label>
  <div class="col-sm-4">
    <textarea class="form-control" id="con_describe_profession" name="con_describe_profession"><?php echo e($data->con_describe_profession); ?></textarea>
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_describe_profession")); ?></div>
      </div>
</div> 

<!-- Con_describe_profession End -->


<!-- Con_profile_headline Start -->
<div class="form-group">
  <label for="con_profile_headline" class="col-sm-3 control-label"> Profile Headline </label>
  <div class="col-sm-4">
    <textarea class="form-control" id="con_profile_headline" name="con_profile_headline"><?php echo e($data->con_profile_headline); ?></textarea>
  </div>
  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_profile_headline")); ?></div>
      </div>
</div> 
<!-- Con_profile_headline End -->



	<!-- Con_industries Start -->
    <div class="form-group">
        <label for="user_id" class="control-label col-md-3"> Industries <span style="color:red">*</span></label>
          <div class="col-md-4">
          <select id="con_industries" name="con_industries[]" class="form-control select2" multiple>
            <option value="">Select</option>
            <?php
              foreach ($industries as $value) {
                $selected = in_array($value->indu_id,explode(',', $data->con_industries))?'selected="selected"':'';
                echo '<option '.$selected.' value="'.$value->indu_id.'"> '.$value->indu_title.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("con_industries")); ?></div>
      </div>
    </div>
      <!-- Con_industries End -->

    <div class="form-group">
        <label for="functional_area" class="control-label col-md-3"> Functional Area <span style="color:red">*</span></label>
          <div class="col-md-4">
          <select id="functional_area" name="functional_area[]" class="form-control select2" multiple>
            <option value="">Select</option>
            <?php
              foreach ($functional_area as $value) {
                 $selected = in_array($value->fun_id,explode(',', $data->con_functional_area)) ? 'selected="selected"':'';
                echo '<option '.$selected.' value="'.$value->fun_id.'"> '.$value->fun_functional_area.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("functional_area")); ?></div>
      </div>
    </div>

	<!-- Con_status Start -->
	 <div class="form-group">
        <label class="control-label col-md-3">Status</label>                    
         <div class=" col-md-4 switch">
                    <div class="onoffswitch">
     <input type="checkbox" class="onoffswitch-checkbox"  data-on-label="Yes" data-off-label="No"  name="con_status" value="1" id="con_status" <?php if($data->con_status == 1){echo "checked=checked";}?> style="width:20px; height:20px;"/>
                    </div>
                </div>
      </div>
      <!-- Con_status End -->


  <div class="form-group">
  <div class="col-sm-3">
  </div>
   <div class="col-sm-6">
    <button type="reset" class="btn btn-default ">Reset</button>
    <button type="submit" class="btn btn-info ">Update</button>
   </div>
  </div>
</form>
<?php } else{
    echo '<h2 align="center" class="text-danger">No record found!</h2>';
  } ?>
    </div>
  </div>
</div>
<!-- /consultants content -->
<script type="text/javascript">
  function previewImages() 
  { 
      if (this.files) $.each(this.files, readAndPreview);
      
      function readAndPreview(i, file) 
      {
      if (!/\.(jpe?g|png)$/i.test(file.name))
      {
      return alert(file.name +" is not allowed type.");
    } // else...
      // console.log(file.name);
      var reader = new FileReader();
    i=i+1;
      
      $(reader).on("load", function() 
      {
          var name_file=file.name;
          name_file  = name_file.replace(/\s/g, "#");
      var j = $('.field .pip').length;
      j=j+1;
      // console.log(j);
      $('.field').append($("<span id=\"pip"+j+"\" class='pip'>" +
              "<img class=\"imageThumb\" src=\"" + this.result + "\" />" +
              "<br/><span class=\"remove\" onclick='remove(pip"+j+", \"con_avatar\")'>Remove image</span> <input name='avatar' type='hidden' value="+name_file+" readonly>" +"</span>"+
              "</span>"));
      });

    reader.readAsDataURL(file);
      }
    }
    
  $('#con_avatar').on("change", previewImages);

   function remove(span,selector)
   {
      $(span).remove();
      $('#'+selector).val('');
   }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>