1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
<?php if (session_id() === "") { session_start(); }
//$debug_tool = true; if ((isset($_SESSION["cmsrole"]) && $_SESSION["cmsrole"] == "super_admin") || (isset($enable_debug_tool) && $enable_debug_tool = 1)) { $debug_tool = true; } else { $debug_tool = false; }
define("PRODUCTION", 1); define("TEST_EMAIL", 1);
$_database = array( 'driver' => 'mysql', 'charset' => 'utf8', 'collation' => 'utf8_general_ci', 'database' => 'b2b2c_api', 'prefix' => '', 'host' => 'localhost', 'username' => 'admin', 'password' => 'PHac7dru', );
//error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING); ini_set('display_errors', 1); define("SEND_EMAIL", 1);
// Require composer autoloader require_once __DIR__ . '/libraies/autoload.php';
// temp database include for webadmin2 require_once "database.php";
ini_set('session.cookie_httponly', 1); header("Content-Type:text/html; charset=utf-8"); header("x-frame-options:SAMEORIGIN");
$dbh->exec("set names utf8");
date_default_timezone_set("Asia/Hong_Kong");
$nowdate = date("Y-m-d H:i:s");
if (!isset($_SESSION["langcode"])) { $_SESSION["langcode"] = "en"; }
$langcode = $_SESSION["langcode"];
if (isset($_GET["wlangcode"])) { $_SESSION["wlangcode"] = $_GET["wlangcode"]; $wlangcode = $_SESSION["wlangcode"];
header("Location: " . $_SERVER['HTTP_REFERER']); } else if (!isset($_SESSION["wlangcode"])) { $_SESSION["wlangcode"] = "tc"; $wlangcode = $_SESSION["wlangcode"]; } else { $wlangcode = $_SESSION["wlangcode"]; }
if ($debug_tool) { $whoops = new Whoops\Run(); $handler = new Whoops\Handler\PrettyPageHandler(); $handler->setEditor('sublime'); $whoops->pushHandler($handler)->register(); if (Whoops\Util\Misc::isAjaxRequest()) { $whoops->pushHandler(new Whoops\Handler\JsonResponseHandler); } include_once "_helpers.php"; }
$session_factory = new \Aura\Session\SessionFactory; $session = $session_factory->newInstance($_COOKIE); $segment = $session->getSegment('Onesolution\Frontend');
//include('../phpmailer/class.phpmailer.php');
require_once("_functions.php");
if (TEST_EMAIL == 1) { //need to get from site info define("FROM", $site_info["enquiryemail"]); define("FROM_NAME", $site_info["companyname_en"]); } else { define("FROM", "kelvinchan@onesolution.com.hk"); define("FROM_NAME", "Testing"); }
|