<?php $__env->startSection('content'); ?>

    <section  class="inner-page-desh-pd">
        <div class="container">
            <div class="row candidate_search_page">  
                <div class="col-lg-12 col-md-12 col-sm-12 ">
                     <a class="job_alert" href="<?php echo e(url('/')); ?>/addCv/<?php echo e($job->job_id); ?>">Add Cv's </a>
                     <input type="hidden" name="assign_cv" value="<?php echo e(implode(',',$assign_cv)); ?>">
                     <input type="hidden" name="con_wish" value="<?php echo e(implode(',',$con_wish)); ?>">
                </div>
                <div class="col-lg-12 col-md-12 col-sm-12 ">
                    <div class="col-lg-3 col-md-3 col-sm-3 P0">
                        <div class="form-group has-search ">
                            <span class="fa fa-search form-control-feedback"></span>
                            <input type="hidden" name="job_id" value="<?php echo e($job->job_id); ?>">
                            <input type="text" class="form-control" name="search_candidate" placeholder="Search" onkeydown="findCandidate()">
                        </div>
                    </div>
                    <div class="col-lg-9 col-md-9 col-sm-9 PDR0">
                        <div class="col-lg-9 col-md-9 col-sm-7">
                            <div class="job_dis ">Showing 1-11 of <a href="#"><span> 28 Candidates</span></a></div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-5 float-right P0">
                            <div class="clearfix"></div>
                            <form class="form-inline MT10 MB10">
                                <div class="form-group align_flex mb-0">
                                    <label class="justify-content-start mr-2">Sort by : </label>
                                    <div class="short-by">
                                        <select class="form-control" name="sorting" onchange="findCandidate()">
                                            <option value="">Select</option>
                                            <option value="1">Newest</option>
                                            <option value="2">Oldest</option>
                                        </select>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-3 side_nav P0"> 	
                <div class="profile_nav_head">Quick Links</div>
                    <div class="form-group col-md-12 P0 MB0">
                        <label>Qualification</label>
                    </div>
                    <div class="form-group col-md-12 select-border P0">
                        <select class="form-control select2" name="qualification" onchange="findCandidate()">
                            <option value="">Select</option>
                            <?php $__currentLoopData = $education_types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($value->edt_id); ?>" <?php if($job->job_required_degree==$value->edt_id){echo 'selected';}?>><?php echo e($value->edu_type); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="form-group  MB0">
                        <label>Job Type</label>
                    </div>
                    <div class="checkbox">
                        <label><input type="checkbox" class="icheck" name="job_type" value="1" <?php if(in_array('1', explode(',',$job->job_type))){echo "checked";}?>>Permanent</label>
                    </div>
                    <div class="checkbox">
                        <label><input type="checkbox" class="icheck" name="job_type" value="2" <?php if(in_array('2', explode(',',$job->job_type))){echo "checked";}?>>Contractual</label>
                    </div>
	                <div class="form-group col-md-12 P0 MB0">
                        <label>Experience</label>
                    </div>
	                <div class="form-group col-md-12 select-border P0">
                        <select class="form-control select2" name="experience" onchange="findCandidate()">
                            <option value="">Select</option>
                          	<option value="0" <?php if($job->job_experience=='0'){echo 'selected';}?>>Fresher </option>
                           	<option value="1" <?php if($job->job_experience>='1'){echo 'selected';}?>> Less than 1 year</option>
                            <option value="2" <?php if($job->job_experience=='2'){echo 'selected';}?>> 2 Years</option>
                        </select>
                    </div>
                    <div class="form-group col-md-12 P0 MB0">
                        <label>Offered Salary</label>
                    </div>
	                <div class="form-group col-md-12 select-border P0"> 
                        <select class="form-control select2" name="salary" onchange="findCandidate()">
                            <option value="">Select</option>
                            <option value="1">1 - 2 lacs ctc</option>
                          	<option value="2">2 - 3 lacs ctc</option>
                           	<option value="3">3 - 4 lacs ctc</option>
                            <option value="4">4 - 5 lacs ctc</option>
                            <option value="5">5 - 6 lacs ctc</option>
                            <option value="6">6 - 7 lacs ctc</option>
                            <option value="7">7 - 8 lacs ctc</option>
                            <option value="8">8 - 9 lacs ctc</option>
                        </select>
                    </div>               
                    <div class="form-group col-md-12 P0 MB0">
                        <label>Skills</label>
                    </div>
                    <div class="form-group col-md-12 select-border P0">
                        <select class="form-control select2" name="skills" onchange="getVal(this.value,'skills')">
                            <option value="">Select</option>
                            <?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-md-12 col-sm-12 col-xs-12 P0">
                        <p id="collectPetfrndTypes" class="skills">
                            <?php $__currentLoopData = $skills; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if(in_array($value->skills_id, explode(',', $job->job_skills))): ?>
                                <span class='col-md-3 collectPetfrndHtml' data="<?php echo e($value->skills_id); ?>"><?php echo e($value->skills); ?>

                                    <a href='javascript:;' onclick='closeType("<?php echo e($value->skills_id); ?>","skills")'> x </a>
                                <span>
                                <?php endif; ?>    
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>    
                        </p>
                    </div>
                </div>
                <div class="col-lg-9 col-md-9 col-sm-9 PDR0">
                    <div class="row marg0 adcan">
                    <?php if(count($candidates)>0): ?>    
                        <?php $__currentLoopData = $candidates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-lg-12 box_shadow" id="Location_Details">
                    	    <div class="col-lg-2 col-md-2">
                    		    <img class="candidate_search" src="<?php echo e(url('/')); ?>/uploads/candidate_profile/<?php echo e($value->can_avatar); ?>">
                    	    </div>
                       	    <div class="col-lg-7 col-md-7">
                    		    <div class="candidate_heading"><?php echo e($value->can_name); ?></div>
                                <div class="Profile_location MB0"><i class="fa fa-map-marker" aria-hidden="true"></i> <?php echo e($value->city_name); ?>, <?php echo e($value->state_name); ?></div>
                                <div class="Dis_in"> <i class="fa fa-line-chart " aria-hidden="true"></i> <?php echo e(experience($value->diff_exp)); ?> experience</div>
                    		    <div class="filter MR15"><i class="fa fa-filter"></i> <?php echo e($value->designation); ?></div>	
                        	</div>
                            <div class="col-lg-3 col-md-3 col-sm-3 P0">
                                 <div class="col-md-4 P0" data-toggle="modal" data-target="#socialModal">
                                    <span class="job_fav float-left heart_mrg" title="Share"><i class="fa fa-share-alt mrgt" aria-hidden="true"></i></span>
                                </div>
                                <div class="col-md-4 P0">
                                    <span class="job_fav float-right heart_mrg adWish" title="Save for Later" data-id="<?php echo e($value->can_id); ?>">
                                        <i class="fa fa-heart mrgt" <?php if(in_array($value->can_id,$con_wish)): ?> style="color:red;" <?php endif; ?>></i>
                                    </span>
                                </div>
                                <?php if(!in_array($value->can_id,$assign_cv)): ?>
                               <div class="col-md-4 P0">
                                    <span class="job_fav float-left heart_mrg adCv" title="Add Candidate" data-id="<?php echo e($value->can_id); ?>"><i class="fa fa-shopping-bag  mrgt" aria-hidden="true"></i></span>
                                </div>
                                <?php endif; ?> 
                            </div>
                        	<div class="col-lg-12 col-md-12 col-sm-12 P0">
                                <div class="job_time  text-right"><i class="fa fa-clock-o"></i><?php echo e(time_elapsed_string($value->can_created)); ?></div>
                            </div>
            		    </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                        <div class="col-lg-12 box_shadow" id="Location_Details">
                            <center>Candidate Not Found.</center>
                        </div>
                    <?php endif; ?>        
                    </div>
                </div>
            </div>
    </section>

