<?php $this->load->view('header_front'); 
//code for to get web logo			
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">
                    <a class="menubtn" href="#"><i class="fa fa-bars"></i></a>
                </div>
                    	<div class="row">
                        	<div class="col-md-3">
                                <div class="vacancies-contan">
                                	<ul class="specialisms-section">
                                    	<h2>Specialisms</h2>
										     	<?php  
												//code to get jobs cateories
                                                foreach($jobscategory as $val_cat)
                                                {	
                                                ?>  
                     <li onclick="window.location='<?php echo base_url();?>front_end/joblisting?job_cat=<?php echo $val_cat->jobs_category_id;?>';"  style="cursor:pointer;text-decoration:underline;width:109%"><?php echo $val_cat->jobs_category_title;?></li>
										<?php }?>
                                     
                                    </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="permanent" <?php if($_GET['permanent']==1){?> checked="checked" <?php }?> value="1" id="Permanent" onchange="this.form.submit()">
                                      <label>Permanent</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="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="fulltime" <?php if($_GET['parttime']==5){?> checked="checked" <?php }?>   value="5" id="fulltime" onchange="this.form.submit()">
                                      <label>Full Time</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>Experience</h2>
                                    	<li>
										<select name="exp" id="exp"  onchange="this.form.submit()">
										<option value="">Select 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 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="border-radius: 0px;"/></br>
			<div class="butten-section" style="margin-top: 10px;">
            <input type="submit" name="search_titl" id="search_titl" />
                                       </div></br>
			<h2 style="margin-top: 12px;">Search By Salary</h2>
            <input type="text" name="salary_from" id="salary_from" onkeypress="return isNumberKey(event)" placeholder="25000" autocomplete="off" style="border-radius: 0px;"/></br></br>
			<input type="text" name="salary_to" id="salary_to"onkeypress="return isNumberKey(event)" placeholder="50000" autocomplete="off" style="border-radius: 0px;"/>
			<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 }?>
                                <!--<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;?> Jobs & Vacancies</h3>
                                   	<div class="righ-secalet">
						<select name="job_order" id="job_order"  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="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 echo $search_string ?>"</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($currency_value==1)
												{
												$currency='&pound;';
												}
												if($currency_value==2)
												{
												$currency='$';
												}
												if($currency_value==3)
												{
												$currency='&euro;';
												}
												if($currency_value==4)
												{
												$currency='&#x20B9;';
												}
											   
											   ?>
                                                <li>
                                                    <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>Shortlist job</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;?>&shortjoblist=shortjoblist"><i class="fa fa-star" aria-hidden="true"></i>Shortlist job</a>
                                                            </div>
			<?php }?>

															
															
                                                            
                                                        </div>
                                                    <div class="col-md-9">
                                                        <div class="customer-service-section">
                                                            <h4><a href="<?php echo base_url();?>front_end/jobdetails?job_id=<?php echo $val->job_id;?>"><?php echo $val->job_title; ?></a></h4>
                                                            <span><?php
	$sel_cities=mysql_query("select * from cities where id='".$val->city."'");
	$fethch_cities=mysql_fetch_array($sel_cities);
	echo $fethch_cities['name']
	?></span>
                                                           <?php echo substr($val->job_des,0,300).'......';?>
                                                        </div>
                                                        <ul class="Permanent-section margin-top-45">
                                                            <li><i class="fa fa-clock-o" aria-hidden="true"></i><?php if($val->job_type==1){ echo "Permanent";}?>
								                 <?php if($val->job_type==2){ echo "Contract";}?>
												 <?php if($val->job_type==3){ echo "Temporary";}?>
												 <?php if($val->job_type==4){ echo "Part Time";}?>
												 <?php if($val->job_type==5){ echo "Full Time";}?>		</li>
                                                            <li><i class="fa fa-user" aria-hidden="true"></i>
															<?php
															//get applciations numbers
															$sel_apllicatons_count=mysql_query("select * from candidate_listjobs where job_id='".$val->job_id."'");
															$number_applciations=mysql_num_rows($sel_apllicatons_count);
															echo $number_applciations;
															?></li>
															<li &peranum></li>
                                                            <li><i class="fa fa-money" aria-hidden="true"></i>
															<?php echo 'From'.' '.$val->job_salary_from.' '.$currency.' ','To'.' '.$val->job_salary_to.' '.$currency;?>
															</li>
                                                        </ul>
                                                    </div>
                                            	</li>
                                                <?php }?>
												<?php echo $this->pagination->create_links();?>
                                   			</ul>
                                    	</div>
                                    <div class="col-md-2 mobile-space">
                                    	<?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>
                    	</div>
                	</div>
					</form>
        </div>
<?php $this->load->view('footer_front'); ?>