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

<script src="<?php echo ROOTPATH;?>/view/js/tab/reply_ads.js"></script>        
<script>
    var last; 
    var emp_id;
    
    function send_sms(id)
    {
        $("#send_sms_frm").closest('form').find("input[type=text], textarea").val("");
        $("label.error").hide();
    	$(".error").removeClass("error");	
        
        emp_id=id;
        $("#emp_send_sms").modal({
    		show: 'true',
    		backdrop: 'static',
    		keyboard:false
    	});
    } 
    
    
    
    $(document).ready(function()
    {      
    	site_id = '<?php echo $_REQUEST['site_id']; ?>';
    	car_city_id = '<?php echo $car_city_id; ?>';
    	car_id = '<?php echo $car_id; ?>';
    	
    	//$(".send_email").hide();
    	//$(".view_emp_contact").hide();
    	
    	
        // send sms
    	$("#send_sms_frm").submit(function( event )  
    	{ 	 
    		if($('#send_sms_frm').valid())  
    		{ 
    			var formData=$('#send_sms_frm').serialize();  
    			$.ajax({	
    			type: "POST",
    			url: URL+"/all-ajax/reply_ads.php", 
    			data: {send_sms_emp:1,formData:formData,emp_id:emp_id},	
    					beforeSend: function(){
    						
    					},
    					success: function(data){  					  
    					$('#emp_send_sms').modal('hide');	
    					alert("SMS Sent Successfully!!!");
    					//location.reload();
    				}  
    			});  
    			return false; 			
    	    }
    		//event.preventDefault();  
    	});
        
        // send email
    	$("#send_email_frm").submit(function( event )  
    	{ 	 
    		if($('#send_email_frm').valid())  
    		{ 
    			var formData=$('#send_email_frm').serialize();  
    			$.ajax({	
    			type: "POST",
    			url: URL+"/custom_function/EmailConfigure.php", 
    			data: {UnlockSend_email_emp:1,formData:formData,emp_id:emp_id},
    					beforeSend: function(){
    						
    					},
    					success: function(val)
    					{  					  
    					    if(val==1)
    					    {
            					$('#emp_send_email').modal('hide');	
            					alert("Email Sent Successfully!!!");
    					    }
    				}  
    			});  
    			return false; 			
    	    }
    		//event.preventDefault();  
    	});

    
    });   


    function unlock_credit(cust_id,type,city_id,ad_id,key)
    {
        if(site_custom_id!='')
        {
            if((site_id!='') && (site_custom_id==site_id) )
            {
                $.ajax({	
            		type: "POST",
            		url: URL+"/all-ajax/reply_ads.php", 
            		data: {AdsUnlock_credit:1,cust_id:cust_id,type:type,city_id:city_id,ad_id:ad_id,tab_type:1},
            		beforeSend: function(){ 
            		},
            		success: function(data)
            		{ 
            		    if(data==1)
            		    {
            		        $("#unlockcredit_btn"+key).css({"opacity":"0.5","pointer-events":"none"});
            		        $("#unlockcredit_btn"+key).hide(200); 
            		        $("#credit_used"+key).hide(200); 
            		        $("#send_email"+key).show();
            		        $("#view_emp_contact"+key).show();
            		        
            		        
            		        $.ajax({	
                        		type: "POST",
                        		url: URL+"/all-ajax/reply_ads.php", 
                        		data: {get_unlock_credit:1},
                        		beforeSend: function(){ 
                        		},
                        		success: function(val)
                        		{
                        		    $("#used_unlock_credit").html(val);
                        		}    
            		        });
                         }
            		    else if(data==2)
            		    {
            		        alert("Your monthly unlock credit limit has been over!!!");
            		    }
            		}
            	});
            }
        }
        else
        {
            alert("Kindly login to unlock credit!!!");
        }
    }	
    
    // For Email Start
    
    function send_email(id)
    {
        $("#send_email_frm").closest('form').find("input[type=text], textarea").val("");
        $("label.error").hide();
    	$(".error").removeClass("error");	
        
        emp_id=id;
        $("#emp_send_email").modal({
    		show: 'true',
    		backdrop: 'static',
    		keyboard:false
    	});
    } 
    
    function unlock_send_email(cust_id,type,city_id,ad_id)
    {
        $("#send_email_frm").closest('form').find("input[type=text], textarea").val("");
        $("label.error").hide();
    	$(".error").removeClass("error");
    	
    	
    	$.ajax({	
    		type: "POST",
    		url: URL+"/all-ajax/reply_ads.php", 
    		data: {get_UsersUnlock_info:1,cust_id:cust_id,type:type,city_id:city_id,ad_id:ad_id,tab_type:1},
    		beforeSend: function(){ 
    		},
    		success: function(unlock_val)
    		{
    		    var obj = jQuery.parseJSON(unlock_val);  
    			if(obj!=null || obj!='')
    			{
    			    emp_id=obj['id'];
        
                    $("#emp_send_email").modal({
                		show: 'true',
                		backdrop: 'static',
                		keyboard:false
                	});
    			}
    		}
    	});
    }
    // For Email End

    // For View Emp contact Start
    
    function view_emp_contact(id)
    {
        $("#emp_view_contact").modal({
    		show: 'true',
    		backdrop: 'static',
    		keyboard:false
    	});
    	
    	val=id;
    	
    	$.ajax({	
    		type: "POST",
    		url: URL+"/all-ajax/reply_ads.php", 
    		data: {AdsView_emp_contact:1,val:val,tab_type:1},
    		beforeSend: function(){ 
    		},
    		success: function(data)
    		{
    		    var obj = jQuery.parseJSON(data);  
    			if(obj!=null || obj!='')
    			{
    			    $("#emp_name").val(obj['name']);
    			    $("#emp_email").val(obj['email']);
    			    $("#emp_phone").val(obj['phone']);
    			}     
    		}
    	}); 
    }

    function unlockView_emp_contact(cust_id,type,city_id,ad_id)
    {
        $.ajax({	
    		type: "POST",
    		url: URL+"/all-ajax/reply_ads.php", 
    		data: {get_UsersUnlock_info:1,cust_id:cust_id,type:type,city_id:city_id,ad_id:ad_id,tab_type:1},
    		beforeSend: function(){ 
    		},
    		success: function(unlock_val)
    		{
    		    var obj = jQuery.parseJSON(unlock_val);  
    			if(obj!=null || obj!='')
    			{
    			    val=obj['id'];
    			    
                    $("#emp_view_contact").modal({
                		show: 'true',
                		backdrop: 'static',
                		keyboard:false
                	});
            	
                	$.ajax({	
                		type: "POST",
                		url: URL+"/all-ajax/reply_ads.php", 
                		data: {AdsView_emp_contact:1,val:val,tab_type:1},
                		beforeSend: function(){ 
                		},
                		success: function(data)
                		{
                		    var obj = jQuery.parseJSON(data);  
                			if(obj!=null || obj!='')
                			{
                			    $("#emp_name").val(obj['name']);
                			    $("#emp_email").val(obj['email']);
                			    $("#emp_phone").val(obj['phone']);
                			}    
                		}
                	}); 
    			}
    		}
        });
    }
    // For View Emp contact End
