- Details
Request Service Action Process
<?php
if(isset($_POST['btn-submit-quotation']))
{
$name = $_POST["full-name"];
$company_name = $_POST["company-name"];
$email_address = $_POST["Email"];
$phone = $_POST["Phone"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip_code = $_POST["zip-code"];
$products= $_POST["equipment"];
$request_level= $_POST["request_level"];
$other= $_POST["other"];
$description= $_POST["description"];
$jobNumber= $_POST["jobNumber"];
$partNumber= $_POST["partNumber"];
$serialNumber= $_POST["serialNumber"];
$mm= $_POST["mm"];
$dd= $_POST["dd"];
$yyyy= $_POST["yyyy"];
$date= $mm.' '.$dd.' '.$yyyy;
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..';
}
$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">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">Email</td>
<td class="input-field">'.$email_address.'</td>
</tr>
<tr>
<td class="label-field">Phone</td>
<td class="input-field">'.$phone.'</td>
</tr>
<tr>
<td class="label-field">Installation Location Address</td>
<td class="input-field">'.$address.'</td>
</tr>
<tr>
<td class="label-field">Installation Location City</td>
<td class="input-field">'.$city.'</td>
</tr>
<tr>
<td class="label-field">Installation Location 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">Type of Equipment</td>
<td class="input-field">'.$product_name.'</td>
</tr>
<tr>
<td class="label-field">Request Level</td>
<td class="input-field">'.$request_level.'</td>
</tr>
<tr>
<td class="label-field">If Other, Specify</td>
<td class="input-field">'.$other.'</td>
</tr>
<tr>
<td class="label-field">Brief Description Of Problem Including Date of Occurence</td>
<td class="input-field">'.$description.'</td>
</tr>
<tr>
<td class="label-field">Job Number</td>
<td class="input-field">'.$jobNumber.'</td>
</tr>
<tr>
<td class="label-field">Part Number</td>
<td class="input-field">'.$partNumber.'</td>
</tr>
<tr>
<td class="label-field">Serial Number </td>
<td class="input-field">'.$serialNumber.'</td>
</tr>
<tr>
<td class="label-field">Date Equipment Put Into Service</td>
<td class="input-field">'.$date.'</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 Service From '.$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=902');
}
}//if
?>