コード例 #1
0
}
if ($city == "") {
    $error["city"] = "has-error";
}
if ($state == "") {
    $error["state"] = "has-error";
}
if ($country == "") {
    $error["country"] = "has-error";
}
if (count($error) != 0) {
    $error_count++;
    $pages = array("userdata_details");
} else {
    $args = array("companyname" => $userdata["company"], "department" => $userdata["department"], "salutation" => $userdata["salutation"], "firstname" => $userdata["firstname"], "lastname" => $userdata["lastname"], "street" => $userdata["street"], "number" => $userdata["number"], "zip" => $userdata["zip"], "state" => $userdata["state"], "city" => $userdata["city"], "country" => $userdata["country"], "email" => $userdata["email"]);
    UserCtl::SetUserData(SessionCtl::GetSession(), $args);
    $payment_methods = PaymentCtl::GetPaymentMethods();
}
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("error", $error);
$tpl->assign("error_count", $error_count);
$tpl->assign("payment_methods", $payment_methods);
$tpl->assign("userdata", $userdata);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
コード例 #2
0
ファイル: init.inc.php プロジェクト: sleekshop/demoshop
include PROJECTPATH . "inc/libs/vitabytes/mailing.inc.php";
/* 
 * Including models and controllers
 */
include PROJECTPATH . "inc/categories.inc.php";
include PROJECTPATH . "inc/shopobjects.inc.php";
include PROJECTPATH . "inc/session.inc.php";
include PROJECTPATH . "inc/cart.inc.php";
include PROJECTPATH . "inc/user.inc.php";
include PROJECTPATH . "inc/order.inc.php";
include PROJECTPATH . "inc/payment.inc.php";
foreach ($_POST as &$value) {
    if (!is_array($value)) {
        $value = strip_tags(htmlspecialchars($value));
    }
}
foreach ($_GET as &$value) {
    $value = strip_tags(htmlspecialchars($value));
}
/* 
 * Setting up the menu
 */
if (unserialize(stripslashes($_COOKIE['menu'])) == NULL) {
    setcookie('menu', serialize(CategoriesCtl::GetCategories(CATEGORIES_ID)), time() + 7600);
}
$cart = CartCtl::Get(SessionCtl::GetSession());
$tpl->assign("menu", unserialize(stripslashes($_COOKIE['menu'])));
$tpl->assign("cart", $cart);
$tpl->assign("username", $_COOKIE['username']);
$tpl->assign("sitename", SITE_NAME);
$tpl->assign("request_uri", "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
コード例 #3
0
ファイル: add_to_cart.php プロジェクト: sleekshop/demoshop
 */
$pages = array("cart");
/* 
 * Controller routines
 */
$id_product = $_POST["id_product"];
$quantity = $_POST["quantity"];
$size_txt = $_POST["size_txt"];
$pic = $_POST["pic"];
if ($size_txt != "") {
    $price = $_POST["price"];
    $name = $_POST["name"];
    $short_description = $_POST["short_description"] . " - " . $size_txt;
    $res = CartCtl::Add(SessionCtl::GetSession(), $id_product, $quantity, $price, $name, $short_description, DEFAULT_LANGUAGE, "FREE_ELEMENT", 0, array(array("lang" => DEFAULT_LANGUAGE, "name" => "pic", "value" => $pic)));
} else {
    $res = CartCtl::Add(SessionCtl::GetSession(), $id_product, $quantity, "price", "name", "short_description", DEFAULT_LANGUAGE, "PRODUCT", 0, array(array("lang" => DEFAULT_LANGUAGE, "name" => "pic", "value" => $pic)));
}
$tpl->assign("cart", $res);
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("res", $res);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
$tpl->draw("head");
$tpl->draw("content");
コード例 #4
0
ファイル: login_request.php プロジェクト: sleekshop/demoshop
$pages = array("login");
/* 
 * Controller routines
 */
$error = 0;
$username = $_POST["username"];
$password = $_POST["password"];
$res = UserCtl::Login(SessionCtl::GetSession(), $username, $password);
if ($res["status"] == "FAILURE") {
    $error++;
}
if ($res["status"] == "SUCCESS") {
    $res = UserCtl::GetUserData(SessionCtl::GetSession());
    $username = $res["username"];
    setcookie('username', $username);
    $userdata = UserCtl::GetUserData(SessionCtl::GetSession());
    $pages = array("userdata_details");
}
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("error", $error);
$tpl->assign("username", $_COOKIE['username']);
$tpl->assign("userdata", $userdata);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
コード例 #5
0
ファイル: profile_orders.php プロジェクト: sleekshop/demoshop
/* 
 * Page definition 
 * @kaveh raji <*****@*****.**>
 */
/* 
 * Init routine
 */
include "inc/init.inc.php";
/* 
 * Defining the pages
 */
$pages = array("login_profile");
/* 
 * Controller routines
 */
$res = UserCtl::GetUserOrders(SessionCtl::GetSession());
$pages = array("profile");
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("res", $res);
$tpl->assign("error", $error);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
$tpl->draw("head");
$tpl->draw("content");
コード例 #6
0
ファイル: logout.php プロジェクト: sleekshop/demoshop
/* 
 * Page definition 
 * @kaveh raji <*****@*****.**>
 */
/* 
 * Init routine
 */
include "inc/init.inc.php";
/* 
 * Defining the pages
 */
$pages = array("logout");
/* 
 * Controller routines
 */
UserCtl::Logout(SessionCtl::GetSession());
setcookie('username', "");
$tpl->assign("username", $_COOKIE['username']);
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
$tpl->draw("head");
$tpl->draw("content");
$tpl->draw("footer");
コード例 #7
0
ファイル: order_summary.php プロジェクト: sleekshop/demoshop
 * @kaveh raji <*****@*****.**>
 */
/* 
 * Init routine
 */
include "inc/init.inc.php";
/* 
 * Defining the pages
 */
$pages = array("order_summary");
/* 
 * Controller routines
 */
$token = $_POST["token"];
$id_payment = $_REQUEST["id_payment"];
$order = OrderCtl::SetOrderDetails(SessionCtl::GetSession(), array("id_payment_method" => $id_payment, "id_delivery_method" => 1));
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("token", $token);
$tpl->assign("order", $order);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
$tpl->draw("head");
$tpl->draw("content");
$tpl->draw("footer");
コード例 #8
0
ファイル: checkout.php プロジェクト: sleekshop/demoshop
     * End of email - sending
     */
    $id_order = $res["id_order"];
    $session = $res["session"];
    SessionCtl::SetSession($session);
    setcookie('cart', "");
    $cart = array();
    $res = OrderCtl::DoPayment($id_order, array("token" => $token));
    if ($res["status"] == "Success") {
        header("Location:" . $res["redirect"]);
    }
} elseif ($res["status"] == "error" and $res["message"] == "SHOPOBJECT_NOT_AVAILABLE") {
    $cart = CartCtl::Refresh(SessionCtl::GetSession());
    foreach ($cart["contents"] as $prod) {
        if ($prod["type"] == "DELIVERY_COSTS") {
            $cart = CartCtl::Del(SessionCtl::GetSession(), $prod["id"]);
        }
    }
    $tpl->assign("cart", $cart);
    $tpl->assign("missing_id", $res["param"]);
    $pages = array("product_not_available");
}
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("cart", $cart);
/* 
 * Output of the page
 */