</script> 

<script type="text/javascript">
$(document).ready(function() { 
	$("#results" ).load( "CarApplicationLoad.php?car_city_id="+car_city_id+"&car_id="+car_id+"&site_id="+site_id+" "); //load initial records    
	//executes code below when user click on pagination links
	$("#results").on( "click", ".pagination a", function (e){
		e.preventDefault();
		$(".loading-div").show(); //show loading element
	
		var page = $(this).attr("data-page"); //get page number from link  
		$("#results").load("CarApplicationLoad.php?car_city_id="+car_city_id+"&car_id="+car_id+"&site_id="+site_id+" ",{"page":page}, function()
		{ //get content from PHP page
			$(".loading-div").hide(); //once done, hide loading element
		});
		
	});
});
</script>

<?php include_once("../all-ajax/inner-header.php");  ?> 
<div id="body" class="grey-bg">
<div class="wrapper">
<div class="bradeCrubs">
<!--<a href="<?php echo ROOTPATH;?>/MyDetails/ads.php">Home</a>
<a href="javascript:void(0);">Job</a>-->
<?php if(($_REQUEST['site_id']!='') && ($_COOKIE['site_custom_id']==$_REQUEST['site_id'])) { ?>
<a href="javascript:void(0);" class="current appliCants"><b><?php echo $car_applied_cnt; ?> Users</b></a> 
<a href="javascript:void(0);"><i class="fa fa-long-arrow-left pull-right" onclick="goBack()"></i></a>
<?php } ?>

</div>
<div class="welcome-menu">
    <div class="col-md-2 plr bottom newLeft" id="stickytypeheader">
    	<div id="dataLeft" class="job-filter bottom">
            <div class="panel-group" id="accordion">
           
            </div> 
        
        </div>
    </div> 
    </div>
   <div id="MyIframeDivs" class="col-md-10 newRigthView viewAppNew"> 
        <div class="col-md-12 p0">
        <?php //include_once 'applicationLoad.php';	?>
        <div class="loading-div"><img src="<?php echo ROOTPATH;?>/view/images/ajax-loader.gif" ></div>
        <div id="results"><!-- content will be loaded here --></div>    
        </div>
        <div class="col-md-3 plr">
    <div class="add-box">
		<?php 
          /*  foreach($RightImagesResult as $images)
            {  
        ?>  
            <img src="<?php echo ROOTPATH.'/uploads/advertise/service/full-screen/'.$images->name;?>" width="100%"> 
        <?php } */?>  
	</div>
	</div> 
   </div> 
   
<div class="clear"></div>
</div>

<br>

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

