 <?php
  
	function d($dis_data){
		print '<pre>';
		print_r($dis_data);
		print '</pre>';
	}

	function enquiry_form($data){
	    $ip=$_SERVER["REMOTE_ADDR"];
		$name = $data['name'];
		$email = $data['email'];
		$phone = $data['phone'];
		$subject = $data['subject'];
		$message = @$data['message'];
		
            
            //echo $subject."Mesage".$message;exit;
//           $san =  mail($sender, 'sub', $message, $headers) ;
//           echo "<pre>";
//           print_r($san);
//           exit;
            
                
		$msg="<table width='60%' align='center' cellpadding='0' cellspacing='0' style='font-family:Verdana, Geneva, sans-serif; font-size:13px; border:dotted 1px #186ea9; border-bottom:solid 3px #186ea9;'>
  <tr>
    <td style='background:#186ea9; padding:10px 0; font-weight:bold; color:#fff; font-size:16px;' colspan='3' align='center' valign='middle'>Enquiry </td>
  </tr>
<tr>
    <td width='22%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>IP</strong></td>
    <td width='78%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$ip</td>
  </tr>
  <tr>
    <td style='background:#f2f2f2; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Name</strong></td>
    <td style='background:#f2f2f2; padding:10px; border-right:solid 1px #ddd; color:#333;'>$name</td>
  </tr>
  <tr>
    <td width='22%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Email</strong></td>
    <td width='78%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$email</td>
  </tr>
  <tr>
    <td width='22%' style='background:#f2f2f2; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Contact No.</strong></td>
    <td width='78%' style='background:#f2f2f2; padding:10px; border-right:solid 1px #ddd; color:#333;'>$phone</td>
  </tr>
  <tr>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Message</strong></td>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$message</td>
  </tr>
  
</table>
";	
		$sub="Alexasoftlabs | Enquiry Received";
		$mail_body = $msg;	
		$sender ="noreply@alexasoftlabs.com";		
		$headers  = "MIME-Version: 1.0" . "\r\n";
		$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
		$headers .= "from: ".$email."\n";
                require 'phpmailer/PHPMailerAutoload.php'; 
                $mail = new PHPMailer;

                //$mail->SMTPDebug = 3;                               // Enable verbose debug output

                $mail->isSMTP();                                      // Set mailer to use SMTP
                $mail->Host = 'mail.alexasoftlabs.com';  // Specify main and backup SMTP servers
                $mail->SMTPAuth = true;                               // Enable SMTP authentication
                $mail->Username = 'noreply@alexasoftlabs.com';                 // SMTP username
                $mail->Password = 'noreply@2018';                           // SMTP password
                $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
                $mail->Port = 465;                                    // TCP port to connect to
                $mail->setFrom('noreply@alexasoftlabs.com', 'Alexa Softlabs');
                 $mail->addAddress('abhishek@alexasoftlabs.com', 'Alexa Softlabs');     // Add a recipient  
                $mail->addCC('dilbag.swami@gmail.com');
                $mail->isHTML(true);                                  // Set email format to HTML
                $mail->Subject = $sub;
                $mail->Body    =  $mail_body;//'This is the HTML message body <b>in bold!</b>';
                $mail->AltBody = 'Thank you for contacting us, Our representatives will get back to you soon!';

                if(!$mail->send()) { 
                echo  'Message could not be sent.'.'Mailer Error: ' . $mail->ErrorInfo; 
                 
                }
                else
                { 
                echo "<script>alert('Thank you for contacting us, Our representatives will get back to you soon!')</script>";
                echo '<script>window.location.href="contact.php";</script>';
                }

	}
	
/**************************************/

