Example #1
0
error_reporting(E_ALL);
ini_set('display_errors', 'On');
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
if (session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/CustomerManager.php";
$customerMgr = new CustomerManager();
$customer_id = $_SESSION["userid"];
$customer = $customerMgr->getCustomer($customer_id);
$operation = filter_input(INPUT_POST, 'operation');
if ($operation === 'change_information') {
    $first_name = filter_input(INPUT_POST, 'first_name');
    $last_name = filter_input(INPUT_POST, 'last_name');
    $email = filter_input(INPUT_POST, 'email');
    $contact_no = filter_input(INPUT_POST, 'contact_no');
    $errors = '';
    if (strpos($email, '@') === false) {
        $errors = 'Invalid email address!';
    }
    if ($errors === '') {
        $customerMgr->updateCustomer($customer_id, $customer['password'], $email, $first_name, $last_name, $contact_no, $customer['credit']);
        header("Location:account.php");
        echo 'jalat';
    } else {
Example #2
0
<?php

include './protect.php';
include_once "./Manager/CustomerManager.php";
include_once "./Manager/AddressManager.php";
include_once "./Manager/ConnectionManager.php";
$customerMgr = new CustomerManager();
$addressMgr = new AddressManager();
$customer = $customerMgr->getCustomer($_SESSION["userid"]);
$customer_credits = $customerMgr->getCredit($_SESSION["userid"]);
$customer_id = $customer['customer_id'];
$username = substr($customer_id, 0, strpos($customer_id, "@"));
$invitation_link = $_SERVER['SERVER_NAME'] . '/allocacoc/' . $customer['invitation_link'];
$address_list = $addressMgr->getAddress($customer_id);
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="./public_html/js/ZeroClipboard.js" ></script>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
        <link rel="stylesheet" href="./public_html/css/main.css">
        <style>
            #credit_content {
                position: relative;
Example #3
0
//Pass back the data to `form.php`
// get the user FB ID if login using FB
$fbId = addslashes(filter_input(INPUT_POST, 'fbId'));
$random_no = (string) rand(0, 10000000000);
$invitation_link = 'invite.php?src=' . $random_no;
$pwd = addslashes(filter_input(INPUT_POST, 'pwd'));
$pwdConfirm = addslashes(filter_input(INPUT_POST, 'pwdConfirm'));
$form_data['success'] = true;
$email = addslashes(filter_input(INPUT_POST, 'email'));
$fbFirst = true;
//$register_location = '';
if ($pwd != $pwdConfirm) {
    $form_data['success'] = false;
    $form_data['errors'] = "password re-entered is not matched!";
} else {
    $customer = $customerMgr->getCustomer($email);
    if ($customer !== []) {
        $form_data['success'] = false;
        $form_data['errors'] = "The email has been registered!";
        $form_data['email'] = $email;
        $form_data['pwd'] = $pwd;
        $form_data['pwdConfirm'] = $pwdConfirm;
    }
}
$verify = "false";
if ($form_data['success'] == "true") {
    //add into database
    $customerMgr->addCustomer($email, $pwd, $email, 0.0, $invitation_link, $verify);
    //send email to email
    $activation_code = md5($random_no);
    $message = "To activate your account, please click on the link:\n\n";