<?php $this->load->view('header_front');
//code for to get web logo
$candidate_id=$this->session->userdata('user_id');
error_reporting(0);
?>
<form name="job_order_from" method="request" action="<?php echo base_url();?>front_end/joblisting">
         <div class="vacancies-section">
                	<div class="container">
					<div class="section-welcome nav-welcome" style="margin-bottom: 0px !important;">
                    <ol class="breadcrumb">
						<li><a href="<?php echo base_url();?>">Home</a></li>
						<li><a href="<?php echo base_url();?>front_end/joblisting?job_order=1">Job Details</a></li>
					</ol>
                    <a class="menubtn" href="#"><i class="fa fa-bars"></i></a>
                </div></br>
                    	<div class="row">
                        	<div class="col-md-3">
								<div class="vacancies-contan">
									<ul class="specialisms-section">
										<h2>Sectors</h2>
										<?php
										//code to get jobs cateories
										//$catCounter = 8;
										foreach($jobscategory as $val_cat)
										{
											$cat_id = $val_cat->jobs_category_id;
											$select = mysql_query("SELECT * FROM njobn_industeries WHERE industeries_id ='".$cat_id."'");
											$total = mysql_num_rows($select);
											if ($total > 0)
											{
												?>


												<li onclick="window.location='<?php echo base_url();?>front_end/joblisting?job_cat=<?php echo $val_cat->jobs_category_id;?>';"  style="cursor:pointer;"><?php echo $val_cat->jobs_category_title;?></li>
												<?php
												//if($catCounter < 1){break;}
											}
										}?>
										<h2 style="margin-top: 12px;">Search By Job Title</h2>
										<input type="text" name="job_titlesearch" id="search_title" onkeypress="return alphaOnly(event)" autocomplete="off" style="outline: none;"/></br>
										<div class="butten-section" style="margin-top: 10px;">
											<input type="submit" name="search_titl" id="search_titl" />
										</div></br>

									</ul>
									<div class="show-more-section">
										<!--	<a href="#">Show More</a>-->
									</div>
									<ul class="specialisms-section">
										<h2>Job Type</h2>
<li><input type="checkbox" name="fulltime" <?php if($_GET['fulltime']==5){?> checked="checked" <?php }?>   value="5" id="fulltime" onchange="this.form.submit()">
											<label>Full Time</label>
										</li>
											<li><input type="checkbox" name="parttime" <?php if($_GET['parttime']==4){?> checked="checked" <?php }?>   value="4" id="parttime" onchange="this.form.submit()">
											<label>Part Time</label>
										</li>
											<li><input  type="checkbox" name="contract" <?php if($_GET['contract']==2){?> checked="checked" <?php }?> value="2" id="contract" onchange="this.form.submit()">
											<label>Contract</label>
										</li>
										<li><input  type="checkbox" <?php if($_GET['temporary']==3){?> checked="checked" <?php }?>   name="temporary" value="3" id="temporary" onchange="this.form.submit()">
											<label>Temporary</label>
										</li>
										<li><input type="checkbox" name="permanent" <?php if($_GET['permanent']==7){?> checked="checked" <?php }?> value="7" id="permanent" onchange="this.form.submit()">
											<label>Permanent</label>
										</li>
									
										<li><input  type="checkbox" <?php if($_GET['volunteer']==1){?> checked="checked" <?php }?>   name="volunteer" value="1" id="volunteer" onchange="this.form.submit()">
											<label>Volunteer</label>
										</li>
										<li><input  type="checkbox" <?php if($_GET['other']==6){?> checked="checked" <?php }?>   name="other" value="6" id="other" onchange="this.form.submit()">
											<label>Other</label>
										</li>
										

									</ul>
									<div class="show-more-section">
										<!--<a href="#">Show More</a>-->
									</div>

									<!--<ul class="specialisms-section">
                                       <h2>Posted By</h2>
                                       <li><input type="checkbox">
                                           <label>Agency</label>
                                       </li>
                                       <li><input type="checkbox">
                                           <label>Employer</label>
                                       </li>
                                   </ul>-->
									<!--                                    <div class="show-more-section">
                                                                            <a href="#">Show More</a>
                                                                        </div>
                                    -->
									<ul class="specialisms-section">
										<h2>Min Experience</h2>
                                    	<li>
										<select name="exp" id="exp"  style="outline: none;" onchange="this.form.submit()">
										<option value="">Select Min Experience</option>
