/var/www/hkosl.com/dirsignage/html/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
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
<?php
    
if (session_id() === "") { session_start(); }

    
//new pdo

    
$dbh = new PDO("mysql:host=192.168.155.13;dbname=dirsignagedb""admin""PHac7dru");


    
$dbh->exec("set names utf8");

    
date_default_timezone_set("Asia/Hong_Kong");

    
$nowdate date("Y-m-d H:i:s");


    if (!
function_exists('random_string')) {
        function 
random_string$length ) {
            
$chars "abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ23456789";
            
$random_string substrstr_shuffle$chars ), 0$length );
            return 
$random_string;
        }
    }


    
error_reporting(E_ALL);
    
ini_set('display_errors'0);


    if (!
function_exists('startsWith')) {
        function 
startsWith($haystack$needle){
            
$length strlen($needle);
            return (
substr($haystack0$length) === $needle);
        }
    }

    if (!
function_exists('check_upload_path')) {
        function 
check_upload_path($img_file){
            
$session_path_str "/web/uploader/".$_SESSION['KCFINDER']['uploadURL'];
            
$session_path_long strlen($session_path_str);
            
$path_error 0;
            foreach(
$img_file as $key2=>$pathname){
                if(
$key2 && $pathname){
                    
$submit_path_str substr($pathname,0,$session_path_long);
                    
$submit_path_long strlen($submit_path_str);
                    
$file str_replace('..' ,'' ,$pathname);
                    if(
$session_path_long <> $submit_path_long || $session_path_str <> $submit_path_str || !startsWith($file$session_path_str)){
                        
$path_error 1;
                    }
                }
            }
        }
    }

    
$sql00 "SELECT * FROM sys_lang WHERE langstatus = '1' ORDER BY langsort ASC ";
    if (!(
$sth00 $dbh->prepare($sql00))) {
        throw new 
Exception('[' $sth00->errorCode() . ']: ' print_r($sth00->errorInfo()));
    }

    if (!
$sth00->execute()) {
        throw new 
Exception('[' $sth00->errorCode() . ']: ' print_r($sth00->errorInfo()));
    }

    while (
$row00 $sth00->fetch(PDO::FETCH_ASSOC)) {
        
$arraylangcode[$row00{'langcode'}] = $row00{'langname'};
    }

    
$sql "select * from config order by id ASC";
    
$parameters = array();
    if (!(
$sth $dbh->prepare($sql))) {
        throw new 
Exception('[' $sth->errorCode() . ']: ' print_r($sth->errorInfo()));
    }

    if (!
$sth->execute($parameters)) {
        throw new 
Exception('[' $sth->errorCode() . ']: ' print_r($sth->errorInfo()));
    }

    
$config_info $sth->fetchAll();

    foreach(
$config_info as $this_config){
        if(
$this_config{"id"} == 1)
            
$slide_speed $this_config['config_value'];
        if(
$this_config{"id"} == 2)
            
$idle_time $this_config['config_value'];
        if(
$this_config{"id"} == 3)
            
$disable_floor $this_config['config_value'];
        if(
$this_config{"id"} == 4)
            
$idle_time2 $this_config['config_value'];

    }
?>