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

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


    


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


    


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


    
    
 <!-- Project_status Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label">Project Status</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_status" value="1"   <?php if(old('project_status')=='1'): ?> checked <?php endif; ?> checked onclick="checkRadio()"> In Progress </span>
            <span style="margin-right:20px;" onclick="checkRadio()"><input type="radio" style="width:20px; height:20px;" name="project_status" value="2"   <?php if(old('project_status')=='2'): ?> checked <?php endif; ?> > Finished </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_status")); ?></div>
      </div>
    </div>
      <!-- Project_status End -->



    <!-- Project_work_from_year Start -->
    <div class="form-group">
      <label for="project_work_from_year" class="col-sm-3 control-label"> Working From <span style="color: red">*</span></label>
      <div class="col-sm-2">
        <input type="text" class="form-control year" id="project_work_from_year" name="project_work_from_year" value="<?php echo e(old('project_work_from_year')); ?>" placeholder="Year">
      </div>
      <div class="col-sm-2">
        <input type="text" class="form-control month" id="project_work_from_month" name="project_work_from_month" value="<?php echo e(old('project_work_from_month')); ?>" placeholder="Month">
      </div>
      <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_work_from_year")); ?></div>
        <div class="label label-danger"><?php echo e($errors->first("project_work_from_month")); ?></div>
      </div>
    </div> 
    <!-- Project_work_from_year End -->



    <!-- Project_work_till_year Start -->
    <div class="form-group">
      <label for="project_work_till_year" class="col-sm-3 control-label"> Working Till <span style="color: red">*</span></label>
      <div class="col-sm-4" id="pdiv">
        <input type="text" class="form-control" id="project_work_till" name="project_work_till" value="Present" readonly style="background-color: #fff;">
      </div>
      <div id="radioDiv" style="display: none;">
        <div class="col-sm-2">
          <input type="text" class="form-control year" id="project_work_till_year" name="project_work_till_year" value="<?php echo e(old('project_work_till_year')); ?>" placeholder="Year">
        </div>
        <div class="col-sm-2">
          <input type="text" class="form-control month" id="project_work_till_month" name="project_work_till_month" value="<?php echo e(old('project_work_till_month')); ?>" placeholder="Month">
        </div>
      </div>
      <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_work_till_year")); ?></div>
        <div class="label label-danger"><?php echo e($errors->first("project_work_till_month")); ?></div>
      </div>
    </div> 
    <!-- Project_work_till_year End -->

    

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


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


    

 <!-- Project_site Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label">Project Site</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_site" value="0"   <?php if(old('project_site')=='0'): ?> checked <?php endif; ?> checked> Off Site </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_site" value="1"   <?php if(old('project_site')=='1'): ?> checked <?php endif; ?> > On Site </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_site")); ?></div>
      </div>
    </div>
      <!-- Project_site End -->



 <!-- Project_emp_nature Start -->
 <div class="form-group">
          <label class="col-sm-3 control-label">Nature Of Employee</label>
          <div class="col-sm-4">
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_emp_nature" value="1"   <?php if(old('project_emp_nature')=='1'): ?> checked <?php endif; ?> checked> Full Time </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_emp_nature" value="2"   <?php if(old('project_emp_nature')=='2'): ?> checked <?php endif; ?> > Part Time </span>
            <span style="margin-right:20px;"><input type="radio" style="width:20px; height:20px;" name="project_emp_nature" value="3"   <?php if(old('project_emp_nature')=='3'): ?> checked <?php endif; ?> > Contractual </span>
        </div>
        <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_emp_nature")); ?></div>
      </div>
    </div>
      <!-- Project_emp_nature End -->




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


    
    <!-- Project_role Start -->
    <div class="form-group">
        <label for="project_role" class="control-label col-md-3"> Role </label>
          <div class="col-md-4" id="roleOther">
          <select id="project_role" name="project_role" class="form-control select2">
            <option value="">Select</option>
            <?php
              foreach ($project_roles as $value) {
                echo '<option value="'.$value->pr_id.'"> '.$value->role.'</option>';
              }
            ?>
            <option value="0">Other</option>
          </select><br><br>
          <input type="text" class="form-control" name="other_project_role" id="otherRole" style="display: none">
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("project_role")); ?></div>
      </div>
    </div>
      <!-- Project_role End -->



  <!-- Project_role_description Start -->
    <div class="form-group">
      <label for="project_role_description" class="col-sm-3 control-label"> Role Description </label>
      <div class="col-sm-4">
        <textarea class="form-control" id="project_role_description" name="project_role_description" minlength="100"><?php echo e(old('project_role_description')); ?></textarea>
      </div>
      <div class="col-sm-5">
        <div class="label label-danger"><?php echo e($errors->first("project_role_description")); ?></div>
      </div>
    </div> 
  <!-- Project_role_description End -->

            


    <!-- Project_skill_used Start -->
    <div class="form-group">
      <label for="project_skill_used" class="col-sm-3 control-label"> Skill Used </label>
      <div class="col-sm-4">
        <select class="form-control select2" id="project_skill_used" name="project_skill_used" multiple>
          <?php $__currentLoopData = $skills; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
           <option value="<?php echo e($value->skills_id); ?>"><?php echo e($value->skills); ?></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("project_skill_used")); ?></div>
      </div>
    </div> 
    <!-- Project_skill_used 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="status" value="1" id="status" <?php echo 1; ?> 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; ?>">
    <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">
  $(document).ready(function(){
   checkRadio();
  });

  function checkRadio()
  {
    var radio = $('input[name="project_status"]:checked').val();
    if(radio==1)
    {
      $('#pdiv').show();
      $('#radioDiv').hide();
    }
    else
    {
      $('#pdiv').hide();
      $('#radioDiv').show();
    }
  }

  $('#project_role').change(function(){
    var textbox = '';
    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(); ?>