    <?php


       
$user = "i4252965_scrm2"; 
$password = "V(6vT*XhYtO3Cr1*tV~17*(3"; 
$host = "p3plcpnl0759.prod.phx3.secureserver.net"; 
$dbase = "i4252965_scrm2"; 
   $table = "acdc_online_order"; 
$sql = "SELECT * FROM $table"; 


$conn = mysqli_connect($host,$user,$password); 


error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);

set_include_path("." . PATH_SEPARATOR . ($UserDir = dirname($_SERVER['DOCUMENT_ROOT'])) . "/pear/php" . PATH_SEPARATOR . get_include_path());
require_once "/home/pzfjjv0vvn1j/php/Mail.php";




if(! $conn ) {
               die('Could not connect: ' . mysqli_error());
            }   





if(!isset($_POST['submit']))
{
	//This page should not be accessed directly. Need to submit the form.
	echo "error; you need to submit the form!";
}



//no q1_
$firstname = $_POST['q2_namef'];
$lastname = $_POST['q2_namel'];
$companyname = $_REQUEST['q3_clientCompany'];
//no q4_
$framecolour = $_POST['q5_frameColour5'];
$customframecolor = $_POST['q6_customFrame6'];
$client_weight1 = $_POST['q7_clientWeight7'];
$seat_width1 = $_POST['q8_seatWidth8'];
$custom_seat_width = $_POST['q9_ifCustom9'];
$seat_widthf = $_POST['q8_seatWidth8'] ."-". $_POST['q9_ifCustom9'];
$seat_depth1 = $_POST['q10_seatDepth10'];
$custom_seat_depth = $_POST['q11_ifCustom11'];
$seat_depthf = $_POST['q10_seatDepth10'] ."-". $_POST['q11_ifCustom11'];
//no q12_
$pin_pivot1 = $_POST['q13_pivotStyle13'];
$nylon_strap = $_POST['q14_sizeOf14'];
//no q15_
$endomorph_width = $_POST['q16_widthOf16'];
//no q17_
//no q18_
$rear_wheels1 = $_POST['q19_rearWheels19'];
$casters1 = $_POST['q20_casterSize'];
//no q21_
//no q22_
//no q23_
//no q24_	
//no q25_
$accessories1 = $_POST['q26_accessories261'];
$accessories2 = $_POST['q26_accessories262'];
$accessories3 = $_POST['q26_accessories263'];
$accessories4 = $_POST['q26_accessories264'];
$accessories5 = $_POST['q26_accessories265'];
$accessories6 = $_POST['q26_accessories266'];
$accessories7 = $_POST['q26_accessories267'];
$accessories8 = $_POST['q26_accessories268'];
$accessories9 = $_POST['q26_accessories269'];
$accessories10 = $_POST['q26_accessories2610'];
$accessories11 = $_POST['q26_accessories2611'];
$accessories12 = $_POST['q26_accessories2612'];
$accessories13 = $_POST['q26_accessories2613'];
$accessories14 = $_POST['q26_accessories2614'];
$accessories15 = $_POST['q26_accessories2615'];
$accessories16 = $_POST['q26_accessories2616'];
$accessories17 = $_POST['q26_accessories2617'];
$accessories18 = $_POST['q26_accessories2618'];
$accessories19 = $_POST['q26_accessories2619'];
$accessories20 = $_POST['q26_accessories2620'];
$accessories21 = $_POST['q26_accessories2621'];
$accessoriesf = $_POST['q26_accessories261']."-". $_POST['q26_accessories262']."-". $_POST['q26_accessories263']."-". $_POST['q26_accessories264']."-". $_POST['q26_accessories265']."-". $_POST['q26_accessories266']."-". $_POST['q26_accessories267']."-". $_POST['q26_accessories268']."-". $_POST['q26_accessories269']."-". $_POST['q26_accessories2610']."-". $_POST['q26_accessories2611']."-". $_POST['q26_accessories2612']."-". $_POST['q26_accessories2613']."-". $_POST['q26_accessories2614']."-". $_POST['q26_accessories2615']."-". $_POST['q26_accessories2616']."-". $_POST['q26_accessories2617']."-". $_POST['q26_accessories2618']."-". $_POST['q26_accessories2619']."-". $_POST['q26_accessories2620']."-". $_POST['q26_accessories2621'];
$discount_structure = $_POST['q27_whatIs27'];
$sub_total = $_POST['q28_subTotal28'];
$visitor_email = $_POST['q29_enterEmail29'];
//no q30_
$total = $_POST['q31_totalWith'];
$laptraymaterial = $_POST['q32_lapTray32'];
$foot_rest1 = $_REQUEST['q33_footRest1'];
$foot_rest2 = $_REQUEST['q33_footRest2'];
$foot_rest3 = $_REQUEST['q33_footRest3'];
$foot_rest4 = $_REQUEST['q33_footRest4'];
$foot_rest5 = $_REQUEST['q33_footRest5'];
$foot_rest6 = $_REQUEST['q33_footRest6'];
$foot_rest7 = $_REQUEST['q33_footRest7'];
$foot_rest8 = $_REQUEST['q33_footRest8'];
$foot_rest9 = $_REQUEST['q33_footRest9'];
$foot_rest10 = $_REQUEST['q33_footRest10'];
$foot_rest11 = $_REQUEST['q33_footRest11'];
$foot_rest12 = $_REQUEST['q33_footRest12'];
$foot_rest13 = $_REQUEST['q33_footRest13'];
$foot_rest14 = $_REQUEST['q33_footRest14'];
$foot_rest14 = $_REQUEST['q33_footRest15'];
$foot_rest16 = $_REQUEST['q33_footRest16'];
$foot_restf = $_POST['q33_footRest1'] ."-". $_POST['q33_footRest2']."-". $_POST['q33_footRest3'] ."-". $_POST['q33_footRest4'] ."-". $_POST['q33_footRest5'] ."-". $_POST['q33_footRest6'] ."-". $_POST['q33_footRest7'] ."-". $_POST['q33_footRest8'] ."-". $_POST['q33_footRest9'] ."-". $_POST['q33_footRest10'] ."-". $_POST['q33_footRest11'] ."-". $_POST['q33_footRest12'] ."-". $_POST['q33_footRest13'] ."-". $_POST['q33_footRest14'] ."-". $_POST['q33_footRest15'] ."-". $_POST['q33_footRest16'] ."-". $_POST['q14_sizeOf14'];
$back_type1 = $_POST['q34_backType341'];
$back_type2 = $_POST['q34_backType342'];
$back_type3 = $_POST['q34_backType343'];
$back_typef = $_POST['q34_backType341'] ."-". $_POST['q34_backType342']."-". $_POST['q34_backType343']."-". $_POST['q16_widthOf16'];
$wheel_lock1 = $_POST['q35_wheelLock1'];
$wheel_lock2 = $_POST['q35_wheelLock2'];
$wheel_lock3 = $_POST['q35_wheelLock3'];
$wheel_lock4 = $_POST['q35_wheelLock4'];
$wheel_lock5 = $_POST['q35_wheelLock5'];
$wheel_lock6 = $_POST['q35_wheelLock6'];
$wheel_lock7 = $_POST['q35_wheelLock7'];
$wheel_lock8 = $_POST['q35_wheelLock8'];
$wheel_lockf = $_POST['q35_wheelLock1']."-". $_POST['q35_wheelLock2']."-". $_POST['q35_wheelLock3']."-". $_POST['q35_wheelLock4']."-". $_POST['q35_wheelLock5']."-". $_POST['q35_wheelLock6']."-". $_POST['q35_wheelLock7']."-". $_POST['q35_wheelLock8'];
$armrest1 = $_POST['q36_armRests361'];
$armrest2 = $_POST['q36_armRests362'];
$armrest3 = $_POST['q36_armRests363'];
$armrest4 = $_POST['q36_armRests364'];
$armrest5 = $_POST['q36_armRests365'];
$armrestf = $_POST['q36_armRests361']."-". $_POST['q36_armRests362']."-". $_POST['q36_armRests363']."-". $_POST['q36_armRests364']."-". $_POST['q36_armRests365']."-". $_POST['q13_pivotStyle13'];
//no q37_
$notes = $_POST['q38_notes'];
$seattofloor = $_POST['q39_seatTo39'];
$seating1 = $_POST['q40_seating401'];
$seating2 = $_POST['q40_seating402'];
$seating3 = $_POST['q40_seating403'];
$seating4 = $_POST['q40_seating404'];
$seating5 = $_POST['q40_seating405'];
$seating6 = $_POST['q40_seating406'];
$seating7 = $_POST['q40_seating407'];
$seating8 = $_POST['q40_seating408'];
$seating9 = $_POST['q40_seating409'];
$seating10 = $_POST['q40_seating4020'];
$seating11 = $_POST['q40_seating4019'];
$seatingf = $_POST['q40_seating401']."-". $_POST['q40_seating402']."-". $_POST['q40_seating403']."-". $_POST['q40_seating404']."-". $_POST['q40_seating405']."-". $_POST['q40_seating406']."-". $_POST['q40_seating407']."-". $_POST['q40_seating408']."-". $_POST['q40_seating409']."-". $_POST['q40_seating4010']."-". $_POST['q40_seating4011']."-". $_POST['q40_seating4012']."-". $_POST['q40_seating4013']."-". $_POST['q40_seating4014']."-". $_POST['q40_seating4015']."-". $_POST['q40_seating4016']."-". $_POST['q40_seating4017']."-". $_POST['q40_seating4018']."-". $_POST['q40_seating4019']."-". $_POST['q40_seating4020'];
$back_height = $_POST['q41_enterBack411'];
$back_width = $_POST['q41_enterBack412'];
$seating_cushion1 = $_POST['q42_seating421'];
$seating_cushion2 = $_POST['q42_seating422'];
$seating_cushion3 = $_POST['q42_seating423'];
$seating_cushion4 = $_POST['q42_seating424'];
$seating_cushion5 = $_POST['q42_seating425'];
$seating_cushion6 = $_POST['q42_seating426'];
$seating_cushion7 = $_POST['q42_seating427'];
$seating_cushion8 = $_POST['q42_seating428'];
$seating_cushion8 = $_POST['q42_seating429'];
$seating_cushionf = $_POST['q42_seating421']."-". $_POST['q42_seating422']."-". $_POST['q42_seating423']."-". $_POST['q42_seating424']."-". $_POST['q42_seating425']."-". $_POST['q42_seating426']."-". $_POST['q42_seating427']."-". $_POST['q42_seating428']."-". $_POST['q42_seating429'];
$back_customwidth = $_POST['q43_enterCustom'];
$back_customdepth = $_POST['q44_enterCustom44'];
//no q45_
$headrest1 = $_POST['q46_headrestOptions1'];
$headrest2 = $_POST['q46_headrestOptions2'];
$headrest3 = $_POST['q46_headrestOptions3'];
$headrest4 = $_POST['q46_headrestOptions4'];
$headrest5 = $_POST['q46_headrestOptions5'];
$headrest6 = $_POST['q46_headrestOptions6'];
$headrest7 = $_POST['q46_headrestOptions7'];
$headrest8 = $_POST['q46_headrestOptions8'];
$headrest9 = $_POST['q46_headrestOptions9'];
$headrest10 = $_POST['q46_headrestOptions10'];
$headrest11 = $_POST['q46_headrestOptions11'];
$headrestf = $_POST['q46_headrestOptions1'] ."-". $_POST['q46_headrestOptions2']."-". $_POST['q46_headrestOptions3']."-". $_POST['q46_headrestOptions4']."-". $_POST['q46_headrestOptions5']."-". $_POST['q46_headrestOptions6']."-". $_POST['q46_headrestOptions7']."-". $_POST['q46_headrestOptions8']."-". $_POST['q46_headrestOptions9']."-". $_POST['q46_headrestOptions10']."-". $_POST['q46_headrestOptions11'];
$backheight = $_REQUEST['q47_backHeight'];
$custombackheight = $_REQUEST['q48_ifCustom'];
$email_test = 'orderdesk@powerplusmobility.com';
$uniqueid =  time();
$dop = date();
$type = $_POST['STP'];
$ppmdate = date('Y-m-d H:i:s');

       

 $sql = "INSERT INTO acdc_online_order "."(name,
