session_save_path("/home/users/web/b1244/ipw.gmagames/phpsessions");
session_start();
?>
if (!isset($_POST['submit'])){
?>
}
if (isset($_POST['submit'])){
$user = $_POST['user'];
$_SESSION['user'] = $user;
if(!empty($user)){
if (strlen($user) < 4 || !is_numeric($user)){
$_SESSION['incorrectuc'] = 'true';
$abletobuy = 'false';
}
else
{
$_SESSION['incorrectuc'] = 'false';
}
}
$email = $_POST['email'];
$fname =$_POST['fname'];
$_SESSION['fname'] = $fname;
$lname =$_POST['lname'];
$_SESSION['lname'] = $lname;
$_SESSION['method'] = $_POST['method'];
$comments = $_POST['comments'];
$_SESSION['comments'] = $_POST['comments'];
$phone = $_POST['phone'];
$_SESSION['phone'] = $phone;
$ccname = $_POST['ccname'];
$_SESSION['paytype']=$_POST['method'];
$_SESSION['ccname'] = $ccname;
$name = $_POST['name'];
$_SESSION['name'] = $name;
$cc =$_POST['cc'];
$_SESSION['cc'] = $cc;
$street = $_POST['street'];
$_SESSION['street'] = $street;
$city = $_POST['city'];
$_SESSION['city'] = $city;
$location = $_POST['loc'];
$_SESSION['email'] = $email;
$_SESSION['loc'] = $location;
if (empty($_SESSION['country'])){//250
$_SESSION['country'] = $_POST['country'];
}
$country = $_SESSION['country'];
if ($country == "Please Select Country"){
$country = "";
}
$pzip = $_POST['pzip'];
$_SESSION['pzip'] = $pzip;
$cd = $_POST['cd'];
$_SESSION['sodc'] = $_POST['sodc'];
$_SESSION['sod'] = $_POST['sod'];
$_SESSION['lw'] = $_POST['lw'];
$_SESSION['gmatc'] = $_POST['gmatc'];
$_SESSION['pt'] = $_POST['pt'];
$_SESSION['vipm'] = $_POST['vipm'];
$_SESSION['t2000'] = $_POST['t2000'];
$_SESSION['cd'] = $_POST['cd'];
$_SESSION['buttoncheck'] = $_POST['submit'];
$edy =$_POST['edy'];
$edm =$_POST['edm'];
$_SESSION['edy'] = $edy;
if (($edy < date(y) || ($edy == date(y) && $edm < date(m)) || !is_numeric($edm) || !is_numeric($edy)|| $edy<0 || $edm<0) && $_SESSION['method'] != "paypal"){
$abletobuy = "false";
$_SESSION['incorrectyear'] ="true";
}
else
{
$_SESSION['incorrectyear'] = 'false';
}
for($g=0;$g<=2;$g++)
{
if ($edm{$g} == "." || $edm{$g} == ",")
{
$abletobuy = "false";
$_SESSION['incorrectmonth'] ='true';
}
}
for($i=0;$i<=2;$i++)
{
if ($edy{$i} == "." || $edy{$i} == ",")
{
$abletobuy = "false";
$_SESSION['incorrectyear'] ="true";
}
}
if ($edm > 12)
{
$abletobuy = "false";
$_SESSION['incorrectmonth'] ="true";
}
else
{
$_SESSION['incorrectmonth'] = 'false';
}
$_SESSION['edm'] = $edm;
if (empty($fname) || empty($lname) || empty($phone)){
$abletobuy = "false";
}
if ((strlen($cc) < 16 || !is_numeric($cc) || ($cc{1} > 5&&$cc{1}< 4)) && $_SESSION['method'] != "paypal")
{
$abletobuy = "false";
$_SESSION['cctrue'] = "true";
}
if (empty($cc) && $_SESSION['method'] != "paypal")
{
$abletobuy ="false";
}
if((isset($_POST['cd']) && empty($city)) || (isset($_POST['cd']) && empty($street)) || (isset($_POST['cd']) && empty($country))){
$abletobuy = "false";
}
if (isset($_POST['sod'])){
$games = $games . " " . "Shades of Doom";
$count = $count + 1;
$cost = $cost + 35;
}
if (isset($_POST['sodc'])){
$games = $games . " " . "Shades of Doom Cheats";
$cost = $cost + 5;
}
if (isset($_POST['lw'])){
$games = $games . " " . "Lone Wolf";
$count = $count + 1;
$cost = $cost + 30;
}
if (isset($_POST['pt'])){
$games = $games . " " . "Pacman Talks";
$count = $count + 1;
$cost = $cost + 30;
}
if (isset($_POST['gmatc'])){
$games = $games . " " . "GMA Tank Commander";
$count = $count + 1;
$cost = $cost + 35;
}
if (isset($_POST['t2000'])){
$games = $games . " " . "Trek 2000";
$count = $count + 1;
$cost = $cost + 25;
}
if ($count == 3)
{$cost = 75;}
if ($count == 4)
{$cost = 95;}
if ($count == 5)
{$cost = 110;}
if ($count > 2 && isset($_POST['sodc'])){
$cost = $cost +5;
}
if (isset($_POST['cd'])){//350
$cost = $cost + 10;
$games = $games . " " . " on CD";
}
if (isset($_POST['vipm'])){
$games = $games . " " . "VIP Mud";
$cost = $cost + 30;
}
if (isset($_POST['cd'])){
$cdtrue = "yes";
}
else {
$cdtrue = "no";
}
if($abletobuy == "false"){
echo "Sorry, but there is missing or invalid information";
$_SESSION['counter'] += 1;
?>
BACK
}
if ($abletobuy != "false"){
$CryptValue = array('0', 'BDJZOWRMAL', 'ZYVOEFHGAB', 'MJDLSURIXC');
for ($i = 1; $i <= 16; $i++){
$letter = $cc{($i - 1)};
$j = ($i % 3) + 1;
$outCC = $outCC . $CryptValue[$j]{$letter};
}
$ed = $edm . $edy;
$CryptValue1 = array('0', 'BDJZOWRMAL', 'ZYVOEFHGAB', 'MJDLSURIXC');
for ($e = 1; $e <= 4; $e++){
$letter1 = $ed{($e - 1)};
$j1 = ($e % 3) + 1;
$outED = $outED . $CryptValue1[$j1]{$letter1};
}
if ($cdtrue == "yes" && $_SESSION['method'] == "CreditCard"){
$message = <<";
Echo "The Games wanted are - $games";
$_SESSION['totalcost']=$cost;
$_SESSION['games']=$games;
if ($_SESSION['method'] == "paypal")
{
Echo "
After confirming, Remember to pay for this order through the paypal link on the next page. It is important as we can not process your order without payment.";
}
?>