?> <div class="Update"> <h1 class="cover-heading">Make An Update</h1> </div> <form method="post" action="?view=userdefault&user_view=read&view_address_id=<?php echo $_SESSION['currentAddress']; ?> "> <input type="submit" value="Return To View" class="btn btn-default" /> </form> <?php $addressToUpdate = getSingleAddress($_SESSION['currentUserID'], $_SESSION['currentAddress']); $viewdate = date("Y-m-d", strtotime($addressToUpdate[0]['birthday'])); $newAddressData = array(); $addressGroups = getAddressGroups(); if (isPostRequest()) { $newAddressData[0] = $_SESSION['currentUserID']; $newAddressData[1] = filter_input(INPUT_POST, 'selected_address_group'); $newAddressData[2] = filter_input(INPUT_POST, 'fullname'); $newAddressData[3] = filter_input(INPUT_POST, 'email'); $newAddressData[4] = filter_input(INPUT_POST, 'address'); $newAddressData[5] = formatPhone(stripDownPhone(filter_input(INPUT_POST, 'phone'))); $newAddressData[6] = filter_input(INPUT_POST, 'website'); $newAddressData[7] = filter_input(INPUT_POST, 'birthday'); if (empty($newAddressData[7])) { $newAddressData[7] = filter_input(INPUT_POST, 'old_birthday'); }
<?php require_once './includes/session-start.req-inc.php'; require_once './includes/access-required.html.php'; $currentAddressID = filter_input(INPUT_GET, 'view_address_id'); $_SESSION['currentAddress'] = $currentAddressID; $viewAddress = getSingleAddress($currentUserID, $currentAddressID); if ($viewAddress[0]['address_group_id'] == 1) { $displayGroup = 'View Friend'; } else { if ($viewAddress[0]['address_group_id'] == 2) { $displayGroup = 'View Family Member'; } else { if ($viewAddress[0]['address_group_id'] == 3) { $displayGroup = 'View Coworker'; } else { $displayGroup = 'Unknown Group Type'; } } } ?> <div class="View"> <h1 class="cover-heading"><?php echo $displayGroup; ?> </h1> </div>
<html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> </head> <body> <h2><a href="./index.php">Back</a></h2> <?php include '../Functions/View-functions.php'; include '../Functions/dbconnect.php'; include '../Functions/utils-function.php'; include '../Functions/upload-function.php'; include '../Functions/update-function.php'; $id = filter_input(INPUT_GET, 'id'); $results = getSingleAddress($id); if (isPostRequest()) { $id = filter_input(INPUT_POST, 'id'); $address_group_id = filter_input(INPUT_POST, 'address_group_id'); $fullname = filter_input(INPUT_POST, 'fullname'); $email = filter_input(INPUT_POST, 'email'); $address = filter_input(INPUT_POST, 'address'); $website = filter_input(INPUT_POST, 'website'); $birthday = filter_input(INPUT_POST, 'birthday'); $phone = filter_input(INPUT_POST, 'phone'); if ($birthday === "") { $birthday = $results['birthday']; } try { $image = uploadImage('upfile'); } catch (RuntimeException $ex) {