<?php $__env->startSection('content'); ?>
  <!-- page 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>Add Candidates</h1>
<?php if($rel_field!='admin' && $rel_field!='candidates'){$url = url('/')."/admin/candidates/add/".$rel_field."/".$rel_id."/".$job_id;}else{$url = url('/')."/admin/candidates/add";}?>  
<form action="<?php echo $url; ?>" id="" class="form-horizontal " method="post" enctype="multipart/form-data">
<?php echo e(csrf_field()); ?>


    


	<!-- name Start -->
	<div class="form-group">
	  <label for="can_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="can_name" name="can_name" value="<?php echo e(old('can_name')); ?>">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_name")); ?></div>
      </div>
	</div> 
	<!-- name End -->


	


	<?php /*<!-- slug Start -->
	<div class="form-group">
	  <label for="can_slug" class="col-sm-3 control-label"> slug </label>
	  <div class="col-sm-4">
	    <input type="text" class="form-control" id="can_slug" name="can_slug" 
	    value="{{ old('can_slug') }}">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger">{{ $errors->first("can_slug") }}</div>
      </div>
	</div> 
	<!-- slug End --> 
	<!-- password Start -->
	<div class="form-group">
	  <label for="can_password" class="col-sm-3 control-label"> password </label>
	  <div class="col-sm-4">
	    <input type="text" class="form-control" id="can_password" name="can_password" 
	    value="{{ old('can_password') }}">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger">{{ $errors->first("can_password") }}</div>
      </div>
	</div> 
	<!-- password End -->
	*/ ?>


	


	<!-- email Start -->
	<div class="form-group">
	  <label for="can_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="can_email" name="can_email" value="<?php echo e(old('can_email')); ?>">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_email")); ?></div>
      </div>
	</div> 
	<!-- email End -->
	


	<!-- mobile Start -->
	<div class="form-group">
	  <label for="can_mobile" 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="can_mobile" name="can_mobile" value="<?php echo e(old('can_mobile')); ?>" 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("can_mobile")); ?></div>
      </div>
	</div> 
	<!-- mobile End -->


	

    <!-- avatar Start -->
    <div class="form-group">
      <label for="address" class="col-sm-3 control-label"> Profile Picture </label>
      <div class="col-sm-4">
      <input type="file" name="can_avatar" id="can_avatar" class="form-control" />
      <input type="hidden" name="old_can_avatar" value="<?php if (isset($can_avatar) && $can_avatar!=""){echo $can_avatar; } ?>" />
        <?php if(isset($can_avatar_err) && !empty($can_avatar_err)) 
        { foreach($can_avatar_err as $key => $error)
        { echo "<div class=\"error-msg\"></div>"; } }?>
        <div class="field" align="left"></div>
      </div>
      <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_avatar")); ?></div>
      </div>
    </div>
    <!-- avatar End -->

    
	<!-- current_location Start -->
    <div class="form-group">
        <label for="can_current_location" class="control-label col-md-3"> Current Location <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="can_current_location" name="can_current_location" class="form-control select2">
            <option value="">Select</option>
            <?php
              foreach ($cities as $value) {
                echo '<option value="'.$value->id.'"> '.$value->name.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_current_location")); ?></div>
      </div>
    </div>
      <!-- current_location End -->



    <!-- resume Start -->
    <div class="form-group">
      <label for="address" class="col-sm-3 control-label"> Resume </label>
      <div class="col-sm-4">
      <input type="file" name="can_resume" id="can_resume" class="form-control" />
      <input type="hidden" name="old_can_resume" value="<?php if (isset($can_resume) && $can_resume!=""){echo $can_resume; } ?>" />
        <?php if(isset($can_resume_err) && !empty($can_resume_err)) 
        { foreach($can_resume_err as $key => $error)
        { echo "<div class=\"error-msg\"></div>"; } }?>
      </div>
        <div class="col-sm-3" >
      </div>
      <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_resume")); ?></div>
      </div>
    </div>
    <!-- resume End -->

    


	<!-- key_skills Start -->
	<div class="form-group">
	  <label for="can_key_skills" class="col-sm-3 control-label"> Key Skills <span style="color: red">*</span></label>
	  <div class="col-sm-4">
      <select id="can_key_skills" name="can_key_skills[]" class="form-control select2" multiple>
            <?php
              foreach ($skills as $value) {
                echo '<option value="'.$value->skills_id.'"> '.$value->skills.'</option>';
              }
            ?>
          </select>
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_key_skills")); ?></div>
      </div>
	</div> 
	<!-- key_skills End -->

<div class="form-group">
    <label class="col-sm-3 control-label">Work Experience</label>
    <div class="col-sm-2">
        <input type="number" class="form-control" name="can_experience_year" id="can_experience_year" value="" placeholder="In Years">
    </div>
    <div class="col-sm-2">
        <input type="number" class="form-control" name="can_experience_month" id="can_experience_month" value="" placeholder="In Month">
    </div>
</div>

	

 <!-- gender Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label"> Gender</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="can_gender" value="1"   <?php if(old('can_gender')=='1'): ?> checked <?php endif; ?> checked> Male </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="can_gender" value="2"   <?php if(old('can_gender')=='2'): ?> checked <?php endif; ?> > Female </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="can_gender" value="3"   <?php if(old('can_gender')=='3'): ?> checked <?php endif; ?> > Other </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_gender")); ?></div>
      </div>
    </div>
      <!-- gender End -->




	<!-- profession Start -->
	<div class="form-group">
	  <label for="can_profession" class="col-sm-3 control-label"> Profession </label>
	  <div class="col-sm-4">
	    <input type="text" class="form-control" id="can_profession" name="can_profession"  value="<?php echo e(old('can_profession')); ?>">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_profession")); ?></div>
      </div>
	</div> 
	<!-- profession End -->


	
	<!-- desired_location Start -->
    <!-- <div class="form-group">
        <label for="can_desired_location" class="control-label col-md-3"> Desired Location </label>
          <div class="col-md-4">
          <select id="can_desired_location" name="can_desired_location" class="form-control select2">
            <?php
              foreach ($cities as $value) {
                echo '<option value="'.$value->id.'"> '.$value->name.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_desired_location")); ?></div>
      </div>
    </div> -->
      <!-- desired_location End -->



 <!-- job_type Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label"> Job Type</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('can_job_type') && in_array('1',old('can_job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="can_job_type[]" value="1"> Permanent </span>
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('can_job_type') && in_array('2',old('can_job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="can_job_type[]" value="2"> Contractual </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_job_type")); ?></div>
      </div>
    </div>
      <!-- job_type End -->



 <!-- employment_type Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label"> Employment Type</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('can_employment_type') && in_array('1',old('can_employment_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="can_employment_type[]" value="1"> Part Time </span>
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('can_employment_type') && in_array('2',old('can_employment_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="can_employment_type[]" value="2"> Full Time </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_employment_type")); ?></div>
      </div>
    </div>
      <!-- employment_type End -->
	

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

			

	<!-- dob Start -->
	<div class="form-group">
	  <label for="can_dob" class="col-sm-3 control-label"> DOB </label>
	  <div class="col-sm-4">
	    <input type="text" class="form-control span2 date" id="can_dob" name="can_dob" value="<?php echo e(old('can_dob')); ?>">
	  </div>
	  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_dob")); ?></div>
      </div>
	</div> 
	<!-- dob End -->

	

 <!-- marrital_status Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label">Select Marrital Status</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="can_marrital_status" value="1"   <?php if(old('can_marrital_status')=='1'): ?> checked <?php endif; ?> > Married </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="can_marrital_status" value="2"   <?php if(old('can_marrital_status')=='2'): ?> checked <?php endif; ?> checked> Unmarried </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("can_marrital_status")); ?></div>
      </div>
    </div>
      <!-- marrital_status End -->



				<!-- address Start -->
			<div class="form-group">
			  <label for="can_address" class="col-sm-3 control-label"> Address <span style="color: red">*</span></label>
			  <div class="col-sm-4">
			    <textarea class="form-control" id="can_address" name="can_address"><?php echo e(old('can_address')); ?></textarea>
			  </div>
			  <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_address")); ?></div>
      </div>
			</div> 
			<!-- address End -->
  
  <!-- state Start -->
    <div class="form-group">
        <label for="can_state" class="control-label col-md-3"> State <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="can_state" name="can_state" class="form-control select2" onchange="getCity(this.value)">
             <option value="">Select</option>
            <?php
              foreach ($states as $value) {
                echo '<option value="'.$value->id.'"> '.$value->name.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_state")); ?></div>
      </div>
    </div>
      <!-- state End -->
			
	<!-- city Start -->
    <div class="form-group">
        <label for="can_city" class="control-label col-md-3"> City <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="can_city" name="can_city" class="form-control select2">
             <option value="">Select</option>
            <?php /*
              foreach ($cities as $value) {
                echo '<option value="'.$value->id.'"> '.$value->name.'</option>';
              } */
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("can_city")); ?></div>
      </div>
    </div>
      <!-- city End -->


	<!-- pin Start -->
	<div class="form-group">
	  <label for="can_pin" class="col-sm-3 control-label"> Pincode <span style="color: red">*</span></label>
	  <div class="col-sm-4">
	    <input type="number" class="form-control" id="can_pin" name="can_pin" value="<?php echo e(old('can_pin')); ?>" onkeydown="if(this.value.length==6 && event.keyCode!=8 && event.keyCode!=9) return false;">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_pin")); ?></div>
      </div>
	</div> 
	<!-- pin End -->


	


	<!-- languages Start -->
	<div class="form-group">
	  <label for="can_languages" class="col-sm-3 control-label"> Languages </label>
	  <div class="col-sm-4">
	    <input type="text" class="form-control" id="can_languages" name="can_languages" value="<?php echo e(old('can_languages')); ?>">
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_languages")); ?></div>
      </div>
	</div> 
	<!-- languages End -->

  <div class="form-group">
    <label for="can_fb_link" class="col-sm-3 control-label"> Facebook Link </label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="can_fb_link" name="can_fb_link" value="<?php echo e(old('can_fb_link')); ?>">
    </div>
    <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_fb_link")); ?></div>
      </div>
  </div> 

  <div class="form-group">
    <label for="can_linkedin_link" class="col-sm-3 control-label"> LinkedIn Link </label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="can_linkedin_link" name="can_linkedin_link" value="<?php echo e(old('can_linkedin_link')); ?>">
    </div>
    <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_linkedin_link")); ?></div>
      </div>
  </div> 

  <div class="form-group">
    <label for="can_instagram_link" class="col-sm-3 control-label"> Instagram Link </label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="can_instagram_link" name="can_instagram_link" value="<?php echo e(old('can_instagram_link')); ?>">
    </div>
    <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_instagram_link")); ?></div>
      </div>
  </div> 

  <div class="form-group">
    <label for="can_behance_link" class="col-sm-3 control-label"> Behance Link </label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="can_behance_link" name="can_behance_link" value="<?php echo e(old('can_behance_link')); ?>">
    </div>
    <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_behance_link")); ?></div>
      </div>
  </div> 
	


	<!-- cast_category Start -->
	<div class="form-group">
	  <label for="can_cast_category" class="col-sm-3 control-label"> Cast Category </label>
	  <div class="col-sm-4">
      <select class="form-control" id="can_cast_category" name="can_cast_category">
        <option value="">Select</option>
        <option value="General">General</option>
        <option value="SC">SC</option>
        <option value="ST">ST</option>
        <option value="OBC">OBC</option>
        <option value="Other">Other</option>
      </select>
	  </div>
	  <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("can_cast_category")); ?></div>
      </div>
	</div> 
	<!-- cast_category End -->


	

	<!-- 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="status" value="0" id="status"  style="width:20px; height:20px;"/>
    <?php echo e($errors->first("status")); ?>

                        <label class="onoffswitch-label" for="status">
                            <span class="onoffswitch-switch"></span>
                            <span class="onoffswitch-inner"></span>
                        </label>
                    </div>
                </div>

      </div>
      <!-- Status End -->



  <div class="form-group">
    <div class="col-sm-3" >
      </div>
      <div class="col-sm-6">
    <input type="hidden" name="rel_field" id="rel_field" value="<?php echo $rel_field; ?>">
    <input type="hidden" name="rel_id" id="rel_id" value="<?php echo $rel_id; ?>">
    <input type="hidden" name="job_id" id="job_id" value="<?php echo $job_id; ?>">
    <button type="reset" class="btn btn-default ">Reset</button>
    <button type="submit" class="btn btn-info ">Submit</button>
      </div>
        <div class="col-sm-3" >
      </div>
  </div>
</form>



    </div>
  </div>
</div>
<!-- /page content -->
<script type="text/javascript">
  function getCity(id)
  {
    $.ajax({
      type:"post",
      url:"<?php echo e(url('/')); ?>/admin/getCity",
      data:{"_token":"<?php echo e(csrf_token()); ?>",'state_id':id},
      dataType:"json",
      success:function(res)
      {
        console.log(res);
        var city = ''
        if(res.length>0)
        {
          city += '<option value="">Select</option>';
          for(var i=0;i<res.length;i++)
          {
            city += '<option value="'+res[i].id+'">'+res[i].name+'</option>';
          }
        }
        $('#can_city').html(city);
      }
     });
  }

  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+", \"can_avatar\")'>Remove image</span> <input name='banner_image' type='hidden' value="+name_file+" readonly>" +"</span>"+
              "</span>"));
      });

    reader.readAsDataURL(file);
      }
    }
    
  $('#can_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(); ?>