| 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/dirsignage_old/html/ |
Upload File : |
<?php
include_once ("webadmin/configure.php");
if(!isset($_GET["langcode"])){
$langcode = "tc";
$_SESSION["langcode"] = "tc";
}else{
$langcode = $_GET["langcode"];
$_SESSION["langcode"] = $langcode;
}
$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'];
}
$width = "1080";
$height = "935";
?>
<!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>Dirsignage</title>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="../html/images/favicon.ico">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<!-- CSS
================================================== -->
<link href="../html/css/style.css" rel="stylesheet" type="text/css" media="screen">
<!-- use font awesome -->
<link href="../html/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="screen">
<!-- styles needed by jScrollPane -->
<link type="text/css" href="../html/css/jquery.mCustomScrollbar.css" rel="stylesheet" media="all" />
<!-- Use jQuery
================================================== -->
<script src="../html/js/jquery-1.11.1.min.js"></script>
<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="../html/js/jquery.mousewheel.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="../html/js/jquery.mCustomScrollbar.js"></script>
<!-- General Script -->
<script src="../html/js/general.js"></script>
<!-- IE Support
================================================== -->
<!--[if lt IE 9]>
<!--<link href="../html/css/ie.css" rel="stylesheet" type="text/css" media="screen">-->
<script src="../html/js/html5shiv.js"></script>
<script src="../html/js/selectivizr-and-extra-selectors.min.js"></script>
<![endif]-->
<!-- jScrollPane -->
<script>
(function($){
$(window).load(function(){
$("#search_result").mCustomScrollbar({
scrollButtons:{enable:true},
theme:"light-thick",
scrollbarPosition:"outside"
});
expand_box();
});
})(jQuery);
</script>
<!-- Jquery Marquee -->
<script defer src="../html/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">
function search_result(search_word, action){
$.ajax({url: 'search_result.php',
type: 'GET',
data:{search_word:search_word, action: action},
dataType: 'html',
timeout: 2000,
/*beforeSend : function(){
$('#ajax_loading').show();
},
complete: function(){
$('#ajax_loading').hide();
},*/
error: function(){
//alert('Error loading PHP document');
search_result(search_word, action);
},
success: function(result){
//console.log(result);
$("#search_result .result_list").empty();
if(result == "" || result == null){
$("#search_result").html("<?php if($langcode == "en") echo "No matched result."; else echo "沒有相關搜尋結果。"?>");
}else{
$("#search_result").html(result);
}
}
});
}
function gofloor(floor_num){
if(floor_num == 0){
window.location.href='index.php?langcode=<?=$langcode?>';
}else{
window.location.href='index.php?langcode=<?=$langcode?>&floor='+floor_num;
}
}
</script>
<script src="js/idle-timer.min.js"></script>
<script type="text/javascript">
$(function() {
/*$('#inactive_content').show();
$('#active_content').hide();*/
// idleTimer() takes an optional numeric argument that defines just the idle timeout
// timeout is in milliseconds
$( document ).idleTimer(<?=(int)($idle_time."000"); ?>);
$( document ).on( "idle.idleTimer", function(event, elem, obj){
// function you want to fire when the user goes idle
$('#language_btn').css('visibility', 'hidden');
$('#inactive_content').show();
$('#active_content').hide();
});
$( document ).on( "active.idleTimer", function(event, elem, obj, triggerevent){
// function you want to fire when the user becomes active again
$('#language_btn').css('visibility', 'visible');
$('#inactive_content').hide();
$('#active_content').show();
});
});
</script>
<link rel="stylesheet" href="js/bjqs.css">
<script src="js/bjqs-1.3.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#slideshow').bjqs({
height : <?=$height?>,
width : <?=$width?>,
animtype : 'fade', // accepts 'fade' or 'slide'
animduration : 450, // how fast the animation are
animspeed : <?=(int)($slide_speed."000"); ?>, // the delay between each slide
automatic : true, // automatic
showcontrols : false,
hoverpause : false,
showmarkers : false
});
});
</script>
<script type="text/javascript">
$(function(){
$("body").attr("oncontextmenu", "return false;");
});
</script>
<!--<script src="js/background_size_ie.js"></script>
<script type="text/javascript">
$(function(){
$(".slideimg").css({backgroundSize: "cover"});
});
</script>-->
</head>
<body class="bg-6" style="overflow-x: hidden;overflow-y: hidden;">
<div id="marquee_container">
<div id="marquee_container_bg">
<div id="marquee_wrapper" >
<nav class="marquee">
<ul class="marquee_list">
<?php
$sql = "select * from rolling_text where status = ? and deleted = ? order by sort ASC";
$parameters = array("1", "0");
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()));
}
while($rolling_text_info = $sth->fetch(PDO::FETCH_ASSOC)){
echo '<li>'.$rolling_text_info{"content_".$langcode}.'</li>';
}
?>
</ul>
</nav><!-- .marquee ends /******/ -->
</div><!-- /// #marquee_wrapper ends /// -->
</div>
</div>
<div class="clearfix"></div>
<div id="wrapper" >
<div class="search_block">
<div style="background: url(../html/images/search_bar.png) no-repeat;">
<input type="text" id="search_word" placeholder="<?php if($langcode == "en") echo 'Search Keyword...'; else echo '輸入關鍵字...'; ?>" autocomplete="off" onkeyup="search_result(this.value, 1);"/>
</div>
<div style="position: relative;">
<div id="reset_search_text" onclick="document.getElementById('search_word').value = '';"></div>
</div>
</div><!-- .search_block ends -->
<div style="text-align: right;">
<?php
if(isset($_GET["floor"]) && !empty($_GET["floor"]))
$floor = $_GET["floor"];
else
$floor = "";
if(isset($_GET["id"]) && $_GET["id"] > 0)
$id = $_GET["id"];
else
$id = "";
if($langcode == 'tc'){
echo "<button id='language_btn' type='button' onclick=\"window.location.href='index.php?langcode=en&floor=".$floor."&id=".$id."'\">English</button>";
}else if($langcode == 'en'){
echo "<button id='language_btn' type='button' onclick=\"window.location.href='index.php?langcode=tc&floor=".$floor."&id=".$id."'\">中文</button>";
}else{
}
?>
</div>
<div id="active_content">
<div id="floor_box">
<div id="floor_upward">
<img src="../html/images/upward.png" style="width: 60px"/>
</div>
<div>
<div id="floor_top" >
<div id="floor_all" onclick="gofloor(0);" style="<?php if(!isset($_GET["floor"])) echo "color: #33deb9;"; if($langcode == "en") echo 'left: 69px;'?>">
<?php if($langcode == "en") echo 'All'; else echo '所有'; ?>
</div>
</div>
<ul id="floor_box_ul" >
<?php
$sql = "select max(floor) as max_floor from company where status = ? and deleted = ?";
$parameters = array("1", "0");
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);
$max_floor = $result{"max_floor"};
if(empty($max_floor) || $max_floor > 29){
$max_floor = 29;
}
$all_disable_floor = explode(",", $disable_floor);
for($i = 1; $i <= $max_floor; $i++){
foreach($all_disable_floor as $this_disable_floor){
if($i == $this_disable_floor){
continue 2;
}
}
if(isset($_GET["floor"]) && $_GET["floor"] == $i)
$color = "color: #33deb9;";
else
$color = "";
echo "<li class='floor_middle' onclick=\"gofloor(".$i."); \" style='".$color."'>
<div class='floor_middle_text'>
".str_pad($i, 2, "0", STR_PAD_LEFT).'/F
</div>
</li>';
}
?>
</ul>
<div id="floor_bottom" >
</div>
</div>
<div id="floor_downward">
<img src="../html/images/downward.png" style="width: 60px"/>
</div>
</div>
<div id="search_result">
<ul id="result_list_ul" class="result_list letter_option" style="font-size: 33px;">
<?php if(isset($_GET["id"]) && $_GET["id"] > 0){ ?>
<?php
if(isset($_GET["id"]) || !empty($_GET["floor"])){
$sql = "select * from company where id = ? and status = ? and deleted = ?";
$parameters = array((int)$_GET["id"], "1", "0");
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()));
}
$company_info = $sth->fetch(PDO::FETCH_ASSOC);
?>
<div style="width: 25%; float: left;">
<?php if(!empty($company_info{"logo"})){ ?>
<img src="images/company_logo/<?=$company_info{"logo"}?>" style="width: 100%;"/>
<?php } ?>
</div>
<div style="width: 75%; float: left;">
<table style="margin-left: 20px;">
<tr>
<td style="width: 175px;"><?php if($langcode == 'en') echo 'Co.Name'; else echo '公司名稱'?> : </td>
<td>
<?=$company_info{"companyname_en"}?><br><br>
<?=$company_info{"companyname_tc"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Room'; else echo '單位'?> : </td>
<td>
<?=$company_info{"room_no"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Tel'; else echo '電話號碼'?> : </td>
<td>
<?=$company_info{"telephone"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Fax'; else echo '傳真號碼'?> : </td>
<td>
<?=$company_info{"fax"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Email'; else echo '電郵地址'?> : </td>
<td>
<?=$company_info{"email"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Website'; else echo '網頁'?> : </td>
<td>
<?=$company_info{"website"}?>
</td>
</tr>
<tr>
<td><?php if($langcode == 'en') echo 'Address'; else echo '地址'?> : </td>
<td style="word-wrap: break-word;">
<?=$company_info{"companyaddress_en"}?><br><br>
<?=$company_info{"companyaddress_tc"}?>
</td>
</tr>
</table>
</div>
<?php
}
?>
<?php }else{ ?>
<?php
if(!isset($_GET["floor"]) || empty($_GET["floor"])){
$sql = "select * from company where status = ? and deleted = ? order by companyname_en ASC";
$parameters = array("1", "0");
}else{
$sql = "select * from company where status = ? and deleted = ? and floor = ? order by companyname_en ASC";
$parameters = array("1", "0", (int)$_GET["floor"]);
}
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()));
}
if($sth->rowCount() > 0){
while($company_info = $sth->fetch(PDO::FETCH_ASSOC)){
if(empty($company_info{"companyname_".$langcode})){
if($langcode == "en"){
$company_name = $company_info{"companyname_tc"};
}else{
$company_name = $company_info{"companyname_en"};
}
}else{
$company_name = $company_info{"companyname_".$langcode};
}
echo '<li class="rl_item">
<div style="width: 90%; float: left;">
<a href="index.php?id='.$company_info{"id"}.'&langcode='.$langcode.'">'.$company_name.'</a>
</div>
<div style=" width: 2%;float: right;">
»
</div>
</li>';
}
}else{
if($langcode == "en"){
echo "No Record.";
}else{
echo "沒有記錄。";
}
}
?>
<?php } ?>
</ul>
</div>
</div>
<div style="clear: both;"></div>
</div><!-- /// #wrapper ends /// -->
<div id="inactive_content" style="display: none; width:<?=$width?>px; margin: 0 auto;margin-top: -138px; ">
<!-- slideshow -->
<div id="slideshow">
<ul class="bjqs">
<?php
$sql = "select * from slideshow where status = ? and deleted = ? order by sort ASC";
$parameters = array("1", "0");
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()));
}
while($slideshow_info = $sth->fetch(PDO::FETCH_ASSOC)){
/*echo '<li>
<div style="width:100%; height: 921px; background: url(images/slideshow/'.$slideshow_info{"slideimg_".$_SESSION["langcode"]}.') repeat center center;" class="slideimg" > </div>
</li>';*/
echo '<li>
<img src="images/slideshow/'.$slideshow_info{"slideimg_".$_SESSION["langcode"]}.'" style="width:'.$width.'px; height: '.$height.'px;"/>
</li>';
}
?>
</ul><!-- .new_pdt_list ends -->
</div>
</div>
<div class="clearfix"></div>
<!-- Placeholder IE Support -->
<script src="../html/js/jquery.placeholder.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input, textarea').placeholder();
});
</script>
<!-- added by kelvin -->
<script type="text/javascript">
var floor_box_ul_height = 0;
function expand_box(){
if(parseInt($(window).height()) > 1300){ //for large, change height, using scroll
$("#floor_box_ul").css("height", "1040px");
$("#search_result").css("height", "1150px");
$(".mCSB_draggerRail").css("height", "1110px");
floor_box_ul_height = 1040;
}else{
$("#floor_box_ul").css("height", "650px");
$("#search_result").css("height", "740px");
$(".mCSB_draggerRail").css("height", "690px");
floor_box_ul_height = 650;
}
}
$(function(){
expand_box();
$(window).resize(function() {
expand_box();
});
$( "#floor_box ul li" ).on( "click", function() {
$("#floor_box ul li").css("color", "#ffffff");
$("#floor_all").css("color", "#ffffff");
$(this).css("color", "#33deb9");
});
$( "#floor_all" ).on( "click", function() {
$("#floor_box ul li").css("color", "#ffffff");
$(this).css("color", "#33deb9");
});
var scrolled=0;
$("#floor_downward").on("click" ,function(){
if(scrolled+floor_box_ul_height <= 55*<?=$max_floor?>)
scrolled=scrolled+(55*5);
$("#floor_box_ul").animate({
scrollTop: scrolled
});
});
$("#floor_upward").on("click" ,function(){
if(scrolled < 0 )
scrolled = 0;
else
scrolled=scrolled-(55*5);
$("#floor_box_ul").animate({
scrollTop: scrolled
});
});
});
</script>
</body>
</html>