|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/duvallgroupweb/ |
Upload File : |
<!DOCTYPE html>
<HTML>
<HEAD>
<meta name="viewport" content="width=device-width, initial-scale=1">
<STYLE>
p{
font-size:25px;
font-family:Arial;
}
</STYLE>
</HEAD>
<BODY>
<div class="maindiv">
<center><H1>ONLINE ORDER CONFIRMATION</H1></center>
<p>The following data posted succesfully:</p>
<?php
class OnlineShirtOrder {
public $orderDate;
public $orderFName;
public $orderLName;
public $orderEmail;
public $orderAddress;
public $orderCity;
public $orderState;
public $orderZipCode;
public $orderPlan;
public $orderUniversity;
public $orderSize;
public $orderCost;
public $orderColor;
public $mailFrom;
public $mailTo;
public $mailSubject;
public $mailBody;
function __construct($orderDate,$orderFName,$orderLName,$orderEmail,$orderAddress,$orderCity,$orderState,$orderZipCode,$orderPlan,$orderUniversity,$orderSize,$orderCost,$orderColor,
$mailFrom,$mailTo,$mailSubject, $mailBody )
{
$this->orderDate=$orderDate;
$this->orderFName=$orderFName;
$this->orderLName=$orderLName;
$this->orderEmail=$orderEmail;
$this->orderAddress=$orderAddress;
$this->orderCity=$orderCity;
$this->orderState=$orderState;
$this->orderZipCode=$orderZipCode;
$this->orderPlan=$orderPlan;
$this->orderUniversity=$orderUniversity;
$this->orderSize=$orderSize;
$this->orderCost=$orderCost;
$this->orderColor=$orderColor;
$this->mailFrom=$mailFrom;
$this->mailTo=$mailTo;
$this->mailSubject=$mailSubject;
$this->mailBody=$mailBody;
}
function emailConfirm($mailTo, $mailSubject, $mailBody,$mailFrom )
{
mail($mailTo, $mailSubject,$mailBody,$mailFrom);
}
}
$postDate=$_POST['orderDate'];
$postFName=$_POST['fName'];
$postLName=$_POST['lName'];
$postEmail=$_POST['email'];
$postAddress=$_POST['address'];
$postCity=$_POST['city'];
$postState=$_POST['state'];
$postZipCode=$_POST['zipCode'];
$postPlan=$_POST['hiddenPlanType'];
$postUniversity=$_POST['university'];
$postSize=$_POST['shirtSize'];
$postCost=$_POST['currentPrice'];
$postColor=$_POST['shirtColor'];
$postFrom="From: [email protected]";
$postTo=$postEmail;
$postSubject="Confirming Your Shirt Order";
$postBody="Dear ".$postFName."\n\r\n\rThis is to confirm your order for your shirt(s) under the ".$postPlan." plan for your school at ".$postUniversity." at
cost of $".$postCost.".\n\rWe thank you for your business.";
$newOrder=new OnlineShirtOrder($postDate,$postFName,$postLName,$postEmail,$postAddress,$postCity,$postState,$postZipCode,$postPlan,$postUniversity,$postSize,$postCost,$postColor,
$postFrom, $postTo,$postSubject, $postBody);
$mailBody="Dear " . $_POST['fName'] . " " . $_POST['lName'] . "\n\rThis is to confirm that we received your order for the " . $_POST['shirtSize'] . " size sport shirt for $". $_POST['currentPrice'] . " under the " . $_POST['hiddenPlanType'] . " plan for the school of " . $_POST['university'] . ".\n\rWe greatly appreciate your business.";
$newOrder->emailConfirm($_POST['email'], "Your SmartIDentity Shirt Order Purchase Confirmed",$mailBody,"From: [email protected]");
echo "DATE: ".$newOrder->orderDate."<br>";
echo "NAME: ".$newOrder->orderFName." ".$newOrder->orderLName."<br>";
echo "EMAIL: ".$newOrder->orderEmail."<br>";
echo "ADDRESS: ".$newOrder->orderAddress."<br>";
echo "CITY: ".$newOrder->orderCity."<br>";
echo "STATE: ".$newOrder->orderState."<br>";
echo "ZIP CODE: ".$newOrder->orderZipCode."<br>";
echo "PLAN: ".$newOrder->orderPlan."<br>";
echo "UNIVERSITY: ".$newOrder->orderUniversity."<br>";
echo "SIZE: ".$newOrder->orderSize."<br>";
echo "COST: ".$newOrder->orderCost."<br>";
echo "COLOR: <input type='color' name='shirtColor' value='".$newOrder->orderColor."'><br>";
echo "<p>We emailed your confirmation to ".$postTo.".";
//chmod("onlineOrders.csv",0644);
//$onlineOrdersFile=fopen("onlineOrders.csv", "a+");
$orderRecord=$_POST['orderDate'].','.$_POST['fName'].','.$_POST['lName'].','.$_POST['email'].','.$_POST['address'].','.$_POST['city'].','.$_POST['state'].','.$_POST['zipCode'].','.$_POST['hiddenPlanType'].','.$_POST['university'].','.$_POST['shirtSize'].','.$_POST['currentPrice'].','.$_POST['shirtColor'];
//$onlineOrdersFile.fwrite($onlineOrdersFile,$orderRecord."\n");
//fclose($onlineOrdersFile);
$xmlOrdersFile="onlineOrders.xml";
$xmlDom=simplexml_load_file($xmlOrdersFile);
$ordersNode=$xmlDom->addChild("OnlineOrder");
$ordersNode->addChild("Date",$_POST['orderDate']);
$ordersNode->addChild("FirstName",$_POST['fName']);
$ordersNode->addChild("LastName",$_POST['lName']);
$ordersNode->addChild("Email",$_POST['email']);
$ordersNode->addChild("Address",$_POST['address']);
$ordersNode->addChild("City", $_POST['city']);
$ordersNode->addChild("State", $_POST['state']);
$ordersNode->addChild("Zip",$_POST['zipCode']);
$ordersNode->addChild("Plan",$_POST['hiddenPlanType']);
$ordersNode->addChild("University",$_POST['university']);
$ordersNode->addChild("Size",$_POST['shirtSize']);
$ordersNode->addChild("Cost", $_POST['currentPrice']);
$ordersNode->addChild("Color",$_POST['shirtColor']);
$xmlDom->saveXML($xmlOrdersFile);
?>
<H4>MAKE YOUR PAYMENT NOW</h4>
<!-- Include the PayPal JavaScript SDK; replace "test" with your own sandbox Business account app client ID -->
<script src="https://www.paypal.com/sdk/js?client-id=AT1gTR267PynJXY1gj_bSzXPtmctOAp-bYHriHCYzPKtrg4uzgiotEjVwVhZ8h5nUXrbXaJtpId3a9B-&locale=en_US&commit=true&disable-funding=credit"></script>
<!-- Set up a container element for the button -->
<div id="paypal-button-container" style="width:25px;"></div>
<script>
paypal.Buttons({
style: {
size: 'small',
color: 'gold',
shape: 'pill',
label: 'paypal'
},
env: 'production',
client: {
sandbox: 'AaFNtW6JSCtwf28tV2Rnxux8NJcvdLzORV7kcaUGAgA2sf2pLr2WWs-qC4mM-MNeToDacCpBZg_7sBXS',
// production: 'AT4u_rekD2BVfhiOp3s-K8GXSpKxb1u-qciUv_PHzO8Ok0JVZLzvalg8Nq1fwbrpOsA5KpU5iIlYNB5g'
production: 'AT1gTR267PynJXY1gj_bSzXPtmctOAp-bYHriHCYzPKtrg4uzgiotEjVwVhZ8h5nUXrbXaJtpId3a9B-'
},
locale: 'en_US',
// Sets up the transaction when a payment button is clicked
createOrder: function(data, actions) {
// Set up the transaction
return actions.order.create({
purchase_units: [{
amount: {
<?php if( !empty($_POST['fName']) && !empty($_POST['lName']) && !empty($_POST['email']) && !empty($_POST['address']) && !empty($_POST['city']) && !empty($_POST['state']) && !empty($_POST['zipCode']) && !empty($_POST['hiddenPlanType']) && !empty($_POST['university']) && !empty($_POST['shirtSize']) && !empty($_POST['currentPrice']) && !empty($_POST['shirtColor']) ) //&& !empty($_POST['email']) && !empty($_POST['address']) && !empty($_POST['city']) && !empty($_POST['state']) && !empty($_POST['zipCode']) && !empty($_POST['hiddenPlanType']) && !empty($_POST['university']) && !empty($_POST['shirtSize']) && !empty($_POST['currentPrice']) && !empty($_POST['shirtColor'])
{
echo 'value: ' . $_POST['currentPrice'] . '';
} else {
echo 'value: 10';
}
?>
}
}]
});
},
// Finalize the transaction after payer approval
onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
// Successful capture! For dev/demo purposes:
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
var transaction = orderData.purchase_units[0].payments.captures[0];
// alert('Transaction '+ transaction.status + ': ' + transaction.id + '\n\nSee console for all available details');
// When ready to go live, remove the alert and show a success message within this page. For example:
// var element = document.getElementById('paypal-button-container');
// element.innerHTML = '';
// element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
alert('Transaction completed by <?php echo "" . $_POST['fName'] . " " . $_POST['lName']; ?>');
});
}
}).render('#paypal-button-container');
</script>
<center>
<!-- <a href="SmartIdentityOrderForm.php" style="font-size:30px;">back to order form</a><br><br> -->
<a href="Index.html" style="font-size:30px;">Home Page</a>
</center>
</div>
</BODY>
</HTML>