Exemple #1
0
 echo "Email = " . $_POST['emailOrder'] . "\n";
 echo "Phone = " . $_POST['phoneNumberOrder'] . "\n";
 echo "Order Notes = " . $_POST['orderNotes'] . "\n";
 echo "Items: \n";
 $numArray = array_count_values($_SESSION['cart']);
 //get the carts contents
 getUserData::convertIdToItem($numArray, true);
 //echo total
 echo "Total = \$" . $_SESSION['cartTotal'];
 //Get data from output buffer
 $output = ob_get_clean();
 //Santize string just in case
 $output = filter_var($output, FILTER_SANITIZE_STRING);
 //Sends all this information to the sendEmail function. Parameters are as follows:
 //Who to send to, Subject, Body
 sendEmail::EmailStore("*****@*****.**", "New Order", $output);
 //Start the second email function for the customers email
 ob_start();
 //Email title/header
 echo "Online Order Details:\n";
 //Get all the details for the email body
 echo "First Name = " . $_POST['firstNameOrder'] . "\n";
 echo "Last Name = " . $_POST['lastNameOrder'] . "\n";
 echo "Email = " . $_POST['emailOrder'] . "\n";
 echo "Phone = " . $_POST['phoneNumberOrder'] . "\n";
 echo "Order Notes = " . $_POST['orderNotes'] . "\n";
 echo "Items: \n";
 $numArray = array_count_values($_SESSION['cart']);
 //Get the carts contents
 getUserData::convertIdToItem($numArray, false);
 //Echo the total of the order