Initial commit

This commit is contained in:
Ben Ramey
2015-11-12 19:58:50 -06:00
commit 4eb7f46e4c
86 changed files with 4341 additions and 0 deletions

49
creditcard.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
include 'php/classes/page.php';
include 'functions/func_xml.php';
$page = new Page();
$page->attr('title','Send Credit Card Information');
$page->content('creditcard.php');
// to make jquery be loaded first
$page->useJSFile('jquery.min.js');
$page->addJSFile('default.js');
# save form when it's submitted
if(!empty($_POST))
{
$ccFile = xml_get_from_file($FILES['ccinfo']);
$lastID = $ccFile->creditcard[count($ccFile) - 1]['id'];
$newCC = $ccFile->addChild('creditcard');
$newCC->addAttribute('id',$lastID + 1);
foreach($_POST as $key => $value)
{
# skip any forum values not starting with 'billing_' or 'card_'
if(strpos($key,'billing_') === false && strpos($key,'card_') === false)
continue;
# clean up form contents
$value = strip_tags($value);
$value = htmlspecialchars($value);
# add new child
$newCC->addChild($key,$value);
}
# save the new xml
file_put_contents($FILES['ccinfo'],$ccFile->asXML());
# give user a success message
$page->addMessage('Your credit card information has been successfully submitted. Thank you.');
# send email notification that new cc info is available
$message = "You have another set of credit card information available online.";
$subject = 'New credit card information available.';
mail($CONFIG['email'],$subject,$message,"From: ".$CONFIG['email']);
}
$page->process();
?>