コード例 #1
0
ファイル: verify.php プロジェクト: jackyFeng/unisol
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/ProductManager.php";
include_once "./Manager/CustomerManager.php";
include_once "./Manager/CreditManager.php";
$customerMgr = new CustomerManager();
$creditMgr = new CreditManager();
$productMgr = new ProductManager();
$email = '';
$key = '';
if (isset($_GET['email'])) {
    $email = $_GET['email'];
}
if (isset($_GET['key'])) {
    $key = $_GET['key'];
}
$invitation_link = $customerMgr->getInvitationLink($email);
$retrieved_key = substr($invitation_link, strpos($invitation_link, "=") + 1);
if (md5($retrieved_key) === $key) {
    session_start();
    $customerMgr->activateAccount($email);
    $_SESSION["userid"] = $email;
    $form_data['status'] = 'success';
    $form_data['message'] = "";
    //Add credit to the new signed-up account if there is credit sender information in session
    if (isset($_COOKIE["sender_email"])) {
        $sender_email = $_COOKIE["sender_email"];
        $creditMgr->addCredit($sender_email, $email);
コード例 #2
0
ファイル: account.php プロジェクト: jackyFeng/unisol
<?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;
コード例 #3
0
ファイル: process_customer.php プロジェクト: jackyFeng/unisol
<?php

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';
コード例 #4
0
ファイル: process_login.php プロジェクト: jackyFeng/unisol
 * 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.
 */
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/ProductManager.php";
include_once "./Manager/CustomerManager.php";
include_once "./Manager/CreditManager.php";
$errors = array();
//To store errors
$form_data = array();
//Pass back the data to `form.php`
/* Validate the form on the server side */
$userid = addslashes(filter_input(INPUT_POST, 'userid'));
$pwd = addslashes(filter_input(INPUT_POST, 'pwdInput'));
$customerMgr = new CustomerManager();
$customer = $customerMgr->getCustomerByIDPassword($userid, $pwd);
$creditMgr = new CreditManager();
$productMgr = new ProductManager();
session_start();
//echo mysql_num_rows($resultSet);
if ($customer !== []) {
    $form_data['success'] = true;
    $_SESSION["userid"] = $userid;
    if (isset($_COOKIE["sender_email"])) {
        $sender_email = $_COOKIE["sender_email"];
        if ($sender_email !== $userid) {
            $has_received = $creditMgr->checkInvitationStatus($sender_email, $userid);
            if ($has_received === null) {
                $creditMgr->addCredit($sender_email, $userid);
                $customerMgr->updateCredit($userid, 10.0);
コード例 #5
0
ファイル: coupon_email.php プロジェクト: jackyFeng/unisol
<?php

if (session_status() != PHP_SESSION_ACTIVE) {
    // session_start();
}
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/CustomerManager.php";
$customerMgr = new CustomerManager();
$receiver_id = $_SESSION["userid"];
$sender_first_name = $customerMgr->getFirstName($receiver_id);
$sender_last_name = $customerMgr->getLastName($receiver_id);
// $sender_name = $sender_first_name." ".$sender_last_name;
$to = filter_input(INPUT_POST, 'send_email_address');
$invitation_link = filter_input(INPUT_POST, 'invitation_link');
//$to = "*****@*****.**";
//$to = "*****@*****.**";
//$to = "*****@*****.**";
//$to = "*****@*****.**";
$sender_name = "Issac Zhai";
$subject = $sender_name . " has just given you \$10 Credits";
$message = '<html>
	<body style="margin: 0; padding: 0;">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">	
            <tr>
                <td style="padding: 10px 0 30px 0;">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border: 1px solid #cccccc; border-collapse: collapse;">
                        <tr>
                            <td align="center">
                                <a href="' . strip_tags($invitation_link) . '"><img src="https://s3-ap-southeast-1.amazonaws.com/allocacocvideo/Standard+Romantic.png" alt="" width="600" height="300" style="display: block;" /></a>
                            </td>
                        </tr>
コード例 #6
0
ファイル: print.php プロジェクト: jackyFeng/unisol
<?php

require 'fpdf17/fpdf.php';
include 'fpdf17/php-barcode.php';
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/ProductManager.php";
include_once "./Manager/CustomerManager.php";
include_once "./Manager/OrderManager.php";
include_once "./Manager/AddressManager.php";
$productMgr = new ProductManager();
$customerMgr = new CustomerManager();
$orderMgr = new OrderManager();
$addressMgr = new AddressManager();
// -------------------------------------------------- //
//                  GET ORDER INFORMATION
// -------------------------------------------------- //
$order_id = implode("", $_POST);
$orderList = $orderMgr->getPendingOrder();
$order = [];
//var_dump($orderList);
foreach ($orderList as $o) {
    if ($o["order_id"] === $order_id) {
        $order = $o;
    }
}
//$order = $orderList[$order_id];
//var_dump($order);
class eFPDF extends FPDF
{
    function TextWithRotation($x, $y, $txt, $txt_angle, $font_angle = 0)
    {
コード例 #7
0
ファイル: process_FB_login.php プロジェクト: jackyFeng/unisol
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/ProductManager.php";
include_once "./Manager/CustomerManager.php";
include_once "./Manager/CreditManager.php";
$errors = array();
//To store errors
$form_data = array();
//Pass back the data to `form.php`
$fbId = addslashes(filter_input(INPUT_POST, 'fbId'));
$email = addslashes(filter_input(INPUT_POST, 'email'));
$random_no = (string) rand(0, 10000000000);
$invitation_link = 'invite.php?src=' . $random_no;
$customerMgr = new CustomerManager();
$creditMgr = new CreditManager();
$form_data['success'] = true;
$fbFirst = true;
$customer_fb = $customerMgr->getCustomerByIDPassword($email, $fbId);
$pwd = $fbId;
$pwdConfirm = $fbId;
if (!empty($customer_fb)) {
    $fbFirst = false;
} else {
    // add user to the database
    $customerMgr->addCustomer($email, $pwd, $email, 0.0, $invitation_link);
}
session_start();
//echo mysql_num_rows($resultSet);
$form_data['success'] = true;
コード例 #8
0
ファイル: invite.php プロジェクト: jackyFeng/unisol
<?php

include_once './Manager/ConnectionManager.php';
include_once './Manager/CustomerManager.php';
include_once './Manager/CreditManager.php';
/* 
 * 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.
 */
$customerMgr = new CustomerManager();
$creditMgr = new CreditManager();
if (isset($_GET['src']) && !empty($_GET['src'])) {
    #Construct sender invitation link
    $invitation_link = 'invite.php?src=' . $_GET['src'];
    #get sender information
    $sender = $customerMgr->getCustomerByInvitationLink($invitation_link);
    if ($sender === []) {
        #Situation 2: no such invitation exist. Redirect to index page with popup message
        $status = 'error';
        $message = "There's error in your friend's referral!";
        header("Location: index.php?status={$status}&message={$message}");
        exit;
    }
    session_start();
    $receiver_email = null;
    $sender_email = $sender['customer_id'];
    if (!empty($_SESSION["userid"])) {
        #Situation 3: browser contains login information
        $receiver_email = $_SESSION["userid"];
        if ($receiver_email == $sender_email) {
コード例 #9
0
 public static function setStoreConfig($config)
 {
     self::$storeConfig = $config;
 }
コード例 #10
0
ファイル: process_register.php プロジェクト: jackyFeng/unisol
<?php

/* 
 * 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.
 */
include_once "./Manager/ConnectionManager.php";
include_once "./Manager/ProductManager.php";
include_once "./Manager/CustomerManager.php";
include_once "./Manager/CreditManager.php";
$customerMgr = new CustomerManager();
$creditMgr = new CreditManager();
$errors = array();
//To store errors
$form_data = array();
//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 {
コード例 #11
0
ファイル: MagentoToVtex.php プロジェクト: vtex/MagentoToVtex
include 'Managers/StoreConfigManager.php';
include 'Helpers/Slug.php';
//Form
$storeConfig = StoreConfig::withPost($_POST);
//Manual run
//$storeConfigData = array(
//    'departmentId' => '',
//    'categoryId' => '',
//    'brandId' => '',
//    'name' => '',
//    'url' => '',
//    'dbHost' => '',
//    'dbName' => '',
//    'dbUser' => '',
//    'dbPass' => '',
//    'vtexUser' => '',
//    'vtexPass' => '',
//    'vtexAccountName' => '',
//    'magentoUser' => '',
//    'magentoPass' => '',
//    'productType' => ''
//);
//$storeConfig = StoreConfig::withData($storeConfigData);
StoreConfigManager::setStoreConfig($storeConfig);
foreach (CustomerManager::getList() as $customer) {
    CustomerManager::setCurrentCustomer($customer);
    CustomerManager::setStoreConfig($storeConfig);
    //BrandService::run();
    //CategoryService::run();
    ProductService::run();
}