<?php

require_once('php/php-mailer/PHPMailerAutoload.php');

// Step 1 - Enter your email address below.
$email = 'windex2004@gmail.com';

// If the e-mail is not working, change the debug option to 2 | $debug = 2;
$debug = 0;

if(isset($_POST['submit'])) {


	// Step 2 - If you don't want a "captcha" verification, remove that IF.
	

		// Step 3 - Configure the fields list that you want to receive on the email.
		$fields = array(
			0 => array(
				'text' => 'firtname',
				'val' => $_POST['firtname']
			),
			1 => array(
				'text' => 'lastname',
				'val' => $_POST['lastname']
			),
			2 => array(
				'text' => 'Message',
				'val' => $_POST['message']
			),
			3 => array(
				'text' => 'phone',
				'val' => $_POST['phone']
			),
			4 => array(
				'text' => 'designation',
				'val' => $_POST['designation']
			)
		);

		$message = '';

		foreach($fields as $field) {
			$message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
		}

		$mail = new PHPMailer(true);

		try {

			$mail->SMTPDebug = $debug;                            // Debug Mode

			// Step 3 (Optional) - If you don't receive the email, try to configure the parameters below:

			//$mail->IsSMTP();                                         // Set mailer to use SMTP
			//$mail->Host = 'smtp.gmail.com';				       // Specify main and backup server
			//$mail->SMTPAuth = true;                                  // Enable SMTP authentication
			//$mail->Username = 'sales@savoritepharma.com';                    // SMTP username
			//$mail->Password = 'IDEA@@india2';                              // SMTP password
			//$mail->SMTPSecure = 'tls';                               // Enable encryption, 'ssl' also accepted
			//$mail->Port = 587;   								       // TCP port to connect to

			$mail->AddAddress($email);	 						       // Add a recipient
			//$mail->AddAddress('info@savoritepharma.com','Savoritepharma Career Form');	 						       // Add a recipient

			//$mail->AddAddress('person2@domain.com', 'Person 2');     // Add another recipient
			//$mail->AddCC('person3@domain.com', 'Person 3');          // Add a "Cc" address. 
			//$mail->AddBCC('person4@domain.com', 'Person 4');         // Add a "Bcc" address. 

			$mail->SetFrom($email, $_POST['name']);
			$mail->AddReplyTo($_POST['email'], $_POST['name']);

			$mail->IsHTML(true);                                  // Set email format to HTML

			$mail->CharSet = 'UTF-8';

			$mail->Subject = 'Savocent Career Form';
			$mail->Body    = $message;

			// Step 4 - If you don't want to attach any files, remove that code below
			if (isset($_FILES['attachment']) && $_FILES['attachment']['error'] == UPLOAD_ERR_OK) {
				$mail->AddAttachment($_FILES['attachment']['tmp_name'], $_FILES['attachment']['name']);
			}

			$mail->Send();

			$arrResult = array ('response'=>'success');

		} catch (phpmailerException $e) {
			$arrResult = array ('response'=>'error','errorMessage'=>$e->errorMessage());
		} catch (Exception $e) {
			$arrResult = array ('response'=>'error','errorMessage'=>$e->getMessage());
		}

	}


?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.png" />
		<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
<!-- font -->
<link  rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:300,300i,400,500,500i,600,700,800,900|Poppins:200,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900">
 
<!-- Plugins -->
<link rel="stylesheet" type="text/css" href="css/plugins-css.css" />

<!-- Typography -->
<link rel="stylesheet" type="text/css" href="css/typography.css" />

<!-- Shortcodes -->
<link rel="stylesheet" type="text/css" href="css/shortcodes/shortcodes.css" />
<!-- Style -->
<link rel="stylesheet" type="text/css" href="css/style.css" />

<!-- Style -->
<link rel="stylesheet" type="text/css" href="css/custom.css" />

<!-- Responsive -->
<link rel="stylesheet" type="text/css" href="css/responsive.css" /> 
 
		<link rel="stylesheet" href="css/theme-elements.css">
</head>

<body>

<div class="wrapper">

<!--=================================
 preloader -->
 
<div id="pre-loader">
    <img src="images/pre-loader/loader-01.svg" alt="">
</div>

<!--=================================
 preloader -->


<!--=================================
 header -->

<header id="header" class="header light"><!-- #BeginLibraryItem "/Library/nav.lbi" --><div class="menu">  
  <!-- menu start -->
   <nav id="menu" class="mega-menu">
    <!-- menu list items container -->
    <section class="menu-list-items">
     <div class="container"> 
      <div class="row"> 
       <div class="col-lg-12 col-md-12"> 
        <!-- menu logo -->
        <ul class="menu-logo">
            <li>
                <a href="index.html"><img id="logo_img" src="images/logo.png" alt="logo"> </a>
            </li>
        </ul>
        <!-- menu links -->
        <div class="menu-bar">
         <ul class="menu-links">
          <li><a href="index.html">Home</a>
             
                
            </li>
            <li><a href="aboutus.html"> About US </a>
                 
                
            </li>
            <li><a href="antibiotic.html">Products</a>
               
                
            </li>
            <li><a href="careers.php">Career </a>
                
                
            </li>
			 
			 
            <li><a href="contactus.html">Contact Us </a>
            
              
             </li>
            
        </ul>
        
        </div>
       </div>
      </div>
     </div>
    </section>
   </nav>
  <!-- menu end -->
 </div><!-- #EndLibraryItem --></header>

