<?php $this->load->view('header_front');
//code for to get web logo
$candidate_id=$this->session->userdata('user_id');
error_reporting(0);
?>
<div class="container main-content">
<?php
											//echo $search_string;
											/****************************************************************************/
											if (count($joblist) == 0) //if array size is null, no jobs exist
											{

												if ($search_string == '')
												{?>
													<div><label style="text-align:center; padding-top: 10px; color:#cd0329">There are no vacancies available for "<?php if($search_string!=''){ echo $search_string ;}
															else{ echo "this search";}
															?>"</label></div>
												<?php }
												else
												{?>
													<div><label style="text-align:center; padding-top: 10px; color:#cd0329">There are no vacancies available for "<?php echo $search_string ?>"</label></div>
												<?php }
											}
											/****************************************************************************/
											foreach($joblist as $val)
											{
												$currency_value=$val->currency;
												 if($val->perday==1)
												{
												$perday='Per Day';
												}
												if($val->perday==2)
												{
												$perday='Per Week';
												}
												if($val->perday==3)
												{
												$perday='Per Annum';
												}
												$this->db->where('skill_id',$currency_value);
												$querycurrency=$this->db->get('currency');
												$resultscurrency = $querycurrency->result();
												foreach ($resultscurrency as $rowcurrency)
												{
												$currency=$rowcurrency->skill_code;
												}
//code fot to counter job view
							 $query_frocouner=mysql_query("insert into jobview_counters set job_id='".$val->job_id."',
																						date='".date("Y/m/d")."'");
												?>
  <div class="row">
    <meta itemprop="url">
    <div class="col-xs-12">
      <div id="jobad" class="row job-page" data-job-id="628773">
        <div class="col-xs-12 col-sm-7 col-md-8">
          <meta itemprop="name" content="<?php echo $val->job_title; ?>">
          <div>
            <h1 class="job-title"><?php echo $val->job_title; ?></h1>
            <div class="row">
              <div class="col-xs-8 col-sm-8 job-info">
                <ul class="list-unstyled">
<li><span class="glyphicon glyphicon-map-marker"></span>&nbsp; <span class="text-gray hidden-xs">Location: </span> <?php
echo $val->job_location_id."-".$val->city;

?></li>
                  <li><span class="glyphicon glyphicon-tags"></span>&nbsp; <span class="text-gray hidden-xs">Job Types: </span> <?php
															if($val->job_type!=0)
															{?>
												 <?php if($val->job_type==5){ echo "Full Time";}?>
								                 <?php if($val->job_type==4){ echo "Part Time";}?>
												 <?php if($val->job_type==2){ echo "Contract";}?>
												 <?php if($val->job_type==3){ echo "Temporary";}?>
												   <?php if($val->job_type==7){ echo "Permanent";}?>
												 <?php if($val->job_type==1){ echo "Volunteer";}?>
																<?php if($val->job_type==6){ echo "Other";}?>
												 <?php }?> </li>
                  <li><span class="glyphicon glyphicon-calendar"></span>&nbsp; <span class="text-gray hidden-xs">Timing/Shifts: </span>
				   <?php 

if($val->job_shift==1 && $val->job_shift!=0)
{
echo "First Shift (Day)";
}
if($val->job_shift==2 && $val->job_shift!=0)
{
echo "Night Shift (Night)";
}
?>
				   </li>
                </ul>
              </div>
              <div class="col-xs-4 col-sm-4 job-salary">
                <p><span class="salmin" style="font-size:14px;margin-top: 17px;"><?php echo 'From:'.' '.$currency.' '.$val->job_salary_from.' ,'.' '.'To:'.' '.$currency.' '.$val->job_salary_to.' '.$perday;?></p>
              </div>
            </div>
            <br>
            <div class="job-desc"><?php echo $val->job_des;?><br>
              <br>
              <strong>LOCATION:</strong><br>
              
<li><span class="glyphicon glyphicon-map-marker"></span>&nbsp; <span class="text-gray hidden-xs">Location: </span> <?php

echo $val->city;?><br>
              </div>
            <div class="mobile-info visible-xs">
              <hr>
              <h4>About the Employer</h4>
              <div class="coy-info">
                <div class="row no-gutter">
                  <div class="col-xs-3">
                    <div class="coylogo-holder">
                      <div><?php 
			if($val->comapny_image!='')
			{?>
			<img src="<?php echo base_url();?>assets/upload/<?=$val->comapny_image;?>" alt="<?php echo $val->company_name; ?>"  class="img-coylogo img-responsive">
			<?php }
			else
			{?>
			<img src="<?php echo base_url();?>assets_front/images/logoweb.png" alt="<?php echo $val->company_name; ?>"  class="img-coylogo img-responsive">
			<?php }
			?></div>
                    </div>
                  </div>
                  <div class="col-xs-9"><strong><?php echo $val->company_name; ?></strong>
                  </div>
                </div>
              </div>
              <br>
              <hr>
              <h4>Share this to your friends</h4>
              <div class="addthis_inline_share_toolbox"><a href="<?php echo base_url();?>front_end/sendemail?job_id=<?php echo $val->job_id;?>">
   <i class="fa fa-envelope-o" aria-hidden="true"></i>&nbsp; Email job</a></div>
            </div>
            <br>
            <br>
            <div class="mobile-job-actions visible-xs">
              <div class="row no-gutter">
                <div class="col-xs-4">
<?php
														$can_id=$this->session->userdata('user_id');
														$query = mysql_query("SELECT  * FROM shot_listjob where candidate_id='".$can_id."' AND job_id='".$val->job_id."'");
														$total_pages = mysql_num_rows($query);
														?>
														<?php
														if($total_pages >0)
														{?>
															<a href="#"  class="btn btn-save btn-block no-radius" ><span class="glyphicon glyphicon-star"></span> Already Saved</a></span>
														<?php }
														else
														{?>
															
															<a href="<?php echo base_url();?>front_end/add_shortlist?job_id=<?php echo $val->job_id;?>&exp_date=<?php echo $val->exp_date;?>&shortjoblist=shortjoblist"  class="btn btn-save btn-block no-radius" ><span class="glyphicon glyphicon-star"></span> Save this job </a></span>
														<?php }?>				
				
				
				
				
				
				
				
				
				</div>
                <div class="col-xs-8">
				<?php 

$sql=mysql_query("SELECT * FROM  candidate_listjobs WHERE candidate_id='".$candidate_id."' and  job_id='".$val->job_id."'");
$count=mysql_num_rows($sql);
if($count > 0)
											{?>
											 
					<label style="text-align:center; padding-top: 20px;padding-left: 5px;">Already Applied</label>
											<?php }
											else
											{
												$today = date("Y-m-d");
												$exp_date = $val->exp_date;
												if ($exp_date > $today) {
											?>

				
                <a  href="<?php echo base_url();?>front_end/appl_job?job_id=<?php echo $val->job_id;?>" class="btn btn-primary btn-block no-radius"><span class="glyphicon glyphicon-check"></span> Apply for this job </a>
				 <?php } ?>
				  <?php if ($exp_date < $today) {  ?>
	<label style="padding-top: 20px; color:#cd0329 ">Application Date Expired</label>
    <?php } ?>
	 <?php } ?>
				
				
				</div>
              </div>
            </div>
          </div>
        </div>
        <!-- sidebar -->
        <div class="sidebar col-sm-5 col-md-4 hidden-xs">
          <div class="panel panel-default job-action-panel" data-spy="affix" data-offset-top="120" data-offset-bottom="580" style="width: 360px;">
            <div class="row">
              <div class="col-sm-7 col-md-7">
                <h2><?php echo $val->company_name; ?></h2>
                
                Posted On <?php 
								$date_get=$val->date;
								$datearray=explode("-", $date_get);
								$year=$datearray[0];
								$month=$datearray[1];
								$day=$datearray[2];
								$orginal_date=$month."-".$day."-".$year;
								echo $orginal_date;
			 				  ?><br>
                Expiring On <?php 
								$date_get1=$val->exp_date;
								$datearray1=explode("-", $date_get1);
								$year1=$datearray1[0];
								$month=$datearray1[1];
								$day1=$datearray1[2];
								$orginal_date1=$month1."-".$day1."-".$year1;
								echo $orginal_date1;
			 				  ?>  </div>
              <div class="col-sm-5 col-md-5">
                <div class="coylogo-holder">
				<?php 
			if($val->comapny_image!='')
			{?>
			<img src="<?php echo base_url();?>assets/upload/<?=$val->comapny_image;?>" alt="<?php echo $val->company_name; ?>"  class="img-coylogo img-responsive">
			<?php }
			else
			{?>
			<img src="<?php echo base_url();?>assets_front/images/logoweb.png" alt="<?php echo $val->company_name; ?>"  class="img-coylogo img-responsive">
			<?php }
			?>
				</div>
              </div>
            </div>
            <hr>
            <div class="row">
              <div class="col-sm-12">
                <h3>Interested in this job?</h3>
				<?php 

$sql=mysql_query("SELECT * FROM  candidate_listjobs WHERE candidate_id='".$candidate_id."' and  job_id='".$val->job_id."'");
$count=mysql_num_rows($sql);
if($count > 0)
											{?>
											 
					<label style="text-align:center; padding-top: 20px;padding-left: 5px;">Already Applied</label>
											<?php }
											else
											{
												$today = date("Y-m-d");
												$exp_date = $val->exp_date;
												if ($exp_date > $today) {
											?>

				
                <a  href="<?php echo base_url();?>front_end/appl_job?job_id=<?php echo $val->job_id;?>" class="btn btn-primary btn-block"><span class="glyphicon glyphicon-check active"></span> Apply for this job </a>
				 <?php } ?>
				  <?php if ($exp_date < $today) {  ?>
	<label style="padding-top: 20px; color:#cd0329 ">Application Date Expired</label>
    <?php } ?>
	 <?php } ?>
                <hr>
                <h3>Unsure? Save it for later</h3>
                <span class="save-job-holder">
				<?php
														$can_id=$this->session->userdata('user_id');
														$query = mysql_query("SELECT  * FROM shot_listjob where candidate_id='".$can_id."' AND job_id='".$val->job_id."'");
														$total_pages = mysql_num_rows($query);
														?>
														<?php
														if($total_pages >0)
														{?>
															<a href="#"  class="btn btn-border btn-block" ><span class="glyphicon glyphicon-star active"></span>Already Saved</a></span>
														<?php }
														else
														{?>
															
															<a href="<?php echo base_url();?>front_end/add_shortlist?job_id=<?php echo $val->job_id;?>&exp_date=<?php echo $val->exp_date;?>&shortjoblist=shortjoblist"  class="btn btn-border btn-block" ><span class="glyphicon glyphicon-star active"></span> Save this job </a></span>
														<?php }?>
				
				
                <hr>
                <h3>Share this job to your friends</h3>
                <div class="addthis_inline_share_toolbox"><a href="<?php echo base_url();?>front_end/sendemail?job_id=<?php echo $val->job_id;?>">
   <i class="fa fa-envelope-o" aria-hidden="true"></i>&nbsp; Email job</a></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php }?>
  <div class="row" id="jobad-gravity" style="    background: #F6F6BB;
    border: 1px solid #F6F6BB">
    <div class="col-xs-12 col-sm-7 col-md-8">
      <div id="reco-div" data-height="1869">
        <div class="jobs-recommended">
          <h3>A few more jobs you might be interested in</h3>
		  <?php
		  $sle_jobs=mysql_query("select * from njobn_jobdetails where job_id='".$this->input->get('job_id')."'");
          while($fetch_jobs_data=mysql_fetch_array($sle_jobs))
		  {
		  
		  										$currency_value=$fetch_jobs_data['currency'];
												 if($fetch_jobs_data['perday']==1)
												{
												$perday='Per Day';
												}
												if($fetch_jobs_data['perday']==2)
												{
												$perday='Per Week';
												}
												if($fetch_jobs_data['perday']==3)
												{
												$perday='Per Annum';
												}
		 						$sle_currency=mysql_query("select * from currency where skill_id='".$currency_valu."'");
         						$rowcurrency=mysql_fetch_array($sle_currency);
								$currency=$rowcurrency['skill_code'];
												
		  ?>
          <div class="reco-job">
            <div class="row">
              <div class="hidden-xs col-sm-2 col-md-2">
                <div class="coylogo-holder"><a href="<?php echo base_url();?>front_end/jobdetails?job_id=<?php echo $fetch_jobs_data['job_id'];?>"  class="ad-detail-link job-recommended" data-offset="0"> <img src="<?php echo base_url();?>assets/upload/<?php echo $fetch_jobs_data['comapny_image'];?>" alt="<?php echo $fetch_jobs_data['company_name'];?>" class="img-coylogo img-responsive"> </a></div>
              </div>
              <div class="col-xs-12 col-sm-10 col-md-10">
                <h4><a href="<?php echo base_url();?>front_end/jobdetails?job_id=<?php echo $fetch_jobs_data['job_id'];?>" class="ad-detail-link"s><span class="jobttl"><?php echo $fetch_jobs_data['job_title'];?></span></a></h4>
                <ul class="list-unstyled job-tag">
                  <li><span class="glyphicon glyphicon-tags"></span>&nbsp;
                     <?php if($fetch_jobs_data['job_type']==5){ echo "Full Time";}?>
								                 <?php if($fetch_jobs_data['job_type']==4){ echo "Part Time";}?>
												 <?php if($fetch_jobs_data['job_type']==2){ echo "Contract";}?>
												 <?php if($fetch_jobs_data['job_type']==3){ echo "Temporary";}?>
												 <?php if($fetch_jobs_data['job_type']==1){ echo "Volunteer";}?>
                                                  <?php if($fetch_jobs_data['job_type']==7){ echo "Permanent";}?>
												<?php if($fetch_jobs_data['job_type']==6){ echo "Other";}?> </li>
                  <li><span class="glyphicon glyphicon-map-marker"></span>&nbsp;
                    <?php
echo $fetch_jobs_data['job_location_id'].' '."-".' '.$fetch_jobs_data['city'];
?> </li>
                </ul>
                <div class="row jobcoy">
                  <div class="col-xs-3 visible-xs">
                    <div class="coylogo-holder"><a href="<?php echo base_url();?>front_end/jobdetails?job_id=<?php echo $fetch_jobs_data['job_id'];?>"> <img  src="<?php echo base_url();?>assets/upload/<?php echo $fetch_jobs_data['comapny_image'];?>" alt="<?php echo $fetch_jobs_data['company_name'];?>" class="img-coylogo img-responsive"> </a></div>
                  </div>
                  <div class="col-xs-9 col-sm-9">
                    <p class="coyinfo"> <span class="visible-xs"><span class="glyphicon glyphicon-usd"></span>&nbsp; <span class="salmin"><strong><?php echo 'From:'.' '.$currency.' '.$fetch_jobs_data['job_salary_from'].' ,'.' '.'To:'.' '.$currency.' '.$fetch_jobs_data['job_salary_to'].' '.$perday;?></strong></span>&nbsp; </span> <span class="glyphicon glyphicon-user"></span>&nbsp; <strong><?php echo $fetch_jobs_data['company_name']; ?></strong> <br>
                      <span class="glyphicon glyphicon-time"></span>&nbsp;
                      Posted On  <?php 
								$date_get=$fetch_jobs_data['date'];
								$datearray=explode("-", $date_get);
								$year=$datearray[0];
								$month=$datearray[1];
								$day=$datearray[2];
								$orginal_date=$month."-".$day."-".$year;
								echo $orginal_date;
			 				  ?> </p>
                  </div>
                  <div class="hidden-xs col-sm-3">
                    <p class="text-right"><span class="salmin"><?php echo 'From:'.' '.$currency.' '.$fetch_jobs_data['job_salary_from'].' ,'.' '.'To:'.' '.$currency.' '.$fetch_jobs_data['job_salary_to'].' '.$perday;?></span> </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <?php }?>
          
          
        
        </div>
      </div>
      <br>
      
    </div>
  </div>
</div>
<?php $this->load->view('footer_front'); ?>