/var/www/hkosl.com/sinomax/survey/webadmin/configure.php


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
<?php
    $environment 
"DEV";

    if (
$environment == "PRODUCTION") {
        
$_database = array(
            
'host'      => '',
            
'database'  => '',
            
'username'  => '',
            
'password'  => '',
            
'driver'    => 'mysql',
            
'charset'   => 'utf8',
            
'collation' => 'utf8_general_ci',
            
'prefix'    => '',
        );
    } else if (
$environment == "DEV") {
        
$_database = array(
            
'host'      => '192.168.155.13',
            
'database'  => 'dev_sinomax_survey',
            
'username'  => 'admin',
            
'password'  => 'PHac7dru',
            
'driver'    => 'mysql',
            
'charset'   => 'utf8',
            
'collation' => 'utf8_general_ci',
            
'prefix'    => '',
        );
    }

    if (
session_id() === "") {
        
session_start();
    }

    
//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);

    
ini_set('session.cookie_httponly'1);

    
header("Content-Type:text/html; charset=utf-8"); 
    
header("x-frame-options:SAMEORIGIN");

    
//new pdo
    
$dbh = new PDO("{$_database['driver']}:host={$_database['host']};dbname={$_database['database']}"$_database['username'], $_database['password']);
    unset(
$_database);

    
$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"];

    require_once(
"basic_info.php");