<?php $__env->startSection('content'); ?>
  <!-- page content -->
<div class="right_col" role="main">
  <div class="row x_panel">
    <div class="col-md-12 col-sm-12 col-xs-12">
    <h1>Function</h1>

<form action="<?php echo url('/'); ?>/admin/can_desired_career/add/<?php echo $rel_field; ?>/<?php echo $rel_id; ?>" id="" class="form-horizontal " method="post" enctype="multipart/form-data">
<?php echo e(csrf_field()); ?>


    
    <!-- industry Start -->
    <div class="form-group">
        <label for="cdc_industry" class="control-label col-md-3"> Industry <span style="color: red">*</span></label>
          <div class="col-md-4" id="industryOther">
          <select id="cdc_industry" name="cdc_industry" class="form-control select2" >
            <option value="">Select</option>
            <?php
              foreach ($industries as $value) {
                echo '<option value="'.$value->indu_id.'"> '.$value->indu_title.'</option>';
              }
            ?>
            <option value="0">Other</option>
          </select><br><br>
          <input type="text" class="form-control" name="other_cdc_industry" id="otherInd" style="display: none">
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("cdc_industry")); ?></div>
      </div>
    </div>
      <!-- industry End -->


    <!-- functional_area Start -->
    <div class="form-group">
        <label for="cdc_functional_area" class="control-label col-md-3"> Functional Area <span style="color: red">*</span></label>
          <div class="col-md-4" id="functionalOther">
          <select id="cdc_functional_area" name="cdc_functional_area" class="form-control select2" onchange="getRoles(this.value)">
            <option value="">Select</option>
            <?php
              foreach ($functional_areas as $value) {
                echo '<option value="'.$value->fun_id.'"> '.$value->fun_functional_area.'</option>';
              }
            ?>
            <option value="0">Other</option>
          </select><br><br>
          <input type="text" class="form-control" name="other_cdc_functional_area" id="otherFun" style="display: none">
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("cdc_functional_area")); ?></div>
      </div>
    </div>
      <!-- functional_area End -->

  <div class="form-group">
        <label for="cdc_functional_area" class="control-label col-md-3"> Role <span style="color: red">*</span></label>
          <div class="col-md-4" id="roleOther">
          <select id="cdc_sub_functional_area" name="cdc_sub_functional_area" class="form-control select2" >
            <option value="">Select</option>
            <?php /*
              foreach ($sub_functional_areas as $value) {
                echo '<option value="'.$value->sub_id.'"> '.$value->sub_functional_title.'</option>';
              } */
            ?>
            <option value="0">Other</option>
          </select><br><br>
          <input type="text" class="form-control" name="other_roles" id="otherRole" style="display: none">
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("cdc_sub_functional_area")); ?></div>
      </div>
    </div>

 <!-- 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('cdc_job_type') && in_array('1',old('cdc_job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="cdc_job_type[]" value="1" checked> Permanent </span>
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('cdc_job_type') && in_array('2',old('cdc_job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="cdc_job_type[]" value="2"> Contractual </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("cdc_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('cdc_employment_type') && in_array('1',old('cdc_employment_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="cdc_employment_type[]" value="1" checked> Full Time </span>
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('cdc_employment_type') && in_array('2',old('cdc_employment_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="cdc_employment_type[]" value="2"> Part Time </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("cdc_employment_type")); ?></div>
      </div>
    </div>
      <!-- employment_type End -->



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




    <!-- available_to_join_year Start -->
    <div class="form-group">
      <label for="cdc_available_to_join_year" class="col-sm-3 control-label"> Available To Join </label>
      <div class="col-sm-2">
        <input type="text" class="form-control year" id="cdc_available_to_join_year" name="cdc_available_to_join_year" value="<?php echo e(old('cdc_available_to_join_year')); ?>" placeholder="Year">
      </div>
      <div class="col-sm-2">
        <input type="text" class="form-control month" id="cdc_available_to_join_month" name="cdc_available_to_join_month" value="<?php echo e(old('cdc_available_to_join_month')); ?>" placeholder="Month">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("cdc_available_to_join_year")); ?></div>
      <div class="label label-danger"><?php echo e($errors->first("cdc_available_to_join_month")); ?></div>
      </div>
    </div> 
    <!-- available_to_join_year End -->


    

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



 <!-- expected_salary_currency Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label">Expected Salary In Currency</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="cdc_expected_salary_currency" value="1"   <?php if(old('cdc_expected_salary_currency')=='1'): ?> checked <?php endif; ?> checked> Indian Rupees </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="cdc_expected_salary_currency" value="2"   <?php if(old('cdc_expected_salary_currency')=='2'): ?> checked <?php endif; ?> > Us Dollers </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("cdc_expected_salary_currency")); ?></div>
      </div>
    </div>
      <!-- expected_salary_currency End -->

    <!-- <div class="form-group">
      <label for="cdc_current_salary_lac" class="col-sm-3 control-label"> Current Salary </label>
      <div class="col-sm-2">
        <input type="number" class="form-control" id="cdc_current_salary_lac" name="cdc_current_salary_lac" value="<?php echo e(old('cdc_current_salary_lac')); ?>" placeholder="In Lacs">
      </div>
      <div class="col-sm-2">
        <input type="number" class="form-control" id="cdc_current_salary_thousands" name="cdc_current_salary_thousands" value="<?php echo e(old('cdc_current_salary_thousands')); ?>" placeholder="In Thousands">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("cdc_current_salary_lac")); ?></div>
      <div class="label label-danger"><?php echo e($errors->first("cdc_current_salary_thousands")); ?></div>
      </div>
    </div> --> 


    <!-- expected_salary_lac Start -->
    <div class="form-group">
      <label for="cdc_expected_salary_lac" class="col-sm-3 control-label"> Expected Salary </label>
      <div class="col-sm-2">
        <input type="number" class="form-control" id="cdc_expected_salary_lac" name="cdc_expected_salary_lac" value="<?php echo e(old('cdc_expected_salary_lac')); ?>" placeholder="In Lacs">
      </div>
      <div class="col-sm-2">
        <input type="number" class="form-control" id="cdc_expected_salary_thousands" name="cdc_expected_salary_thousands" value="<?php echo e(old('cdc_expected_salary_thousands')); ?>" placeholder="In Thousands">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("cdc_expected_salary_lac")); ?></div>
      <div class="label label-danger"><?php echo e($errors->first("cdc_expected_salary_thousands")); ?></div>
      </div>
    </div> 
    <!-- expected_salary_lac End -->


    
    <!-- desired_location Start -->
    <div class="form-group">
        <label for="cdc_desired_location" class="control-label col-md-3"> Desired Location </label>
          <div class="col-md-4">
          <select id="cdc_desired_location" name="cdc_desired_location[]" class="form-control select2" multiple="multiple">
            <?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("cdc_desired_location")); ?></div>
      </div>
    </div>
      <!-- desired_location 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" checked data-on-label="Yes" data-off-label="No"  name="cdc_status" value="1" id="cdc_status" <?php echo 1; ?> style="width:20px; height:20px;"/>
    <?php echo e($errors->first("cdc_status")); ?>

                        <label class="onoffswitch-label" for="cdc_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; ?>">
    <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 getRoles(id)
  {
    var selectedText = $('#cdc_functional_area').val();
    // console.log(selectedText);
    if(selectedText!=null && selectedText.includes('0'))
    {
      $('#otherFun').show();
    }else{
      $('#otherFun').hide();
    }

    $.ajax({
      type:"post",
      url:"<?php echo e(url('/')); ?>/admin/getRoles",
      data:{'_token':'<?php echo e(csrf_token()); ?>','fun_id':id},
      dataType:'json',
      success:function(res)
      {
        // console.log(res);
        var sub = '';
        sub += '<option value="">Select</option>';
        if(res.length>0)
        {
          for(var i=0;i<res.length;i++)
          {
            sub += '<option value='+res[i].sub_id+'>'+res[i].sub_functional_title+'</option>';
          }
        }
        sub += '<option value="0">Other</option>';

        $('#cdc_sub_functional_area').html(sub);
      }
    });
  }

  $('#cdc_industry').change(function(){
    var selectedText = $(this).val();
    // console.log(selectedText);
    if(selectedText!=null && selectedText.includes('0'))
    {
      $('#otherInd').show();
    }else{
      $('#otherInd').hide();
    }
  });

  $('#cdc_sub_functional_area').change(function(){
    var selectedText = $(this).val();
    // console.log(selectedText);
    if(selectedText!=null && selectedText.includes('0'))
    {
      $('#otherRole').show();
    }else{
      $('#otherRole').hide();
    }
  });
</script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>