date_entered,
accessories_c,
arm_rest_c,
back_height_c,
back_type_c,
caster_c,
client_weight_c,
colour_c,
footrest_and_foot_plates_c,
headrest_c,
notes_c,
rear_wheel_c,
seat_depth_c,
seat_width_c,
seating_backs_c,
seating_cushions_c,
stf_c,
type_c,
wheel_lock_c,
quote_number, company_name)

"."VALUES ('NAME: $companyname',
'$ppmdate',
'ACCESSORIES: $accessoriesf',
'ARM REST: $armrestf',
'BACK HEIGHT: $back_height',
'BACK TYPE: $back_typef',
'CASTER: $casters1',
'CLIENT WEIGHT: $client_weight1',
'FRAME: $framecolour',
'FOOTREST: $foot_restf',
'HEADREST: $headrestf',
'NOTES: $notes',
'REAR WHEEL: $rear_wheels1',
'SEAT DEPTH: $seat_depthf',
'SEAT WIDTH: $seat_widthf',
'BACK: $seatingf',
'CUSHION: $seating_cushionf',
'STF: $seattofloor',
'STP',
'WHEEL LOCK:$wheel_lockf',
'$uniqueid',
'$visitor_email')";



  mysqli_select_db('i4252965_scrm2');
            $retval = mysql_query( $sql, $conn );
            
    
            
            if(! $retval ) {
               die('Could not enter data: ' . mysqli_error());
            }
            
            echo "Entered data successfully\n";
            
            mysql_close($conn);

