<?php $__env->startSection('content'); ?>
<style type="text/css">
  .schoolDiv{display: none;}
</style>
  <!-- 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>Education</h1>

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

 
    <!-- type Start -->
    <div class="form-group">
        <label for="edu_type" class="control-label col-md-3">Education Type <span style="color: red">*</span></label>
          <div class="col-md-4">
          <select id="edu_type" name="edu_type" class="form-control select2" onchange="getCourse(this.value)">
            <option value="">Select Education</option>
            <?php
              foreach ($education_types as $value) {if(!in_array($value->edt_id, $can_edu)){?>
                <option value="<?php echo e($value->edt_id); ?>" <?php echo (old('edu_type')==$value->edt_id)?'selected':'';?>><?php echo e($value->edu_type); ?></option>
            <?php  }}
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger"><?php echo e($errors->first("edu_type")); ?></div>
      </div>
    </div>
      <!-- type End -->


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


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




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


    

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

    <!-- grade_system Start -->
    <div class="form-group">
      <label for="edu_grade_system" class="col-sm-3 control-label"> Grade System </label>
      <div class="col-sm-4">
        <!-- <input type="text" class="form-control" id="edu_grade_system" name="edu_grade_system" value="<?php echo e(old('edu_grade_system')); ?>"> -->
        <select class="form-control" id="edu_grade_system" name="edu_grade_system">
          <option value="">Select Grade System</option>
          <option value='1'> Scale 10 Grading System</option>
          <option value='2'>Scale 4 Grading System</option>
          <option value='3'>% Marks of 100 Maximum</option>
          <option value='4'>Course Requires a Pass</option>
        </select>
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("edu_grade_system")); ?></div>
      </div>
    </div> 
    <!-- grade_system End -->
    </div>

    
    <!-- marks Start -->
    <div class="form-group totalMarksDiv">
      <label for="edu_marks" class="col-sm-3 control-label"> Total Marks <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <input type="text" class="form-control" id="edu_marks" name="edu_marks" value="<?php echo e(old('edu_marks')); ?>">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("edu_marks")); ?></div>
      </div>
    </div> 
    <!-- marks End -->
      <!-- passing_year Start -->
    <div class="form-group">
      <label for="edu_passing_year" class="col-sm-3 control-label"> Passing Year <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <input type="text" class="form-control year" id="edu_passing_year" name="edu_passing_year" value="<?php echo e(old('edu_passing_year')); ?>">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("edu_passing_year")); ?></div>
      </div>
    </div> 
    <!-- passing_year End -->
    <div class="schoolDiv">
    <!-- marks Start -->
    <div class="form-group">
      <label for="edu_school_medium" class="col-sm-3 control-label"> School Medium <span style="color: red">*</span></label>
      <div class="col-sm-4">
        <select class="form-control" id="edu_school_medium" name="edu_school_medium">
          <option value="">Select Medium</option>
          <?php $__currentLoopData = $school_medium; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <option value="<?php echo e($val->sm_id); ?>"><?php echo e($val->sm_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("edu_school_medium")); ?></div>
      </div>
    </div> 
    <!-- marks End -->
    <!-- marks Start -->
    <div class="form-group">
      <label for="edu_eng_marks" class="col-sm-3 control-label">English Marks </label>
      <div class="col-sm-4">
        <input type="text" class="form-control" id="edu_eng_marks" name="edu_eng_marks" value="<?php echo e(old('edu_eng_marks')); ?>">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("edu_eng_marks")); ?></div>
      </div>
    </div> 
    <!-- marks End -->
    <!-- marks Start -->
    <div class="form-group">
      <label for="edu_maths_marks" class="col-sm-3 control-label">Maths Marks </label>
      <div class="col-sm-4">
        <input type="text" class="form-control" id="edu_maths_marks" name="edu_maths_marks" value="<?php echo e(old('edu_maths_marks')); ?>">
      </div>
      <div class="col-sm-5">
      <div class="label label-danger"><?php echo e($errors->first("edu_maths_marks")); ?></div>
      </div>
    </div> 
    <!-- marks End -->
    </div>

    

    <!-- 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="edu_status" value="0" id="edu_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; ?>">
    <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(){
    var edu = $('#edu_type').val(); 
    if(edu)
    {
      getCourse(edu);
    }
  });
  $('#edu_grade_system').change(function(){
    if($(this).val()==4){
      $('.totalMarksDiv').hide();
    }else{
      $('.totalMarksDiv').show();
    }
  });
  // $('#edu_type').change(function(){
  function getCourse(val)
  {
    if(val==4 || val==5){
      $('.specializationDiv').hide();
      $('.schoolDiv').show();
      $('.courseTitle').html('Boards <span style="color: red">*</span>');
    }else{
      $('.schoolDiv').hide();
      $('.specializationDiv').show();
      $('.courseTitle').html('Course <span style="color: red">*</span>');

    }
    $.ajax({
      url: '<?php echo e(url("/")); ?>/admin/getCourse/'+val,
      type:'get',
      success:function(res)
      {
        if(res!=null)
        {
          var opt='<option value="">Select Course</option>'; 
          for (var i =0;i < res.length; i++) 
          {
            opt+='<option value="'+res[i].course_id+'">'+res[i].course_title+'</option>'
          }
          $('#edu_course').html(opt);
        }
      }
    });
  }
  // }); 
  $('#edu_course').change(function()
  {
    $.ajax({
      url: '<?php echo e(url("/")); ?>/admin/getSpecialization/'+$(this).val(),
      type:'get',
      success:function(res)
      {
        var opt=''; 
        if(res!=null)
        {
          opt += '<option value="">Select</option>';
          for (var i =0;i < res.length; i++) 
          {
            opt+='<option value="'+res[i].spe_id+'">'+res[i].spe_title+'</option>'
          }
          $('#edu_specialization').html(opt);
        }
      }
    });
  });
</script>
<?php $__env->stopSection(); ?>


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