Exemple #1
0
 * @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");
$email = $_POST["email"];
$userdata["salutation"] = $salutation;
$userdata["firstname"] = $firstname;
$userdata["lastname"] = $lastname;
$userdata["company"] = $company;
$userdata["department"] = $department;
$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("country_code" => $country, "delivery_companyname" => $userdata["company"], "delivery_department" => $userdata["department"], "delivery_salutation" => $userdata["salutation"], "delivery_firstname" => $userdata["firstname"], "delivery_lastname" => $userdata["lastname"], "delivery_street" => $userdata["street"], "delivery_number" => $userdata["number"], "delivery_zip" => $userdata["zip"], "delivery_state" => $userdata["state"], "delivery_city" => $userdata["city"], "delivery_country" => $userdata["country"], "invoice_companyname" => $userdata["company"], "invoice_department" => $userdata["department"], "invoice_salutation" => $userdata["salutation"], "invoice_firstname" => $userdata["firstname"], "invoice_lastname" => $userdata["lastname"], "invoice_street" => $userdata["street"], "invoice_number" => $userdata["number"], "invoice_zip" => $userdata["zip"], "invoice_state" => $userdata["state"], "invoice_city" => $userdata["city"], "invoice_country" => $userdata["country"], "note" => $userdata["note"], "email" => $userdata["email"]);
$order_data = OrderCtl::SetOrderDetails(SessionCtl::GetSession(), $args);
if (!is_valid_email($email)) {
    $error["email"] = "has-error";
}
if ($firstname == "") {
    $error["firstname"] = "has-error";
}
if ($lastname == "") {
    $error["lastname"] = "has-error";
}
if ($street == "") {
    $error["street"] = "has-error";
}
if ($number == "") {
    $error["number"] = "has-error";
}
Exemple #3
0
    $msg .= "Ihre Daten:\n";
    $msg .= $order["delivery_salutation"] . " " . $order["delivery_firstname"] . " " . $order["delivery_lastname"] . "\n";
    $msg .= $order["delivery_street"] . " " . $order["delivery_number"] . "\n";
    $msg .= $order["delivery_zip"] . " " . $order["delivery_city"] . " " . $order["delivery_country"] . "\n";
    $msg .= "E-Mail: " . $order["email"] . "\n";
    $msg .= "Anmerkungen:\n" . $order["notes"];
    send_plain_mail($order["email"], utf8_decode($subject), utf8_decode($msg), ORDER_SENDER);
    /*
     * 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");
}
/*