</div>




<!--------------------------------------------->
<!-- Send SMS Modal --> 
<div class="modal fade" id="emp_send_sms" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog " role="document">
    <div class="modal-content">
	  <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" ><span aria-hidden="true">&times;</span></button>
		<h4 class="modal-title" id="myModalLabel">Send SMS</h4>
      </div>
	  <form method="post" id="send_sms_frm" autocomplete="off">
      <div class="modal-body">
          <div class="row mypopOut">
		<div class="col-md-6 feild-group">
		<textarea class="salary" type="text" placeholder="Type your Message" name="emp_sms" id="emp_sms" value="" ></textarea>
        </div>
        </div>
        <div class="clear"></div>
	  </div>
      <div class="modal-footer textLeft">
	    <!--<button type="button" class="btn btn-blk" data-dismiss="modal" >Close</button> 
	    <input class="salary" type="hidden" name="emp_id"  id="emp_id" />--> 
        <input class="btn btn-primary" type="submit" name="submit_sms"  value="Send SMS"  id="submit_sms" />
       <span> Beware of fraud agents! do not pay money to get a job</span>
       <em><?php echo $SITE_NAME;?> will not be responsible for any payment made to a third-party. All Terms of Use are applicable. </em>
	   
	   
      </div>	
   </form>
   
  </div>
  </div>
</div>


<!-- Send Email Modal --> 
<div class="modal fade" id="emp_send_email" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog " role="document">
    <div class="modal-content">
	  <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" ><span aria-hidden="true">&times;</span></button>
		<h4 class="modal-title" id="myModalLabel">Send Email</h4>
      </div>
	  <form method="post" id="send_email_frm" autocomplete="off">
      <div class="modal-body">
          <div class="row mypopOut">
		<div class="col-md-6 feild-group">
     	<input class="salary" type="text" placeholder="Subject" name="emp_subject"  id="emp_subject" />	
		</div>
		<div class="col-md-6 feild-group">
		 
        </div>
        
        <div class="col-md-6 feild-group">
	      <p>Kindly Enter proer containt and subject while sending message</p>
        </div>
        
        <div class="col-md-6 feild-group">
		 <textarea class="salary" type="text" placeholder="Type your containt" name="email_type"  id="email_type" ></textarea>
        </div>
        
        
        <div class="col-md-6 feild-group">
	 <input class="btn btn-primary" type="submit" name="submit_email"  value="Send Email"  id="submit_email" />
        </div>
        
        </div>
        <div class="clear"></div>
	  </div>
       
    <div class="modal-footer textLeft">
            <!--<button type="button" class="btn btn-blk" data-dismiss="modal">Close</button> 
            <span id="waiting_img"> 
			 <img src="<?php echo ROOTPATH;?>/view/images/small_upldate_.gif" alt="Netbuttrfly Images" />
    		</span>	 
    		--> 
    		
           <span>Warning!</span> 
           <em>Please do not misused of contact provided  else your service will be terminated as per Policy <a href="<?php echo ROOTPATH;?>/UserServices/privacy_policy.php" target="_blank">Terms of use</a></em>  
    </div> 
        
   </form>
   
  </div>
  </div>
</div>


<!-- View Contact Modal --> 
 <div class="modal fade" id="emp_view_contact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog " role="document">
  
  <div class="modal-content" >
        <div class="modal-header"> 
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    		<h4 class="modal-title" id="myModalLabel">Contact Details</h4>
        </div>
        <form method="post" id="view_contact_frm" autocomplete="off">
        <div class="modal-body">
            <div class="row mypopOut">
		<div class="col-md-6 feild-group">
     	<input class="salary" type="text" placeholder="Name" name="emp_name"  id="emp_name" readonly />	
		</div>
		<div class="col-md-6 feild-group">
     	<input class="salary" type="text" placeholder="Email" name="emp_email"  id="emp_email" readonly/>	
		</div>
		<div class="col-md-6 feild-group">
     	<input class="salary" type="text" placeholder="Phone" name="emp_phone"  id="emp_phone" readonly/>	
		</div>
		
		<div class="col-md-6 feild-group">
     	<input class="btn btn-primary" data-dismiss="modal"  value="Close"    />
		</div>
		
		
		</div>
        </div>
        
        <div class="modal-footer textLeft">
            <!--<button type="button" class="btn btn-blk" data-dismiss="modal">Close</button> 
            <span id="waiting_img"> 
			 <img src="<?php echo ROOTPATH;?>/view/images/small_upldate_.gif" alt="Netbuttrfly Images"/>
    		</span>	 
    		--> 
           <span>Warning!</span> 
           <em>Please do not misused of contact provided  else your service will be terminated as per Policy <a href="<?php echo ROOTPATH;?>/UserServices/privacy_policy.php" target="_blank">Terms of use</a></em>  
        </div>    
        </form>
    </div>
    </div>
</div>
<!------------------------------------------------------------------------->	




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