/*==================================================================*\ ###################################################################### # # # Copyright 2005 Arca Solutions, Inc. All Rights Reserved. # # # # This file may not be redistributed in whole or part. # # eDirectory is licensed on a per-domain basis. # # # # ---------------- eDirectory IS NOT FREE SOFTWARE ----------------- # # # # http://www.edirectory.com | http://www.edirectory.com/license.html # ###################################################################### \*==================================================================*/ # ---------------------------------------------------------------------------------------------------- # * FILE: /order_classified.php # ---------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- # LOAD CONFIG # ---------------------------------------------------------------------------------------------------- include("./conf/loadconfig.inc.php"); # ---------------------------------------------------------------------------------------------------- # SESSION # ---------------------------------------------------------------------------------------------------- session_start(); # ---------------------------------------------------------------------------------------------------- # VALIDATION # ---------------------------------------------------------------------------------------------------- include(EDIRECTORY_ROOT."/includes/code/validate_frontrequest.php"); # ---------------------------------------------------------------------------------------------------- # VALIDATE FEATURE # ---------------------------------------------------------------------------------------------------- if (CLASSIFIED_FEATURE != "on") { exit; } $classiLevelObj = new ClassifiedLevel(); $classiLevelValue = $classiLevelObj->getValues(); if (!in_array($level, $classiLevelValue)) { header("Location: ".DEFAULT_URL."/advertise.php?classified"); exit; } # ---------------------------------------------------------------------------------------------------- # SUBMIT # ---------------------------------------------------------------------------------------------------- if (($_SERVER['REQUEST_METHOD'] == "POST")) { $_POST["friendly_url"] = str_replace(".htm", "", $_POST["friendly_url"]); $_POST["friendly_url"] = str_replace(".html", "", $_POST["friendly_url"]); $_POST["friendly_url"] = trim($_POST["friendly_url"]); $_POST["friendly_url"] = system_denyInjections($_POST["friendly_url"]); $friendly_url = $_POST["friendly_url"]; $request_method_seckey = "post"; include(EDIRECTORY_ROOT."/includes/code/seckey.php"); $validate_account = validate_addAccount($_POST, $message_account); $validate_contact = validate_form("contact", $_POST, $message_contact); $tmpEMAIL = $_POST["email"]; unset($_POST["email"]); $validate_classified = validate_form("classified", $_POST, $message_classified); $_POST["email"] = $tmpEMAIL; $validate_discount = is_valid_discount_code($_POST["discount_id"], "classified", $_POST["id"], $message_discount, $discount_error_num); if ($boolean_seckey && $validate_account && $validate_contact && $validate_classified && $validate_discount) { $account = new Account($_POST); $account->save(); $contact = new Contact($_POST); $contact->setNumber("account_id", $account->getNumber("id")); $contact->save(); unset($_POST["email"]); unset($_POST["phone"]); unset($_POST["address"]); unset($_POST["address2"]); $classified = new Classified($_POST); $classified->setNumber("account_id", $account->getNumber("id")); $status = new ItemStatus(); $classified->setString("status", $status->getDefaultStatus()); $classified->setDate("renewal_date", "00/00/0000"); $classified->Save(); $return_categories_array[] = $_POST["cat_1_id"]; $classified->setCategories($return_categories_array); /**************************************************************************************************/ /* */ /* E-mail notify */ /* */ /**************************************************************************************************/ setting_get("sitemgr_send_email",$sitemgr_send_email); setting_get("sitemgr_email",$sitemgr_email); $sitemgr_emails = split(",",$sitemgr_email); if ($sitemgr_emails[0]) $sitemgr_email = $sitemgr_emails[0]; setting_get("sitemgr_account_email",$sitemgr_account_email); $sitemgr_account_emails = split(",",$sitemgr_account_email); setting_get("sitemgr_classified_email", $sitemgr_classified_email); $sitemgr_classified_emails = split(",", $sitemgr_classified_email); // sending e-mail to user ////////////////////////////////////////////////////////////////////////// if ($emailNotificationObj = system_checkEmail(SYSTEM_CLASSIFIED_SIGNUP, $contact->getString("lang"))) { $subject = $emailNotificationObj->getString("subject"); $body = $emailNotificationObj->getString("body"); $body = str_replace("ACCOUNT_USERNAME",$_POST["username"],$body); $body = str_replace("ACCOUNT_PASSWORD",$_POST["password"],$body); $body = system_replaceEmailVariables($body, $classified->getNumber('id'), 'classified'); $subject = system_replaceEmailVariables($subject, $classified->getNumber('id'), 'classified'); if ($emailNotificationObj->getString("content_type") == "text/html"); $body = html_entity_decode($body); system_mail($contact->getString("email"), $subject, $body, EDIRECTORY_TITLE." <$sitemgr_email>", $emailNotificationObj->getString("content_type"), "", $emailNotificationObj->getString("bcc")); } //////////////////////////////////////////////////////////////////////////////////////////////////// // site manager warning message //////////////////////////////////////////////////////////////////// $sitemgr_msg = "