//<== ===================================================================================================================================== ==>


$host = "smtpout.secureserver.net";
$username = "orderdesk@powerplusmobility.com";
$password = "Powerplus1";
$port = "80";
$to = "orderdesk@powerplusmobility.com";
//$to = "orderdesk@powerplusmobility.com, $visitor_email";
$email_from = "$visitor_email";
$email_subject = "REF $uniqueid STP Online Quote";
$email_body = "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Untitled Document</title>
<style type='text/css'>


}
.A {
	font-family: 'Arial Black', Gadget, sans-serif;
	font-size: 14px;
}
.A strong {
	font-size: 24px;
}
.B {
	font-family: Arial, Helvetica, sans-serif;
}
.B {
	font-family: Arial, Helvetica, sans-serif;
}
.A {
	font-family: 'Arial Black', Gadget, sans-serif;
}
.A th {
	font-size: 16px;
}
.SS {
	font-size: 12px;
}
.centercell {
	text-align: center;
}
.cellitem {
	font-family: Arial, Helvetica, sans-serif;
}
.cellsize {
	font-size: 12px;
}
.aa {
	font-size: 16px;
}
.eee {
	text-align: left;
}
.A {
	text-align: center;
}
.aa {
	text-align: center;
}
.sasd {
	text-align: center;
}
</style>


