| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/dashboard/ |
Upload File : |
<?php
include_once("webadmin/configure.php");
if (!isset($_GET["langcode"])) {
$langcode = "en";
$_SESSION["langcode"] = "en";
} else {
$langcode = $_GET["langcode"];
$_SESSION["langcode"] = $langcode;
}
$polling_time = 3000; //millisecond
//config
$sql = "select * from config where deleted = 0 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'];
else if ($this_config{"id"} == 2)
$rolling_text_font_size = $this_config['config_value'];
else if ($this_config{"id"} == 3)
$rolling_text_font_color = $this_config['config_value'];
else if ($this_config{"id"} == 4)
$animtype = $this_config['config_value'];
else if ($this_config{"id"} == 5)
$slide_animation_duration = $this_config['config_value'];
}
$sql = "select * from config order by lastupdate DESC limit 1";
$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()));
}
$result = $sth->fetch(PDO::FETCH_ASSOC);
$config_lastupdate = $result["lastupdate"];
//slideshow
$sql = "select * from slideshow where status = 1 and deleted = 0 order by sort 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()));
}
$all_slideshow_info = $sth->fetchAll();
$sql = "select * from slideshow order by lastupdate DESC limit 1";
$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()));
}
$result = $sth->fetch(PDO::FETCH_ASSOC);
$slideshow_lastupdate = $result["lastupdate"];
// rolling text
$sql = "select * from rolling_text where status = 1 and deleted = 0 order by sort 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()));
}
$all_rolling_text_info = $sth->fetchAll();
$sql = "select * from rolling_text order by lastupdate DESC limit 1";
$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()));
}
$result = $sth->fetch(PDO::FETCH_ASSOC);
$rolling_text_lastupdate = $result["lastupdate"];
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]>
<html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]>
<html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]>
<html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en"> <!--<![endif]-->
<head>
<title>Demo</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen">
<script src="js/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" href="js/owl.carousel.2.0.0-beta.2.4/owl.carousel.css">
<script src="js/owl.carousel.2.0.0-beta.2.4/owl.carousel.min.js"></script>
<!-- Jquery Marquee -->
<script defer src="js/jquery.marquee.js"></script>
<script type="text/javascript">
$(function () {
$('.marquee').marquee('pointer').mouseover(function () {
$(this).trigger('stop');
}).mouseout(function () {
$(this).trigger('start');
}).mousemove(function (event) {
/*if ($(this).data('drag') == true) {
this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
}*/
}).mousedown(function (event) {
//$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
}).mouseup(function () {
//$(this).data('drag', false);
});
});
</script>
<script type="text/javascript">
var config_lastupdate = '<?=$config_lastupdate; ?>';
var slideshow_lastupdate = '<?=$slideshow_lastupdate; ?>';
var rolling_text_lastupdate = '<?=$rolling_text_lastupdate; ?>';
function check_config(config_lastupdate) {
$.ajax({
url: '_ajax.php?for=config',
type: 'POST',
data: {lastupdate: config_lastupdate},
dataType: 'html',
timeout: 1000,
error: function () {
//alert('Error loading PHP document');
check_config();
},
success: function (result) {
if (result != "") {
location.reload();
}
}
});
}
function check_slideshow(slideshow_lastupdate) {
$.ajax({
url: '_ajax.php?for=slideshow',
type: 'POST',
data: {lastupdate: slideshow_lastupdate},
dataType: 'html',
timeout: 1000,
error: function () {
//alert('Error loading PHP document');
check_slideshow();
},
success: function (result) {
//console.log(result);
if (result != "") {
location.reload();
//slideshow_container
$("#slideshow_container").empty();
$("#slideshow_container").html(result);
//recall function
}
}
});
}
function check_rolling_text(rolling_text_lastupdate) {
$.ajax({
url: '_ajax.php?for=rolling_text',
type: 'POST',
data: {lastupdate: rolling_text_lastupdate},
dataType: 'html',
timeout: 1000,
error: function () {
//alert('Error loading PHP document');
check_rolling_text();
},
success: function (result) {
if (result != "") {
//marquee_list
$(".marquee_list").empty();
$(".marquee_list").html(result);
}
}
});
}
setInterval(function () {
check_config(config_lastupdate);
}, <?=$polling_time?>);
setInterval(function () {
check_slideshow(slideshow_lastupdate);
}, <?=$polling_time?>);
setInterval(function () {
check_rolling_text(rolling_text_lastupdate);
}, <?=$polling_time?>);
</script>
<script type="text/javascript">
$(function () {
$('#slideshow_container').owlCarousel({
loop:true,
items:1,
autoplay:true,
autoplayTimeout: <?=(int)($slide_speed) ?>,
animateOut: 'fadeOut',
animateIn: 'fadeIn',
smartSpeed:250
});
});
</script>
</head>
<!--style="overflow-x: hidden;overflow-y: hidden; "-->
<body class="bg">
<div class="container">
<div id="slideshow_container">
<?php
foreach ($all_slideshow_info as $this_slide) {
if (!empty($this_slide{"slideimg_" . $_SESSION["langcode"]})) {
echo '<div class="item">
<div class="slideshow_img" style="background: url(images/slideshow/' . $this_slide{"slideimg_" . $_SESSION["langcode"]} . ') center center no-repeat; background-size:contain;"></div>
</div>';
}
}
?>
</div>
<div id="marquee_container">
<div id="marquee_container_bg">
<div id="marquee_wrapper">
<nav class="marquee">
<ul class="marquee_list" style="font-size: <?= $rolling_text_font_size; ?>px; color: <?= $rolling_text_font_color; ?>; ">
<?php
foreach ($all_rolling_text_info as $rolling_text_info) {
echo '<li>' . $rolling_text_info{"content_en"} . '</li>';
}
?>
</ul>
</nav><!-- .marquee ends /******/ -->
</div><!-- /// #marquee_wrapper ends /// -->
</div>
</div>
<div class="clearfix"></div>
</div>
</body>
</html>