function job($data){
        $ip=$_SERVER["REMOTE_ADDR"];
		$name = $data['name'];
		$email = $data['email'];
		$phone = $data['phone'];
		$exp = $data['exp'];
		$qualification = $data['qualification'];
		$job_position = $data['job_position'];
		$resume = $data['resume'];
		$description = @$data['description'];

		$msg="<table width='70%' align='center' cellpadding='0' cellspacing='0' style='font-family:Verdana, Geneva, sans-serif; font-size:13px; border:dotted 1px #186ea9; border-bottom:solid 3px #186ea9;'>
  <tr>
    <td style='background:#186ea9; padding:10px 0; font-weight:bold; color:#fff; font-size:16px;' colspan='3' align='center' valign='middle'>Job Apply  </td>
  </tr>
<tr>
    <td width='22%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>IP</strong></td>
    <td width='78%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$ip</td>
  </tr>
  <tr>
    <td style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Name</strong></td>
    <td style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$name</td>
  </tr>
  <tr>
    <td width='22%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Email</strong></td>
    <td width='78%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$email</td>
  </tr>
  <tr>
    <td width='22%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Contact No.</strong></td>
    <td width='78%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$phone</td>
  </tr>
  <tr>
    <td width='22%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Exp</strong></td>
    <td width='78%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$exp</td>
  </tr>
  <tr>
    <td width='22%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Qualification</strong></td>
    <td width='78%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$qualification</td>
  </tr>
  <tr>
    <td width='22%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Job Position</strong></td>
    <td width='78%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$job_position</td>
  </tr>
  <tr>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Description</strong></td>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$description</td>
  </tr>
  
</table>
";	
		$sub="Career | Apply Jobs";
		$mail_body = $msg;	
		$sender ="noreply@alexasoftlabs.com";		
		$headers  = "MIME-Version: 1.0" . "\r\n";
		$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
		$headers .= "from: ".$email."\n";
        require 'phpmailer/PHPMailerAutoload.php'; 
        $mail = new PHPMailer;
        //$mail->SMTPDebug = 3;                               // Enable verbose debug output
        $mail->isSMTP();                                      // Set mailer to use SMTP
        $mail->Host = 'mail.alexasoftlabs.com';  // Specify main and backup SMTP servers
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = 'noreply@alexasoftlabs.com';                 // SMTP username
        $mail->Password = 'noreply@2018';                           // SMTP password
        $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
        $mail->Port = 465;                                    // TCP port to connect to
        //$mail->setFrom($email);	
        $mail->setFrom('noreply@alexasoftlabs.com', 'Alexa Softlabs');
        $mail->addAddress('abhishek@alexasoftlabs.com', 'Alexa Softlab | Career');     // Add a recipient  
        $mail->addCC('dilbag.swami@gmail.com');
        $mail->isHTML(true);                                  // Set email format to HTML
        $path = $_FILES["resume"]["name"];
        move_uploaded_file($_FILES["resume"]["tmp_name"], $path);
        $mail->AddAttachment($path);     //Adds an attachment from a path on the filesystem
        $mail->Subject = $sub;
        $mail->Body    =  $mail_body; //'This is the HTML message body <b>in bold!</b>';
        $mail->AltBody = 'Thank you for contacting us, Our representatives will get back to you soon!';
        
        if(!$mail->send()) { 
          echo  'Message could not be sent.'.'Mailer Error: ' . $mail->ErrorInfo; 
        }
        else
        { 
          echo "<script>alert('Thank you for contacting us, Our representatives will get back to you soon!')</script>";
          echo '<script>window.location.href="career.php";</script>';
        }
	}
	
/**************************************/ 

function trading($data){
        $ip=$_SERVER["REMOTE_ADDR"];
		$name = $data['name'];
		$email = $data['email'];
		$phone = $data['phone'];
		$message = @$data['message'];

		$msg="<table width='70%' align='center' cellpadding='0' cellspacing='0' style='font-family:Verdana, Geneva, sans-serif; font-size:13px; border:dotted 1px #186ea9; border-bottom:solid 3px #186ea9;'>
  <tr>
    <td style='background:#186ea9; padding:10px 0; font-weight:bold; color:#fff; font-size:16px;' colspan='3' align='center' valign='middle'>Trading Application Source Code Provider  </td>
  </tr>
<tr>
    <td width='22%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>IP</strong></td>
    <td width='78%' style='background:#ffffff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$ip</td>
  </tr>
  <tr>
    <td style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Name</strong></td>
    <td style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$name</td>
  </tr>
  <tr>
    <td width='22%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Email</strong></td>
    <td width='78%' style='background:#ddd; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$email</td>
  </tr>
  <tr>
    <td width='22%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Contact No.</strong></td>
    <td width='78%' style='background:#fff; padding:10px; border-bottom:1px solid #ddd; border-right:solid 1px #ddd; color:#333;'>$phone</td>
  </tr>
  <tr>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; font-weight:bold; color:#555;'><strong>Message</strong></td>
    <td style='background:#fff; padding:10px; border-right:solid 1px #ddd; color:#333;'>$message</td>
  </tr>
</table>
";	
		$sub="Trading Application Source Code Provider"; 
		$mail_body = $msg;	
		$sender ="noreply@alexasoftlabs.com";		
		$headers  = "MIME-Version: 1.0" . "\r\n";
		$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
		$headers .= "from: ".$email."\n";
        require 'phpmailer/PHPMailerAutoload.php'; 
        $mail = new PHPMailer;
        //$mail->SMTPDebug = 3;                               // Enable verbose debug output
        $mail->isSMTP();                                      // Set mailer to use SMTP
        $mail->Host = 'mail.alexasoftlabs.com';  // Specify main and backup SMTP servers
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = 'noreply@alexasoftlabs.com';                 // SMTP username
        $mail->Password = 'noreply@2018';                           // SMTP password
        $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
        $mail->Port = 465;                                    // TCP port to connect to
        //$mail->setFrom($email);	
        $mail->setFrom('noreply@alexasoftlabs.com', 'Alexa Softlabs');
        $mail->addAddress('abhishek@alexasoftlabs.com', 'Trading Application Source Code Provider ');     // Add a recipient  
        $mail->addCC('dilbag.swami@gmail.com');
        $mail->isHTML(true);                                  // Set email format to HTML
        $mail->Subject = $sub;
        $mail->Body    =  $mail_body; //'This is the HTML message body <b>in bold!</b>';
        $mail->AltBody = 'Thank you for contacting us, Our representatives will get back to you soon!';
        
        if(!$mail->send()) { 
          echo  'Message could not be sent.'.'Mailer Error: ' . $mail->ErrorInfo; 
        }
        else
        { 
          echo "<script>alert('Thank you for contacting us, Our representatives will get back to you soon!')</script>";
          echo '<script>window.location.href="index.php";</script>';
        }
	}	
?>