<!--=================================
 header -->


<!--=================================
page-title-->

<section class="page-title gray-bg">
  <div class="container">
    <div class="row"> 
    <div class="col-lg-12"> 
      <div class="page-title-name">
          <h1>Career</h1>
        </div>
          <ul class="page-breadcrumb">
            <li><a href="index.html"><i class="fa fa-home"></i> Home</a> <i class="fa fa-angle-double-right"></i></li>
            <li><span>Career</span> </li>
       </ul>
      </div>
     </div>
  </div>
</section>

<!--=================================
page-title -->


<!--=================================
 careers-->

<section class="page-section-ptb contact-2">
  <div class="container">
  <div class="row">
  <div class="col-lg-12">
       <?php
                                            if (isset($arrResult)) {
                                                if($arrResult['response'] == 'success') {
                                                ?>
                                                <div class="alert alert-success" id="contactSuccess">
                                                    <strong>Success!</strong> Your message has been sent to us.
                                                </div>
                                                <?php
                                                } else if($arrResult['response'] == 'error') {
                                                ?>
                                                <div class="alert alert-danger" id="contactError">
                                                    <strong>Error!</strong> There was an error sending your message.
                                                    <span class="font-size-xs mt-sm display-block" id="mailErrorMessage"><?php echo $arrResult['errorMessage'];?></span>
                                                </div>
                                                <?php
                                                } 
                                                ?>
                                                
                                                <?php
                                                
                                            }
                                            ?>
     <form method="post" action="careers.php">
      <div class="contact-form clearfix">
        <div class="section-field">
          <input type="text" placeholder="First Name*" class="form-control"  name="firstname">
         </div> 
        <div class="section-field">
          <input type="text" placeholder="Last Name*" class="form-control"  name="lastname">
         </div> 
         <div class="section-field">
            <input type="email" placeholder="Email Address*" class="form-control" name="email">
          </div>
         <div class="section-field">
            <input type="text" placeholder="Phone*" class="form-control" name="phone">
          </div>
         <div class="section-field">
            <input type="text" placeholder="Designation" class="form-control" name="designation">
          </div>
         <div class="section-field">
            <input type="file" class="form-control" name="attachment" id="attachment">
          </div>
         <div class="section-field textarea">
           <textarea class="input-message form-control" placeholder="Comment*"  rows="7" name="message"></textarea>
          </div>
		    <!-- Google reCaptch-->
			 <div class="g-recaptcha section-field clearfix" data-sitekey="6LekoUsUAAAAAE6ecRx5s0HQhX6MLBNUg5wAYlSk"></div> 
			<div class="section-field submit-button">
				
			   <button id="submit" name="submit" type="submit" value="Send" class="button"><span> Send message </span> <i class="fa fa-paper-plane"></i></button>
		   </div>
          </div> 
        </form>
      
      </div>
     </div>
    </div>
</section>

<!--=================================
 careers-->

 
<!--=================================
 footer --><!-- #BeginLibraryItem "/Library/footer.lbi" -->
<footer class="footer footer-topbar black-bg">
 <div class="copyright">
  <div class="container">
    <div class="row">
      <div class="col-xl-6 col-md-6">
      <img class="img-fluid"  id="logo-footer"  src="images/logo-white.png" alt="">
            
        </div>
        <div class="col-xl-6 col-md-6">
        
        <div class="footer-text">
               <p class="text-right"> &copy; Copyright <span id="copyright"> <script>document.getElementById('copyright').appendChild(document.createTextNode(new Date().getFullYear()))</script></span> All Rights Reserved | Designed & Developed by <a href="http://www.windexinfotech.in" target="_blank">Windexinfotech</a> </p>
            </div>
      </div>
    </div>
  </div>
 </div>
</footer><!-- #EndLibraryItem --><!--=================================
 footer -->

</div>

  

<div id="back-to-top"><a class="top arrow" href="#top"><i class="fa fa-angle-up"></i> <span>TOP</span></a></div>
 
<!--=================================
 jquery -->

<!-- jquery -->
<script src="js/jquery-3.3.1.min.js"></script>

<!-- plugins-jquery -->
<script src="js/plugins-jquery.js"></script>

<!-- plugin_path -->
<script>var plugin_path = 'js/';</script>
 
<!-- Google recaptcha -->
<script src='https://www.google.com/recaptcha/api.js'></script>

<!-- custom -->
<script src="js/custom.js"></script>
 
</body>
</html>