<html >
  <head>
    <meta charset="UTF-8">
    <title>DataXylo </title>
     <link rel="stylesheet" href="asset/sweetalert.css"/><!--for alert notification --->
      <link rel='stylesheet prefetch' href='https://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css'>
   
   <!--for alert notification --->
      <script src="asset/sweetalert.js"></script>
   
  
  </head>

  <body>
 

<?php
//    print_r($_POST);exit;
$FName=$_POST['fname']; 
$LName=$_POST['lname']; 
$Email=$_POST['email_id'];
$Phone=$_POST['P_number'];
$Jobid=$_POST['job_id'];	
$JobName=$_POST['job_title'];
$JobExp=$_POST['work_exp'];
$ss=$_POST['subject'];
 $to= 'hr@dataxylo.com';
 $headers  = 'MIME-Version: 1.0' . "\r\n";
 $headers   .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: admin@dataxylo.com[/email]" . "\r\n" .
$subject = 'Message From '.$FName.' '.$LName;
$message.='<html><head></head><body>.';
$message .= '<h4>Hi, You have received new profile please check below details :</h4>';
$message .= '<table border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#f3f3f3" style="max-width:600px;">
  <tbody>
             
  <tr>
    		<td align="center">
				<table width="750" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center" style="background-color: #ff9000;" summary="">
					<tbody>
                    <tr>
                            <td>
                                <table width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center" style="background-color: #EEEEEE;font-size: 13px;text-align:center;font-family:Arial,Helvetica,sans-serif" summary="">

                                    <tbody><tr style="/* padding: 4px; */background:#0eaaa6;color:#fff;background:-webkit-linear-gradient(top,#0eaaa6,#0eaaa6);height: 50px;/* text-align: center; */">
                                        <td width="10"></td>
                                        <td colspan=" "><span style="font-size: 14px;font-family:Arial,Helvetica,sans-serif;">New candidate profile for '.$Jobid.' '.$JobName.' </span></td>


										<td width="200">
										          
				   				</td>


<td style="text-align: center!important;" align="left" colspan="1"><span style="font-size: 17px;font-family:Arial,Helvetica,sans-serif;"><strong>DataXylo</strong></span> 
										     
										</td>

<td width="10"></td>
                                    </tr>
                                    
                                    <tr>
                                        <td width="10"></td>
                                        <td width="580" bgcolor="#eeeeee" align="left" style="background-color:#eeeeee;" colspan="3" valign="top">
                                            <table width="280" cellspacing="0" cellpadding="0" border="0" bgcolor="#eeeeee" align="left" style="background-color:#eeeeee;font-size:13px;text-align:left;font-family:Arial,Helvetica,sans-serif" summary="">

                                                <tbody>
                                                <tr>
                                                    <td width="80"></td>
                                                    <td style="text-align:left!important;line-height:30px" width="260"><span style="font-size:13px;font-family:Arial,Helvetica,sans-serif">
                                                    <br><strong>Name :</strong>
                                                    <br><strong>Job Id :</strong>
                                                    <br><strong>Job Name :</strong>
                                                     <br><strong>Experience :</strong>
                                                    <br><strong>Email :</strong>
                                                    <br><strong>Contact :</strong>
                                                    <br></span></td>
                                                    <td width="10"></td>
                                                </tr>
                                                <tr>
                                                    <td height="10" colspan="3"></td>
                                                </tr>
                                            </tbody></table>
											<table width="280" cellspacing="0" cellpadding="0" border="0" bgcolor="#eeeeee" align="left" style="background-color:#eeeeee;font-size:13px;text-align:left;font-family:Arial,Helvetica,sans-serif" summary="">

                                                <tbody>
                                                <tr>
                                                    <td width="10"></td>
                                                    <td style="text-align:left!important;line-height:30px" width="260"><span style="font-size:13px;font-family:Arial,Helvetica,sans-serif">
                                                    <br>'.$FName.' '.$LName.'
                                                    <br>'.$Jobid.'
                                                    <br>'.$JobName.'
                                                    <br>'.$JobExp.'
                                                    <br><a href="mailto:admin@dataxylo.com" target="_blank">'.$Email.'</a>
                                                    <br>'.$Phone.'
                                                    <br>'.$ss.'
                                                    <br></span></td>
                                                    <td width="10"></td>
                                                </tr>
                                                <tr>
                                                    <td height="10" colspan="3"></td>
                                                </tr>
                                            </tbody></table>
                                            
                                        </td>
                                       
                                        <td width="10"></td>
                                    </tr>
                                </tbody></table>
                            </td>
                        </tr>
					
							
						</tbody></table>
					</td>
				</tr>

   
  
  <tr>
  <td colspan="3" valign="top" bgcolor="#ffffff" align="center">
	<div style="width:100%">
  <img src="http://aboutrajan.com/shadow_btm.jpg" vspace="0" hspace="0" align="absmiddle" style="max-width:536px;width:inherit" alt="End" >
    </div>
   </td>

  </tr>
     
   
</tbody></table>';
$message.='</body></html>';

$ok=mail($to, $subject, $message, $headers);
	
if($ok){
 echo '<script>
    setTimeout(function() {
        swal({
            title: "Thank you for your interest. You will receive an email shortly.",
            text: "Message!",
            type: "success"
        }, function() {
            window.location = "jobs.php";
        });
    }, 1000);
</script>';


}


?>



<?php
include 'include/config.php';


if(isset($_POST['submit'])){

$job_id=$_POST['job_id'];
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$email_id=$_POST['email_id'];
$P_number=$_POST['P_number'];





$file = rand(1000,100000)."-".$_FILES['file']['name'];
    $file_loc = $_FILES['file']['tmp_name'];
	
	$folder="uploads/";
	
	// new file size in KB
	  
	// new file size in KB
	
	// make file name in lower case
	$new_file_name = strtolower($file);
	// make file name in lower case
	
	$final_file=str_replace(' ','-',$new_file_name);
	
	if(move_uploaded_file($file_loc,$folder.$final_file))
		
	{ 
$execute="INSERT INTO `experience`(`jobs_id`,`first_name`, `last_name`,`email_id`,`phone_no`,`resume`)
VALUES ('$job_id','$fname','$lname','$email_id','$P_number','$final_file')";
		
		mysqli_query($conn,$execute);
		?>
		
		<script>


</script>
      
       
		<?php
	}
	else
	{
		?>
		
		<?php
	}



}

?>


 </body>
</html>
