<?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>Walk In Interview</h1>

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


    

    <!-- Wi_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="wi_banner_image" id="wi_banner_image" class="form-control" />
      <input type="hidden" name="old_wi_banner_image" value="<?php if (isset($wi_banner_image) && $wi_banner_image!=""){echo $wi_banner_image; } ?>" />
        <?php if(isset($wi_banner_image_err) && !empty($wi_banner_image_err)) 
        { foreach($wi_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("wi_banner_image")); ?></div>
      </div>
    </div>
    <!-- Wi_banner_image End -->

    


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


    

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

            


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


    

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

    

    <!-- Wi_time Start -->
    <div class="form-group">
        <label for="wi_time" class="control-label col-md-3"> Time <span style="color: red">*</span></label>
          <div class="col-md-4">
            <input type="time" autocomplete="off" class="form-control timepicker" id="wi_time" name="wi_time" value="<?php echo e(old('wi_time')); ?>" >
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("wi_time")); ?></div>
      </div>
    </div>
    <!-- Wi_time End -->

    

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

            
    <div class="form-group">
      <label for="wi_functional_area" class="col-sm-3 control-label"> Functional Area <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <select class="form-control select2" id="wi_functional_area" name="wi_functional_area" onchange="getRoles(this.value)">
          <option value="">Select</option>
          <?php $__currentLoopData = $functional_area; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <option value="<?php echo e($value->fun_id); ?>" <?php if(old('wi_functional_area')==$value->fun_id){echo 'selected';}?>><?php echo e($value->fun_functional_area); ?></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("wi_functional_area")); ?></div>
      </div>
    </div>         

    <!-- Wi_role Start -->
    <div class="form-group">
      <label for="wi_role" class="col-sm-3 control-label"> Role <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <select class="form-control select2" id="wi_role" name="wi_role">
          <option value="">Select</option>
          <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <option value="<?php echo e($role->sub_id); ?>" <?php if(old('wi_role')==$role->sub_id){echo 'selected';}?>><?php echo e($role->sub_functional_title); ?></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("wi_role")); ?></div>
      </div>
    </div> 
    <!-- Wi_role End -->


    

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

            

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

            

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

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

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

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

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

   function getRoles(id)
   {
     $.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)
      {
        var role = '';
        if(res.length>0)
        {
          role += '<option value="">Select</option>';
          for(var i=0;i<res.length;i++)
          {
            role += '<option value='+res[i].sub_id+'>'+res[i].sub_functional_title+'</option>';
          }
        }
        $('#wi_role').html(role);
      }
     });
   }
</script>
<?php $__env->stopSection(); ?>


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