- Details
Request Quotation Action Process
<?php
if(isset($_POST['btn-submit-quotation']))
{
$name = $_POST["full-name"];
$company_name = $_POST["company-name"];
$products = $_POST["products"];
$market = $_POST["market"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip_code = $_POST["zip-code"];
$phone = $_POST["Phone"];
$email_address = $_POST["Email"];
$job_location = $_POST["job-location"];
$end_user_name = $_POST["end-user-name"];
$end_user_type = $_POST["end-user-type"];
$rfp_number = $_POST["rfp-number"];
$description = $_POST["description"];
$upload_photo = $_POST["upload-file"];
if($products == 'quote_pdc')
{
$product_name = 'Power Distribution Centers';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_enclosures')
{
$product_name = 'Custom Enclosures';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_medvoltage')
{
$product_name = 'Medium Voltage AC Power Solutions';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_breakers')
{
$product_name = 'Myers Circuit Breakers';
$sendToEmail =
$sentToName = 'Myers Controlled Power';
}
else if($products == 'quote_lvswitchgear')
{
$product_name = 'Low Voltage Switchgear';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_lvpanels')
{
$product_name = 'Low Voltage Switchboards And Panelboards';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_transit')
{
$$product_name = 'Solutions for Transit';
$sendToEmail =
$sentToName = 'Myers Controlled Power';
}
else if($products == 'quote_dcpower')
{
$product_name = 'DC Power Solutions (Non-Backup)';
$sendToEmail =
$sentToName = 'Myers Controlled Power';
}
else if($products == 'quote_peds')
{
$product_name = 'Service Pedestals';
$sendToEmail =
$sentToName = 'Myers Power';
}
else if($products == 'quote_fvr')
{
$product_name = 'FVR Outdoor Substation Circuit Breakers';
$sendToEmail =
$sentToName = 'Myers Controlled Power';
}
else
{
$product_name = 'Error..';
}
if($market == 'pdc')
{
$market_name = 'Power Distribution Centers';
}
else if($market == 'medvoltage')
{
$market_name = 'Medium Voltage AC Power Solutions';
}
else if($market == 'breakers')
{
$market_name = 'Myers Circuit Breakers';
}
else if($market == 'lvswitchgear')
{
$market_name = 'Low Voltage Switchgear';
}
else if($market == 'lvpanels')
{
$market_name = 'Low Voltage Switchboards & Panelboards';
}
$message = '
<style>
.request-quotation{
border:solid 0px red;
width:90%;
}
.request-quotation form{
}
.request-quotation .asterisk{
color:red;
}
.request-quotation table{
border:solid 1px #eee;
}
.request-quotation table tr{
border-bottom:solid 1px #eee;
}
.request-quotation table td{
padding:10px;
}
.request-quotation table td.label-field{
width:250px;
}
.request-quotation table td.input-field{
width:500px;
display:block;
border:solid 0px red;
color:#000;
}
.request-quotation table td.input-field input[type="text"],
.request-quotation table td.input-field select
{
width:90%;
display:block;
padding:7px;
}
.request-quotation table td.input-field .btn-submit-quotation,
.request-quotation table td.input-field input[type="submit"]{
width:50%;
padding:7px;
}
</style>
<div class="request-quotation">
<table>
<tr>
<td class="label-field" width="150">Full Name</td>
<td class="input-field">'.$name.'</td>
</tr>
<tr>
<td class="label-field">Company Name</td>
<td class="input-field">'.$company_name.'</td>
</tr>
<tr>
<td class="label-field">Products</td>
<td class="input-field">
'.$product_name.'
</td>
</tr>
<tr>
<td class="label-field">Market</td>
<td class="input-field">
'.$market_name.'
</td>
</tr>
<tr>
<td class="label-field">Address</td>
<td class="input-field">'.$address.'</td>
</tr>
<tr>
<td class="label-field">City</td>
<td class="input-field">'.$city.'</td>
</tr>
<tr>
<td class="label-field">State</td>
<td class="input-field">'.$state.'</td>
</tr>
<tr>
<td class="label-field">Zip Code</td>
<td class="input-field">'.$zip_code.'</td>
</tr>
<tr>
<td class="label-field">Phone</td>
<td class="input-field">'.$phone.'</td>
</tr>
<tr>
<td class="label-field">Email</td>
<td class="input-field">'.$email_address.'</td>
</tr>
<tr>
<td class="label-field">Job Location</td>
<td class="input-field">'.$job_location.'</td>
</tr>
<tr>
<td class="label-field">End User Name</td>
<td class="input-field">'.$end_user_name.'</td>
</tr>
<tr>
<td class="label-field">End User Type</td>
<td class="input-field">'.$end_user_type.'</td>
</tr>
<tr>
<td class="label-field">RFP Number</td>
<td class="input-field">'.$rfp_number.'</td>
</tr>
<tr>
<td class="label-field">Description</td>
<td class="input-field">'.$description.'</td>
</tr>
<!--
<tr>
<td class="label-field">Upload Photo or File</td>
<td class="input-field">'.$upload_photo.'</td>
</tr>
-->
</table>
</div>
';
require("PHPMailer/src/Exception.php");
require("PHPMailer/src/PHPMailer.php");
require("PHPMailer/src/SMTP.php");
$mail = new PHPMailer(true);
//Server settings
$mail->SMTPBebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->SMTPDebug = 2;
//$mail->Host = 'smtpout.secureserver.net';
//$mail->Host = 'localhost';
//$mail->SMTPAuth = true;
//$mail->SMTPAutoTLS = true;
//$mail->Username =
//$mail->Password = 'Muv95M!nYy$7';
//$mail->SMTPSecure = 'TLS';
//$mail->Port = 587;
$mail->Host = 'p3plvcpnl412308.prod.phx3.secureserver.net';
$mail->SMTPAuth = true;
$mail->SMTPAutoTLS = true;
$mail->Username =
$mail->Password = 'Muv95M!nYy$7';
$mail->SMTPSecure = 'TLS';
$mail->Port = 587;
//Recipients
//$mail->setFrom(
$mail->setFrom(
//$mail->setFrom($email_address,$name);
//$mail->addAddress(
$mail->addAddress(
//$mail->addAddress(
//$mail->addAddress(
//$mail->addAddress(
//$mail->addAddress(
//$mail->addReplyTo(
//$mail->addCC(
//$mail->addCC(
//$mail->addCC(
// Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
// Content
$mail->isHTML(true);
$mail->Subject = 'Request Quotation for '.$product_name.'';
$mail->Body = $message;
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
//$mail->send();
//send the message, check for errors
if (!$mail->send())
{
echo'Mail Error: '.$mail->ErrorInfo;
} else
{
header('Location: index.php?option=com_content&view=article&id=886');
}
}//if
?>