<!--Modal: modalSocial-->
<div class="modal fade" id="socialModal">
  <div class="modal-dialog cascading-modal" role="document">
    <!--Content-->
    <div class="modal-content">
      <!--Header-->
      <div class="modal-header light-blue darken-3 white-text">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class=""><i class="fa fa-users"></i> Spreed the word!</h4>
      </div>
      <!--Body-->
      <div class="modal-body mb-0 text-center">
       <?php echo Share::page(Request::url(), 'Share title')
                    ->facebook()
                    ->twitter()
                    ->linkedin('Extra linkedin summary can be passed here')
                    ->whatsapp();; ?>

      </div>
    </div>
    <!--/.Content-->
  </div>
</div>
<!--Modal: modalSocial-->
<script type="text/javascript" src="<?php echo e(url('/')); ?>/accets/frontend/js/candidate_search.js"></script>    
<?php 
    function time_elapsed_string($datetime, $full = false)
    {

        date_default_timezone_set("Asia/kolkata");

        $now = new DateTime;

        $ago = new DateTime($datetime);

        $diff = $now->diff($ago);


        $diff->w = floor($diff->d / 7);

        $diff->d -= $diff->w * 7;



        $string = array(

            'y' => 'year',

            'm' => 'month',

            'w' => 'week',

            'd' => 'day',

            'h' => 'hour',

            'i' => 'minute',

            's' => 'second',

        );

        foreach ($string as $k => &$v) {

            if ($diff->$k) {

                $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');

            } else {

                unset($string[$k]);

            }

        }

        if (!$full) $string = array_slice($string, 0, 1);


        return $string ? implode(', ', $string) . ' ago' : 'just now';

    }

    function experience($i)
    {
        // $i=7;
        // if(!is_float($i/12)) 
        // {
            $years = floor($i / 12).' Year';
            $years = $years.($years > 1 ? 's' : '');
            if($years == 0) 
            {
                $years = '';
            }
        // }
        $months = ' '.($i % 12).' Month';
        if($months == 0 or $months > 1) 
        {
            $months = $months.'s';
        }

        $display = $years.''.$months;
        
        return $display;

    }

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