<ul class="nav navbar-nav navbar-right"> <li><a href="home">Home</a></li> <li class="active"><a href="profile">Profile</a></li> <li><a href="logout">Log Out</a></li> </ul> </div> </div> </div> <div id="content"> <div id="main-content"> <?php $user_id = $_SESSION["user_id"]; if (isset($_POST["current_password"])) { if (isset($_POST["first_name"], $_POST["last_name"], $_POST["email"], $_POST["current_password"], $_POST["phone_number"], $_POST["address"], $_POST["password"], $_POST["confirm_password"])) { $update = updateProfile($user_id, $_POST); $update === true ? $update = UPDATE_PROFILE_SUCCESS : ($update = $update); # $update = ($update === true) ? UPDATE_PROFILE_SUCCESS : $update; $_SESSION["notice"] = $update; displayNotice(); } } $u = getFullUserById($user_id); $type = getUserTypeById($user_id); ?> <h4> Profile Information </h4> <form action="profile" id="profile-form" class="form-horizontal" method="post"> <div class="form-group"> <label class="control-label col-sm-3">Account Type: </label> <div class="col-sm-4" style="margin-top: 9px;"> <?php
<?php include_once "../services/connect.php"; include_once "../services/common.php"; $isUpdate = isset($isUpdate) ? $isUpdate : $_POST['myprofile_flag']; if ($isUpdate) { $user_id = isset($user_id) ? $user_id : $_POST['user_id']; $first_name = isset($first_name) ? $first_name : $_POST['first_name']; $last_name = isset($last_name) ? $last_name : $_POST['last_name']; $age = isset($age) ? $age : $_POST['age']; $user_id = checkId($user_id); $first_name = checkString($first_name); $last_name = checkString($last_name); $age = checkString($age); $update_result = updateProfile($user_id, $first_name, $last_name, $age); if ($update_result) { $response = '{"status": "ok", "message": "The user profile has been updated successfully!"}'; } else { $response = '{"status": "error", "message": "The user profile could not be updated. Please try again later."}'; } echo $response; } function updateProfile($user_id, $first_name, $last_name, $age) { $sql = sprintf("UPDATE user SET first_name = '%s', last_name = '%s', age = '%s' WHERE user_id = %d", $first_name, $last_name, $age, $user_id); return executeSql($sql); }
/* * check profile id is number * */ if (isset($_GET['id']) && !is_numeric($_GET['id'])) { die("Invalid Profile ID"); } /* * check user is editing their own profile * */ if (isset($_REQUEST['edit']) && $_SESSION['myProfileID'] != $_REQUEST['id'] || isset($_REQUEST['edit']) && isset($_SESSION['guest'])) { die("You do not have the correct permissions to edit this profile"); } /* * update user profile * */ if (isset($_POST['edit']) && isset($_SESSION['myProfileID'])) { $profileUpdated = updateProfile($_SESSION['myProfileID'], $_POST['profileRealname'], $_POST['profileAge'], $_POST['profileGender'], $_POST['uploadedfile'], $_POST['del'], $_POST['imgID'], $_POST['profileLocation'], $_POST['profileHobbies'], $_POST['profileAboutme'], $_POST['profilePass'], $_POST['profileEmail']); } /* * get user details * */ list($username, $realname, $age, $gender, $location, $hobbies, $aboutme, $imgID, $email) = userProfileInfo($_GET['id']); /* * include template * */ include "../templates/" . $CONFIG['template'] . "/profile.php";
<table align="center" width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="col"></th> </tr> <tr> <td> <!-----------------------Server Side Scripting begins---------------------------> <?php if ($action == "showprofile") { showProfile(); } else { if ($action == "editprofile") { editProfile(); } else { if ($action == "updateprofile") { updateProfile(); } else { verify(); } } } function verify() { global $tname, $t; include "dbconnect.php"; $query = "select * from team " . "where tname=\"{$tname}\""; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); mysql_free_result($result); mysql_close($conn); $user1 = $row['user1'];
<?php session_start(); require "pdo.php"; $userID = $_SESSION['userID']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $age = $_POST['age']; $gender = $_POST['gender']; $description = $_POST['description']; $status = updateProfile($userID, $firstName, $lastName, $age, $gender, $description); if ($status == 1) { $_SESSION["firstName"] = $firstName; } echo $status;
default: showIndex(); exit; break; // update per user settings // update per user settings case "updateSettingsUser": updateSettingsUser(); break; case "updateProfile": $pass1 = getRequestVar('pass1'); $pass2 = getRequestVar('pass2'); $hideOffline = getRequestVar('hideOffline'); $theme = getRequestVar('theme'); $language = getRequestVar('language'); updateProfile($pass1, $pass2, $hideOffline, $theme, $language); break; // Show main Cookie Management // Show main Cookie Management case "showCookies": case "editCookies": showCookies(); break; // Add a new cookie to user // Add a new cookie to user case "addCookie": $newCookie["host"] = getRequestVar('host'); $newCookie["data"] = getRequestVar('data'); addCookie($newCookie); break; // Modify an existing cookie from user
<?php session_start(); require "database/connect.php"; require "database/common.php"; require "database/users.php"; require "database/employees.php"; require "includes/common.php"; $pageTitle = "Profile"; require "includes/userHeader.php"; //load emp_id loadUser($_SESSION["id"]); //save profile if ($_POST["submitBtn"] == "Edit") { updateProfile($empID, $_POST["first"], $_POST["last"], $_POST["address"], $_POST["phone1"] . $_POST["phone2"], $_POST["email"]); if ($_POST["loginID"] > "") { saveLogin($empID, $_POST["loginID"], $_POST["loginPassword"]); $body = "Your account has been created / edited.<br />Username: "******"loginID"] . "<br />Password: "******"loginPassword"]; //mail("*****@*****.**", "Shift Scheduler Account Created", $body); } } //load profile loadEmployee($empID); padBegin(6, 6); ?> <table> <tr> <td align="right" nowrap>First Name</td> <td><input name="first" id="first" type="text" value="<?php echo $emp_first_name;
<?php session_start(); include 'library/config.php'; //include '../gl/a_gcash_sessions.php'; $method = $_GET['method']; switch ($method) { case 'addProfile': //FROM PROFILE API echo addProfile($conn); // --> break; case 'uppProfile': //FROM PROFILE API echo updateProfile($conn); // --> break; case 'addAccounts': //FROM ACCOUNTS API echo addToGcash_Accounts($conn); break; case 'updAccounts': //FROM ACCOUNTS API echo updateToGcash_Accounts($conn); break; case 'addLink': echo addLink($conn); break; case 'updLink': echo updLink($conn); break;
<?php include 'DBO.php'; include 'Authentication.php'; $connection = connectToDatabase(); $userId = $_SESSION['UNO']; $fname = $_GET['fname']; $lname = $_GET['lname']; $password = $_GET['password']; $result = updateProfile($connection, $userId, $fname, $lname, $password); echo json_encode($result);
<?php include '../../settings.php'; include '../../inc/login_functions.php'; include '../../inc/helper.php'; include 'functions.php'; $logedIn = access($mysqli); $userData = getUserData($mysqli, $_SESSION['userId']); $updateEmail = updateEmail($mysqli, $_SESSION['userId']); $updateProfile = updateProfile($mysqli, $_SESSION['userId']); $updatePassword = updatePassword($mysqli, $_SESSION['userId']); if ($updateProfile == 1 || $updatePassword == 1 || $updateEmail == 1) { header("Location: updateRedirect.php"); exit; } if ($updatePassword == 2 || $updateEmail == 2) { header("Location: ../../404.php"); exit; } include "../../inc/header.php"; include "../../inc/topNavbar.php"; ?> <section id="main-container"> <?php include "../../inc/leftNavbar.php"; ?> <!--Page main section start--> <section id="min-wrapper">
$edit_categories = true; } if ($row[3] == 1) { $post = true; } if ($row[0] == 1) { $edit = true; } if ($id != $_SESSION["user_id"] && !$post && !$edit && !$edit_categories && !$edit_groups) { mysql_close($link); $msg = $lang["not_authorized"]; header("Location: index.php?msg=" . $msg . "&id=" . $id . "&" . $common_get); } switch ($_REQUEST["mode"]) { case $lang["update_profile"]: updateProfile($id); break; case $lang["add_category"]: addCategory(); break; case $lang["edit_category"]: editCategory($id); break; case $lang["delete_category"]: deleteCategory($id); break; case $lang["add_group"]: addGroup(); break; case $lang["edit_group"]: editGroup($id);
<?php if (isset($_POST['action']) && isset($_GET['update'])) { $profile = array('profile_id' => $_GET['update'], 'firstname' => $_POST['fname'], 'lastname' => $_POST['lname'], 'middlename' => $_POST['mname'], 'mmname' => $_POST['mmname'], 'sex' => $_POST['sex'], 'type' => $_POST['type'], 'sssgsis' => $_POST['sssgsis'], 'sssgsis_number' => $_POST['sssgsis_number'], 'precinct' => $_POST['precinct'], 'phonenumber' => $_POST['phonenumber'], 'employee_id' => $_SESSION['user']['employee_id']); updateProfile($profile); } $profile = null; if (isset($_GET['update'])) { $profile = mysqli_fetch_object(getProfileByID($_GET['update'])); } ?> <section id="my-account-security-form" class="page container"> <form id="userSecurityForm" class="form-horizontal" action="" method="post"> <div class="container"> <div class="alert alert-block alert-info"> <p> Enter information for your account as desired. Fields marked with an asterisk are required. </p> </div> <div class="row"> <div id="acct-password-row" class="span7" style="width: 802px;"> <fieldset> <legend>BEI/BOC Form</legend><br> <div class="control-group "> <label class="control-label">First Name<span class="required">*</span></label> <div class="controls"> <input id="current-pass-control" name="fname" class="span4" type="text" value="<?php if ($profile) {
require_once dirname(__FILE__) . "/../../../include/master.inc.php"; $error = ""; $success = ""; if (!isLogin()) { redirect(BASEURL . "app/login.php"); } if (isset($_POST['edit_profile'])) { if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $error = "Invalid Email!"; } else { if (strlen($_POST['firstname']) < 2 || strlen($_POST['firstname']) > 255) { $error = "First Name too short/long"; } else { if (strlen($_POST['lastname']) < 2 || strlen($_POST['lastname']) > 255) { $error = "Last Name too short/long"; } else { if (!updateProfile($_SESSION['user']['id'], $_POST['firstname'], $_POST['lastname'], $_POST['email'])) { $error = "Email Already in used!"; } else { $success = "Profile Successfully Updated!"; } } } } } else { $error = "Invalid Request"; } $_SESSION['response']['edit_profile']['error'] = $error; $_SESSION['response']['edit_profile']['success'] = $success; redirect(BASEURL . "app/edit_profile.php");