$tpl->draw("header");
コード例 #9
0
ファイル: profile_data.php プロジェクト: sleekshop/demoshop
    $userdata["street"] = $street;
    $userdata["number"] = $number;
    $userdata["zip"] = $zip;
    $userdata["city"] = $city;
    $userdata["state"] = $state;
    $userdata["country"] = $country;
    $userdata["notes"] = $notes;
    $userdata["email"] = $email;
    $args = array("companyname" => $userdata["company"], "department" => $userdata["department"], "salutation" => $userdata["salutation"], "firstname" => $userdata["firstname"], "lastname" => $userdata["lastname"], "street" => $userdata["street"], "number" => $userdata["number"], "zip" => $userdata["zip"], "state" => $userdata["state"], "city" => $userdata["city"], "country" => $userdata["country"], "email" => $userdata["email"]);
    $userdata = UserCtl::SetUserData(SessionCtl::GetSession(), $args);
    if ($userdata["status"] != "SUCCESS") {
        $error_count = 1;
        $error = $userdata["status"];
    }
}
$res = UserCtl::GetUserData(SessionCtl::GetSession());
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("userdata", $res);
$tpl->assign("error", $error);
$tpl->assign("error_count", $error_count);
$tpl->assign("already_sent", $already_sent);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");
$tpl->draw("menu");
$tpl->draw("head");
コード例 #10
0
 */
include "inc/init.inc.php";
/* 
 * Defining the pages
 */
$pages = array("profile_password");
/* 
 * Controller routines
 */
$already_sent = $_POST["already_sent"];
$error_count = 0;
if ($already_sent == 1) {
    $passwd1 = $_POST["passwd1"];
    $passwd2 = $_POST["passwd2"];
    $passwd3 = $_POST["passwd3"];
    $res = UserCtl::SetUserPassword(SessionCtl::GetSession(), $passwd1, $passwd2, $passwd3);
    if ($res["status"] != "SUCCESS") {
        $error = $res["status"];
        $error_count++;
    }
}
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("userdata", $res);
$tpl->assign("error", $error);
$tpl->assign("error_count", $error_count);
$tpl->assign("already_sent", $already_sent);
/* 
 * Output of the page
コード例 #11
0
ファイル: cart.php プロジェクト: sleekshop/demoshop
 * @kaveh raji <*****@*****.**>
 */
/* 
 * Init routine
 */
include "inc/init.inc.php";
/* 
 * Defining the pages
 */
$pages = array("cart");
/* 
 * Controller routines
 */
$del = $_GET["del"];
if ($del != "") {
    $cart = CartCtl::Del(SessionCtl::GetSession(), $del);
    $tpl->assign("cart", $cart);
}
if (count($cart["contents"]) == 0) {
    $cart = 0;
}
/* 
 * Assignments to the engine
 */
$tpl->assign("content_pages", $pages);
$tpl->assign("res", $cart);
/* 
 * Output of the page
 */
$tpl->draw("header");
$tpl->draw("body");