<option  value="555"  <?php if($_GET['exp']==555){?> selected="selected" <?php }?>>Fresh</option>
<option  value="233" <?php if($_GET['exp']==233){?> selected="selected" <?php }?>>Less than 1 Year</option>
<?php
for($i=1;$i<=35;$i++)
{?>
<option  value="<?php echo $i ?>" <?php if($_GET['exp']==$i){?> selected="selected" <?php }?>><?php echo $i ?> Years</option>
<?php }?>
<option value="36" <?php if($_GET['exp']==36){?> selected="selected" <?php }?>>More than 35 Years</option>
</select>
                                        </li>
										
										<h2>Max Experience</h2>
                                    	<li>
										<select name="exp1" id="exp1"  style="outline: none;" onchange="this.form.submit()">
										<option value="">Select Max Experience</option>
<option  value="555"  <?php if($_GET['exp1']==555){?> selected="selected" <?php }?>>Fresh</option>
<option  value="233" <?php if($_GET['exp1']==233){?> selected="selected" <?php }?>>Less than 1 Year</option>
<?php
for($i=1;$i<=35;$i++)
{?>
<option  value="<?php echo $i ?>" <?php if($_GET['exp1']==$i){?> selected="selected" <?php }?>><?php echo $i ?> Years</option>
<?php }?>
<option value="36" <?php if($_GET['exp1']==36){?> selected="selected" <?php }?>>More than 35 Years</option>
</select>
                                        </li>

										<h2 style="margin-top: 12px;">Search By Salary</h2>
										<input type="text" name="salary_from" id="salary_from" onkeyup="javascript:this.value=Comma(this.value);"  placeholder="£ Min" autocomplete="off"  style="outline: none;"/></br></br>
										<input type="text" name="salary_to" id="salary_to" onkeyup="javascript:this.value=Comma(this.value);"  placeholder="£ Max" autocomplete="off"  style="outline: none;"/>
										<div class="butten-section" style="margin-top: 10px;">
											<input type="submit" name="search_salary" id="search_salary" />
										</div>
									</ul>
								</div>
								<?php
								/*Code  for dynamic adverts on left side of page*****************************/
								/*foreach ($img_left as $row)
                                    {


                                    ?>
                                    <div class="add-section margin-top-30">
                                        <img src="--><?php //echo base_url();?><!--assets/upload/--><?php //echo $row->image?><!--" alt="add-image" onClick="window.location='--><?php //echo $row->url;?>//'" style="cursor:pointer;">
                                    </div>
                                    <div class="add-section margin-top-30 mobile-space">
                                        <img src="<?php //echo base_url();?><!--assets_front/images/--><?php //echo $row->image?><!--" alt="add-image">-->
                                    </div>
                                   <?php }*/?>
								</br></br>
								<!--<div class="add-section margin-top-30">
                                    <img src="<?php echo base_url();?>assets_front/images/add-image.png" alt="add-image">
                                </div>
                                <div class="add-section margin-top-30 mobile-space">
                                    <img src="<?php echo base_url();?>assets_front/images/add-image2.png" alt="add-image">
                                </div>-->
							</div>
							<div class="col-md-9">
								<div class="jobs-vacancies-section">
									<h3><?php echo $count_number;?> Job(s)</h3>
									<div class="righ-secalet">
										<select name="job_order" id="job_order"  style="outline: none;" onchange="this.form.submit()">
											<option  value="">Select Option</option>
											<option value="1" <?php if($_GET['job_order']==1){?> selected="selected" <?php }?>>All Job</option>
											<option value="2" <?php if($_GET['job_order']==2){?> selected="selected" <?php }?>>New Jobs</option>

										</select>
									</div>
								</div>
								<div class="row margin-top-45">
									<div class="col-md-10">
										<ul class="newjobdetails customer-bg">
											<?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")."'");
												?>
												<li  style="list-style:none;">
													<div class="col-md-3 adds-bd">
														<div class="logo-adds">
															<img style="cursor:pointer;" onclick="window.location='<?php echo base_url();?>front_end/jobdetails?job_id=<?php echo $val->job_id;?>';" src="<?php echo base_url();?>assets/upload/<?=$val->comapny_image;?>" alt="<?php echo $val->company_name; ?>" class="img-responsive">
														</div>
														<?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)
														{?>
															<div class="butten-bg margin-top-30 mobile-space"> <a href="#"><i class="fa fa-check"" aria-hidden="true"></i>Shortlisted</a>
															</div>
														<?php }
														else
														{?>
															<div class="butten-bg margin-top-30 mobile-space"> 
															<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">
															<i class="fa fa-star" aria-hidden="true"></i>Shortlist job</a>
															</div>
														<?php }?>
														<div class="butten-bg margin-top-30 mobile-space"> <a href="<?php echo base_url();?>front_end/sendemail?job_id=<?php echo $val->job_id;?>" data-target="#sendemail" data-toggle="modal"  >
   <i class="fa fa-envelope-o" aria-hidden="true"></i>Email job</a>
															</div>