</head>

<body onload='myFunction()'>



<table width='40%' height='1568' border='1' align='center'>
  <tr>
    <th height='1562' scope='row'><table width='353' height='69' border='0' align='center'>
      <tr>
        <th scope='row'><img src='./css/power-plus=mobility.5b4f4170a235f9.83204104.jpg' alt='Power Plus Mobility Inc. Logo' width='250' height='72' /></th>
      </tr>
    </table>
      <p>Online Quote Confirmation</p>
      <table width='425' border='0' align='left'>
        <tr>
          <td width='419' height='20' scope='row'><h1 class='A'><strong>Power Plus Mobility Inc.</br>
          </strong></h1>
            <h3><br />
              <span class='B'>208 Wilkinson Road </br>
                <br />
                Brampton ON L6T4M4</br>
                <br />
                Phone: (905) 614-0333 Fax: (905) 614-0435</span></h3></td>
        </tr>
      </table>
      <table width='377' border='0' align='right'>
        <tr>
          <td width='367' height='174' scope='row'><h1 class='A'><strong>Quote Confirmation</strong></h1>
            <h3 class='B'>Quote Date:$ppmdate</h3>
            <h3 class='B'> Name: $firstname, $lastname<br />
            Company Name: $companyname</h3>
            <p>&nbsp;</p></td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <table width='356' height='89' border='2' align='center'>
        <tr class='SS' style='font-weight: bold; font-family: Arial, Helvetica, sans-serif;'>
          <th width='156' scope='row'>Reference Number</th>
          <td width='182' align='center'>Email</td>
        </tr>
        <tr>
          <th scope='row'>$uniqueid</th>
          <td class='sasd'> $visitor_email</td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <table width='933' border='1' align='center'>
        <tr>
          <th width='704' align='center' scope='row'>PART NUMBER DESCRIPTION</th>
          <td width='99' align='center'>UOM</td>
          <td width='108' align='center'>QUANTITY</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Frame Colour: $framecolour</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Custom Frame Colour: $customframecolor</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Client weight: $client_weight1 </th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Seat width: $seat_widthf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>If custom seat width:</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Seat Depth:  $seat_depthf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>

        <tr>
          <th class='eee' scope='row'>Foot Rest: $foot_restf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Size of Custom Nylon Leg Strap? $nylon_strap</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Pivot or Pin: $pin_pivot1</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Back Type: $back_typef</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Back Width: $back_width</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Back Height: $back_height</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Width of Endomorph Canes? $endomorph_width</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Headrest: $headrestf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Arm Rest: $armrestf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Rear Wheels: $rear_wheels1</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Seat to Floor: $seattofloor</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Casters: $casters1</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Wheel Lock: $wheel_lockf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Seating Back: $seatingf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'><p>Back Width: $back_width</p>
            <p>Back Custom Width: $back_customwidth</p></th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'><p>Back Height: $back_height</p>
            <p>Back Custom Height: $back_customdepth</p></th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Seating Cushion: $seating_cushionf</th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'><p>Accessories: $accessoriesf</p>
            <p>Lap Tray Material (If Chosen): $laptraymaterial</p></th>
          <td class='centercell'>EA</td>
          <td class='centercell'>1</td>
        </tr>
        <tr>
          <th class='eee' scope='row'>Notes: $notes</th>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <th scope='row'>&nbsp;</th>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <table width='535' border='1' align='center'>
   <!--     <tr>
          <th width='243' scope='row'>Sub Total: </th>
          <td width='276' class='A'>$sub_total</td>
        </tr>
        <tr>
          <th scope='row'>Discount Structure Percentage:</th>
          <td class='A'>$discount_structure</td>
        </tr>-->
        <tr>
          <th scope='row'>MSRP:</th>
          <td class='A'>$total</td>
        </tr>
    </table>
    <p>Power Plus Mobility Inc. Welcome Home! All rights reserved 2020</p>
    <p><strong>NOTICE:</strong><strong> </strong>This e-mail message is confidential, subject  to copyright and may be privileged. Any unauthorized use or disclosure is  prohibited.<strong></strong></p>
   
<p>&nbsp;</p></th>
  </tr>
</table>
<p>&nbsp;</p>

</body>


</html>

".




//$email_from


$email_address = "orderdesk@powerplusmobility.com";
$headers = array ('From' => $email_from, 'To' => $to, 'Subject' => $email_subject, 'Reply-To' => $visitor_email, 'Content-type' => "text/html; charset=iso-8859-1");
$smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
$mail = $smtp->send($to, $headers, $email_body);



if (PEAR::isError($mail)) {
echo('<p>' . $mail->getMessage() . '</p>');
} else {
echo('<p>Message successfully sent!</p>');
//done. redirect to thank-you page.
header('Location: /online-order-forms/ext/thank-you/thank-you.html');
}






//done. redirect to thank-you page.

?>