<?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>Jobs</h1>

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


    

    <!-- Job_banner_image Start -->
    <div class="form-group">
      <label for="address" class="col-sm-3 control-label"> Banner Image </label>
      <div class="col-sm-4">
      <input type="file" name="job_banner_image" id="job_banner_image" class="form-control" />
      <input type="hidden" name="old_job_banner_image" value="<?php if (isset($job_banner_image) && $job_banner_image!=""){echo $job_banner_image; } ?>" />
        <?php if(isset($job_banner_image_err) && !empty($job_banner_image_err)) 
        { foreach($job_banner_image_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("job_banner_image")); ?></div>
      </div>
    </div>
    <!-- Job_banner_image End -->

    
    <div class="form-group">
      <label for="company" class="col-sm-3 control-label">Company <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <input type="text" class="form-control" id="company" name="company" value="<?php if($rel_field=='job_company'){echo $company[0]->comp_name;}else{echo old('company');}?>">  
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("company")); ?></div>
      </div>
    </div> 

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


    

        <!-- Job_description Start -->
    <div class="form-group">
      <label for="job_description" class="col-sm-3 control-label"> Description <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <textarea class="form-control" id="job_description" name="job_description" minlength="100"><?php echo e(old('job_description')); ?></textarea>
      </div>
      <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("job_description")); ?></div>
      </div>
    </div> 
            <!-- Job_description End -->

            
    <!-- Job_skills Start -->
    <div class="form-group">
        <label for="job_skills" class="control-label col-md-3"> Skills </label>
          <div class="col-md-4">
          <select id="job_skills" name="job_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("job_skills")); ?></div>
      </div>
    </div>
      <!-- Job_skills End -->




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



    <!-- state Start -->
    <div class="form-group">
        <label for="job_state" class="control-label col-md-3"> State <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="job_state" name="job_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("job_state")); ?></div>
      </div>
    </div>
      <!-- state End -->



   <!-- city Start -->
    <div class="form-group">
        <label for="job_city" class="control-label col-md-3"> City <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="job_city" name="job_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("job_city")); ?></div>
      </div>
    </div>
      <!-- city End -->
    


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


    


    <!-- Job_carrer_level Start -->
    <div class="form-group">
      <label for="job_carrer_level" class="col-sm-3 control-label"> Career Level <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <select class="form-control" id="job_carrer_level" name="job_carrer_level">
          <option value="">Select</option>
          <option value="1" <?php echo (old('job_carrer_level')=='1')?'selected':'';?>>Department Head</option>
          <option value="2" <?php echo (old('job_carrer_level')=='2')?'selected':'';?>>Entry Level</option>
          <option value="3" <?php echo (old('job_carrer_level')=='3')?'selected':'';?>>Experienced Professional</option>
          <option value="4" <?php echo (old('job_carrer_level')=='4')?'selected':'';?>>GM / CEO / Country Head / President</option>
          <option value="5" <?php echo (old('job_carrer_level')=='5')?'selected':'';?>>Intern/Student</option>
        </select>
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("job_carrer_level")); ?></div>
      </div>
    </div> 
    <!-- Job_carrer_level End -->


    


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


    


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


    


    <!-- Job_salary_period Start -->
    <div class="form-group">
      <label for="job_salary_period" class="col-sm-3 control-label"> Salary Period </label>
      <div class="col-sm-4">
        <select class="form-control" id="job_salary_period" name="job_salary_period">
          <option value="">Select</option>
          <option value="1" <?php echo (old('job_salary_period')=='1')?'selected':'';?>>Weekly</option>
          <option value="2" <?php echo (old('job_salary_period')=='2')?'selected':'';?>>Monthly</option>
          <option value="3" <?php echo (old('job_salary_period')=='3')?'selected':'';?>>Yearly</option>
        </select>
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("job_salary_period")); ?></div>
      </div>
    </div> 
    <!-- Job_salary_period End -->


    
    <!-- Job_functional_area Start -->
    <div class="form-group">
        <label for="job_functional_area" class="control-label col-md-3"> Functional Area <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="job_functional_area" name="job_functional_area" class="form-control select2">
            <option value="">Select</option>
            <?php
              foreach ($functional_areas as $value) {
                echo '<option 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("job_functional_area")); ?></div>
      </div>
    </div>
      <!-- Job_functional_area 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('job_type') && in_array('1',old('job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="job_type[]" value="1"> Permanent </span>
            <span style="margin-right:20px;"><input type="checkbox"  <?php if(null !==old('job_type') && in_array('2',old('job_type'))): ?> checked <?php endif; ?> style="width:20px; height:20px;" name="job_type[]" value="2"> Contractual </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("job_type")); ?></div>
      </div>
    </div>
      <!-- job_type End -->


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


    


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




     <!-- 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="job_gender" value="1"   <?php if(old('job_gender')=='1'): ?> checked <?php endif; ?> checked> Male </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="job_gender" value="2"   <?php if(old('job_gender')=='2'): ?> checked <?php endif; ?> > Female </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="job_gender" value="3"   <?php if(old('job_gender')=='3'): ?> checked <?php endif; ?> > Both </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("job_gender")); ?></div>
      </div>
    </div>
      <!-- gender End -->


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


    


    <!-- Job_required_degree Start -->
    <div class="form-group">
      <label for="job_required_degree" class="col-sm-3 control-label"> Required Degree </label>
      <div class="col-sm-4">
        <select class="form-control" id="job_required_degree" name="job_required_degree">
           <option value="">Select</option>
          <?php $__currentLoopData = $degree; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
           <option value="<?php echo e($value->edt_id); ?>" <?php echo (old('job_required_degree')==$value->edt_id)?'selected':'';?>><?php echo e($value->edu_type); ?></option>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("job_required_degree")); ?></div>
      </div>
    </div> 
    <!-- Job_required_degree End -->


    


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


    

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

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

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

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

   function remove(span,selector)
   {
      $(span).remove();
      $('#'+selector).val('');
   }

   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>';
          }
        }
        $('#job_city').html(city);
      }
     });
   }
</script>
<?php $__env->stopSection(); ?>


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