<?php 
	
	include_once("../view/header-footer/header.php");    
	 	
?>   

<script src="<?php echo ROOTPATH;?>/view/js/tab/reply_ads.js"></script>        

<script>
var last; 
$(document).ready(function(){      
	
	 
	
	$(".comboText").click(function(){
		$(this).next().slideDown();
	});

	//hide sub categories span...
	/*
	for(i=0;i<=<?php echo $affected_rows_job_category;?>;i++)
		$("#job-sub-category-span"+i).hide();     
	
	hidden_role_key_val = $("#hidden_role_key_val" ).val();    
	//show collape for role...
	var container = $('#role-collapse'),
	scrollTo = $("#job-category"+hidden_role_key_val);  
	
	//$('#role-collapse').scrollTop(scrollTo.offset().top); 
	container.animate({	scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() 	});  
	
	 
	$("#job-sub-category-span"+hidden_role_key_val).show();	   */
	
	$(".month-salary").click(function()
	{    
		$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {month_salary:1,val:$(this).val()},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php");  
		}
		});
	});
	
	$("#clear_job_price").click(function(){ 
	
		$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {clear_job_price:1},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php"); 
			$(':checkbox').each(function () { $(this).removeAttr('checked'); $('input[type="radio"]').prop('checked', false); });
			//$("#collapse3").slideToggle();
			//$(".selectFullCat").slideToggle();
		}
		});
		
	});	
	
	$("#clear_job_locality").click(function(){ 
	
		$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {clear_job_locality:1},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php");  
			$("#locality_placed").html('');  
		}
		}); 
	});	
	
	$("#clear_all_job_filers").click(function(){ 
	
		$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {clear_all_job_filers:1},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php"); 
		}
		}); 
	});	
	
	$("body").click(function(e) 
	{    
		
		if ( e.target.id == "job-locality" || $(e.target).parents("#suggesstion_comboText").size() ) 
		{ 
             //alert("Inside div");   
        } else 
		{   
			 
			 
			$("#job-locality").val('');
			$("#suggesstion_comboText").slideUp(500);
        }   
    });	
});      

function search_by_sub_category(val)
{ 
	
	$.ajax({	
	type: "POST",
	url: URL+"/all-ajax/reply_ads.php", 
	data: {set_job_sub_category:1,val:val,remove:$('#job-sub-category'+val).is(':checked')},
	beforeSend: function(){ 
	},
	success: function(data)
	{  
		$("#MyIframeDivs").load("reply-basic-search.php"); 	
	}
	}); 
	
}
function search_by_category(val,name,id)
{ 
	var new_name = name.split(' ');	 
	new_name1 =   new_name[0].replace(new RegExp("%20", "g"), '_');        
	//new_name1 =   new_name1.replace(new RegExp("%2F", "g"), '_'); 
	new_name1 =   new_name1.replace(new RegExp("%2F", "g"), '_');    
	$.ajax({	
	type: "POST",
	url: URL+"/all-ajax/reply_ads.php", 
	data: {set_filter_session:1,val:1,type:1},
	beforeSend: function(){ 
	},
	success: function(data)
	{  
	   window.location.href = URL+"/jobs/<?php echo $_REQUEST["keyword1"];?>/"+new_name1+"-"+id+"";
	   $("#MyIframeDivs").load("reply-basic-search.php"); 
	}
	});
	
}   

function search_by_type(val)
{ 	 
	$.ajax({	
	type: "POST",
	url: URL+"/all-ajax/reply_ads.php", 
	data: {search_by_type:1,val:val,remove:$('#job-type'+val).is(':checked')},
	beforeSend: function(){ 
	},
	success: function(data)
	{  
		$("#MyIframeDivs").load("reply-basic-search.php"); 
	
	}
	});	
}   

/*function search_by_locality(val,name)
{
	new_name =   name.replace(new RegExp("%20", "g"), ' ');  
	$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {search_by_locality:1,val:val,name:new_name},
		beforeSend: function(){ 
		},
		success: function(data)
		{  
			 
			$("#job-locality").val('');
			$("#suggesstion_comboText").hide();
			$("#job-locality-ul").hide();
			$("#locality_placed").html(data);  
			$("#MyIframeDivs").load("reply-basic-search.php");  
		}
	}); 
}*/

	
function remove_locality(loc)
{ 
	new_name = loc.replace(new RegExp("%20", "g"), ' ');   
	$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {remove_locality:1,name:new_name},
		beforeSend: function(){ 
		},
		success: function(data)
		{     
			$("#locality_placed").html(data);  
			$("#MyIframeDivs").load("reply-basic-search.php");  
		}
	});  
	 
}

function sort_job_change(val)
{
	$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {sort_job_change:1,val:val},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php");  
		}
   });
}