<?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) {
											?>
   <div class="butten-bg margin-top-30 mobile-space">  <a href="<?php echo base_url();?>front_end/appl_job?job_id=<?php echo $val->job_id;?>">
   <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>Apply Now</a>
															</div>
   <?php } ?>
   <div>
 <?php if ($exp_date < $today) {  ?>
	<label style="padding-top: 20px; color:#cd0329 ">Application Date Expired</label>
    <?php } ?>
    </div>
   <?php } ?>
														
                  
															
													</div>
                                                    <div class="col-md-9">
                                                        <div class="customer-service-section">
                                                            <h4><?php echo $val->job_title; ?></h4>
                                                            <span>
															<?php
															$sel_countries=mysql_query("select * from countries where id='".$val->job_location_id."'");
															$fetch_countries = mysql_fetch_array($sel_countries);
	$sel_cities=mysql_query("select * from cities where id='".$val->city."'");
	$fethch_cities=mysql_fetch_array($sel_cities);
	echo $fetch_countries['name'].", ".$fethch_cities['name']
	?></span>
                                                        </div>
                                                        <ul class="Permanent-section margin-top-45" style="margin-top:8px!important;">
                                                            <?php
															if($val->job_type!=0)
															{?>
															<li class="clock"><i class="fa" aria-hidden="true"></i>
												 <?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";}?>		</li>
												 <?php }?>
												    <?php
													$sel_catids=mysql_query("select * from njobn_industeries where job_id='".$val->job_id."'");
													$njobnumbers=mysql_num_rows($sel_catids);
															if($njobnumbers >0)
														{?>
												 <li class="industry"><i class="fa" aria-hidden="true"></i>
												 <?php
	$arrydis=array();
	while($fatch_arrya_data=mysql_fetch_array($sel_catids))
	{
	//get names indutereos
	$sel_industeries=mysql_query("select * from njobn_jobs_category where jobs_category_id='".$fatch_arrya_data['industeries_id']."'");
    $fethch_induteries=mysql_fetch_array($sel_industeries);
    //echo $fethch_induteries['jobs_category_title'].' '.','.' ';
	$arrydis[]=$fethch_induteries['jobs_category_title'];
	}
	echo implode(', ',$arrydis);
	?></li>
	<?php }?>
	                                                           <?php
															   //get applciations numbers
					$sel_apllicatons_count=mysql_query("select * from candidate_listjobs where job_id='".$val->job_id."'");
					$numberviews=mysql_num_rows($sel_apllicatons_count);
															if($numberviews >0)
															{?>
                                                            <li class="views"><i class="fa" aria-hidden="true"></i>
															<?php
															
															$number_applciations=mysql_num_rows($sel_apllicatons_count);
															echo $number_applciations." Views";
															?>
															</li>
															<?php }?>
															<!--<li &peranum></li>-->
															<?php
															if($val->job_salary_from!='')
															{?>
                                                            <li class="money"><i class="fa" aria-hidden="true"></i>
                                                           <!-- get job salary-->
			<?php echo 'From:'.' '.$currency.' '.$val->job_salary_from.' ,'.' '.'To:'.' '.$currency.' '.$val->job_salary_to.' '.$perday;?>
															<?php //echo '&pound;'.$val->job_salary_from.' ','-'.' '.$currency.$val->job_salary_to.' '.'per annum';?>
															</li>
															<?php }?>
                                                            <li>
                                                            <?php
															$get_gender = $val->gender;
															if ($get_gender == 1)
															{ //its male ?>
                                                            	<i class="fa fa-user" aria-hidden="true"></i>
                                                                <?php echo "Male";
															}
															elseif ($get_gender == 2)
															{ //female ?>
																<i class="fa fa-user" aria-hidden="true"></i>
                                                                <?php echo "Female";
															}
															else
															{?>
                                                            <i class="fa fa-user" aria-hidden="true"></i>
                                                            <?php echo "Doesnt Matter";
															}?>
                                                            </li>

                                                            <li class="calendar">
                                                            <i class="fa" aria-hidden="true"></i>
                                                            <?php
															$today = date("Y-m-d");
															$exp_date = $val->exp_date;
															if ($exp_date > $today )
															echo "Apply Before: ".$val->exp_date;
															if ($exp_date < $today ){
																echo "Application Date Expired";
															}?>
                                                            </li>
                                                            <li>
                                                            <i class="fa fa-briefcase" aria-hidden="true"></i>
                                                            <?php
			 if($val->carLevel==1){ echo "Not Applicable";}
              if($val->carLevel==2){echo "Internship/Apprenticeship/Graduate";}
              if($val->carLevel==3){ echo "Entry Level/Associate";}
              if($val->carLevel==4){echo "Mid-Senior Level";}
              if($val->carLevel==5){echo "Director";}
			  if($val->carLevel==6){echo "Executive";}?>
                                                            </li>
                                                            <li>
                                                            <i class="fa fa-group" aria-hidden="true"></i>
                                                            <?php echo $val->total_postions." Position Available";?>
                                                            </li>
															<?php if($val->job_shift!=0)
															{?>
                                                            <li class="shift">
                                                            <?php if($val->job_shift==1){ ?>
                                                            <i class="fa" aria-hidden="true"></i>
															<?php echo "First Shift (Day)";}
															if($val->job_shift==2){?>
                                                            <i class="fa fa-moon-o" aria-hidden="true"></i>
															<?php echo "Night Shift (Night)";
                                                            }?>
                                                            </li>
															<?php }?>
															<?php
															if($val->fage!=0)
															{?>
                                                            <li class="age">
                                                            <i class="fa" aria-hidden="true"></i>
                                                            <?php if($val->fage!=0){ echo 'Age '.' '.$val->fage.' ','To'.' '.$val->tage; }?>
                                                            </li>
															<?php }?>
															<?php
															if($val->degreetitle!=0)
															{?>
                                                            <li class="graduation">
										<i class="fa" aria-hidden="true"></i>
                                         <?php 
										if($val->degreetitle==1){ echo "Education Level: "."CSE/GNVQ/O levels";}
	                                    if($val->degreetitle==2){echo "Education Level: "."A levels/advanced GNVQ";}
										if($val->degreetitle==3){echo "Education Level: "."HND/HNC";}
										if($val->degreetitle==4){echo "Education Level: "."University degree";}
										if($val->degreetitle==5){echo "Education Level: "."Masters degree or higher";}
										if($val->degreetitle==6){echo "Education Level: "."BTEC";}
										if($val->degreetitle==7){echo "Education Level: "."City & Guides";}
										if($val->degreetitle==8){echo "Education Level: "."Diploma";}
										if($val->degreetitle==9){echo "Education Level: "."Senior business or technical qualification";}
										if($val->degreetitle==10){echo "Education Level: "."PhD";}
										?>
                                                            </li>
															<?php }?>
															<?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)
											{?>
											 <span>You have already apply for this</span>
											<?php }
											else
											{
											?>
															<div class="applynew"> <a href="<?php echo base_url();?>front_end/appl_job?job_id=<?php echo $val->job_id;?>" style="text-align: center;"><i class="fa" aria-hidden="true"></i>Apply Now</a>
                                                            </div>
															<?php }*/?>
                                                        </ul>
                                                    </div>
                                            	</li>
												<p style="font-weight:bold">Role Overview</p>
												   <p>&nbsp;</p>
                                                  <div class="descriptionul">
                                                    <?php echo $val->job_des;?>
                                                  </div>
												<?php }?>
												<?php echo $this->pagination->create_links();?>
                                   			</ul>
                                    	</div>
                                   <?php
								/*Code for dynamic adverts on right of page*****************************/
								/*foreach ($img_right as $row)
								{
								?>

                                    	<div class="add-imag-section">
                                        	<img  src="<?php echo base_url();?>assets/upload/<?php echo $row->image?>" alt="image" onClick="window.location='<?php echo $row->url;?>'" style="cursor:pointer;"/>
                                        </div>
                                        <?php /*<div class="add-imag-section margin-top-20">
                                        	<img src="<?php echo base_url();?>assets_front/images/<?php echo $row1->image?>" alt="image">
                                        </div> */?>
<!--                                        --><?php //}?>
                                </div>
                            	</div>
                        	</div>

							<div class="row">
<div class="edit-filds">
<div class="modal fade" id="sendemail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">

      <div class="modal-body">

    </div>
  </div>
</div>
</div>
 </div>
</div>
                    	</div>
                	</div>
					</form>
        </div>
<?php $this->load->view('footer_front'); ?>