| 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");
set_time_limit(0);
if($_GET["for"] == "config"){
$lastupdate = $_POST["lastupdate"];
$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);
if($result["lastupdate"] != $lastupdate){
$_SESSION["config_lastupdate"] = $result["lastupdate"];
//need to pass updated data
$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();
echo json_encode($config_info);
}
}else if($_GET["for"] == "slideshow"){
$lastupdate = $_POST["lastupdate"];
$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);
if($result["lastupdate"] != $lastupdate){
$_SESSION["slideshow_lastupdate"] = $result["lastupdate"];
//need to pass updated data
$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();
$content = "";
foreach($all_slideshow_info as $row){
$content .= '<div class="item">
<div class="slideshow_img" style="background: url(images/slideshow/' . $row{"slideimg_" . $_SESSION["langcode"]} . ') center center no-repeat; background-size:contain;"></div>
</div>';
}
echo $content;
}
} else if($_GET["for"] == "rolling_text"){
$lastupdate = $_POST["lastupdate"];
$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);
if($result["lastupdate"] != $lastupdate){
$_SESSION["rolling_text_lastupdate"] = $result["lastupdate"];
//need to pass updated data
$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();
$content = "";
foreach($all_rolling_text_info as $row){
$content .= '<li>' . $row{"content_".$_SESSION["langcode"]} . '</li>';
}
echo $content;
}
}