include 'functions/accountFunctions.php'; if (!is_array($_SESSION['UserSession'])) { header("Location:signin.php?checkErr=nLI"); // redirects and prompts the user to sign in if they already haven't, then once signed // in it will redirect them again back to here } if (!is_array($_SESSION['checkout'])) { header("Location:basket.php"); } if (empty($_SESSION['basket'])) { header("Location:myAccount.php"); } $paymentId = $_GET['id']; $remove = $_GET['rm']; if ($remove == 1) { deleteCard($paymentId, $_SESSION['UserSession'][0]['userId']); } // remove a payment option ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <?php if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { header('X-UA-Compatible: IE=edge,chrome=1'); } ?> <link rel="shortcut icon" href="images/favicon.ico"/> <!--[if IE]><link href="style/layoutIE.css" rel="stylesheet" type="text/css" /><![endif]--> <!--[if !IE]><!--><link rel="stylesheet" type="text/css" href="style/layout.css" /><!--<![endif]-->
<?php /** * Created by PhpStorm. * User: Kristaps * Date: 11/3/2015 * Time: 11:18 PM */ include 'functions.php'; if (isset($_POST['action']) && is_numeric($_POST['id'])) { if ($_POST['action'] == 'delete') { deleteCard($_POST['id']); echo 'apple'; } else { if ($_POST['action'] == 'toggle' && is_numeric($_POST['value'])) { toggleCardStatus($_POST['id'], $_POST['value']); echo 'apple'; } } } else { header("HTTP/1.0 404 Not Found"); }
} else { echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}"; } } else { if ($_REQUEST['unmark']) { $feature = "voteforcard"; if (CheckRights($_REQUEST['username'], $feature)) { unMarkCard($_REQUEST['thiscard'], $_REQUEST['username']); } else { echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}"; } } else { if ($_REQUEST['delete']) { $feature = "createcard"; if (CheckRights($_REQUEST['username'], $feature)) { deleteCard($_REQUEST['delete']); } else { echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}"; } } else { if ($_REQUEST['edit']) { $feature = "createcard"; if (CheckRights($_REQUEST['username'], $feature)) { editCard($_REQUEST['id'], $_REQUEST['cardname'], $_REQUEST['description']); } else { echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}"; } } else { $feature = "loadcards"; if (CheckRights($_REQUEST['username'], $feature)) { loadCards();