function search_by_gender(val)
{ 	 
	$.ajax({	
	type: "POST",
	url: URL+"/all-ajax/reply_ads.php", 
	data: {search_by_gender:1,val:val,remove:$('#gender'+val).is(':checked')},
	beforeSend: function(){ 
	},
	success: function(data)
	{  
		$("#MyIframeDivs").load("reply-basic-search.php"); 
	
	}
	});	
}   

function job_locality(val)
{
	$.ajax({	
		type: "POST",
		url: URL+"/all-ajax/reply_ads.php", 
		data: {search_by_locality:1,val:val},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
			$("#MyIframeDivs").load("reply-basic-search.php"); 
		}
	}); 
}
</script> 
<?php include_once("../all-ajax/inner-header.php");  ?> 
<div id="body" class="grey-bg">
<div class="wrapper">
<div class="bradeCrubs">
<a href="#">Home</a>
<a href="#">My Jobs</a>
<!--<a href="#" class="current">Accountant</a>-->

</div>
<div class="col-md-3 plr">
	<div id="dataLeft">
    <div class="filterHead">Filter jobs 
    <a class="clearAll" href="javascript:void(0)" id="clear_all_job_filers">Clear All</a>
    </div>
    <div class="panel-group" id="accordion">
    	
    <div class="panel panel-default" id="locality">
      <div class="panel-heading">
        <h4 data-toggle="collapse" data-parent="#accordion" href="#collapse2" class="panel-title expand">
            <div class="right-arrow pull-right">+</div>
          <a href="#">Locality</a>
	    </h4>
      </div>
      <div id="collapse2" class="panel-collapse">   
        <div class="panel-body">  
			 <!-- combo-box  -->
			 <a href="javascript:void(0)" class="cleFilter" id="clear_job_locality">Clear Filter</a> 
			<div class="">
				<?php 				
				$stmt=$conn->prepare("select id,city_id,location_name from city_lacations where city_id=:city_id order by  id asc");  
				$stmt->bindValue(':city_id', $_COOKIE['search_city_id'], PDO::PARAM_INT);	
				$stmt->execute();   
				$city_locations_res = $stmt->fetchAll(PDO::FETCH_OBJ);	
				?>	   
				 <select name="location_id" id="job_locality" class="local-feild" onchange="job_locality(this.value);"> 
					<option value="0" selected="selected">Location List </option> 
					<?php
					foreach($city_locations_res as $dt)
					{  
					     if($_SESSION['search_by_locality_val']){
					?>	
					<option value="<?php echo $dt->id; ?>" class="comboText" <?php  if($_SESSION['search_by_locality_val']==$dt->id) echo "selected=selected";?>><?php echo $dt->location_name; ?></option>
					<?php } else {
					?>
				    <option value="<?php echo $dt->id; ?>" class="comboText"><?php echo $dt->location_name; ?></option>
					<?php
					  }
					}
					?>
				</select>
			</div>
        </div>
      </div>
    </div>	
		
	 
	<div class="panel panel-default">
      <div class="panel-heading">
        <h4 data-toggle="collapse" data-parent="#accordion" href="#collapse5" class="panel-title expand">
            <div class="right-arrow pull-right">+</div>
          <a href="#">Gender</a>
        </h4>
      </div>
      <div id="collapse5" class="panel-collapse collapse">
        <div class="panel-body pad">
			<!--<a href="javascript:void(0)"class="cleFilter" id="clear_job_type">Clear Filter</a> -->
        	<ul class="innUl job-filter list-gender">   
				<li><input type="radio" name="gender" id="gender1" onclick="search_by_gender(1)" <?php if($_SESSION['search_by_gender']==1) echo 'checked=checked'; ?> /> &nbsp;Male </li>
				
				<li> <input type="radio" name="gender" id="gender2" onclick="search_by_gender(2)" <?php if($_SESSION['search_by_gender']==2) echo 'checked=checked'; ?>  /> &nbsp;Female </li>
				
				<li><input type="radio" name="gender" id="gender3" onclick="search_by_gender(3)" <?php if($_SESSION['search_by_gender']==3) echo 'checked=checked'; ?>  /> &nbsp;Any </li>
            </ul>
        </div>
      </div>
    </div>
	
   
  </div> 
    
    </div>
    </div>
   <div id="MyIframeDivs"> <?php include_once 'reply-basic-search.php';	?><?php //echo  $_COOKIE['search_city_id'];?></div>    
<div class="clear"></div>
</div>
<br>

    
 <input type="hidden" value="<?php echo  $_COOKIE['search_city_id'];?>" id="search_city_id_hidden" name="search_city_id_hidden" />

</div>

<!--<script src="<?php echo ROOTPATH;?>/view/js/tab/general.js"></script>-->


<?php include_once("../view/header-footer/footer.php");  