| 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/alliancealliance/webadmin/ |
Upload File : |
<?php
require_once ("check_login.php");
require_once("function_cropimg.php");
require_once("mime_type_lib.php");
$id = $_POST["id"];
$link_or_page = $_POST["link_or_page"];
foreach ($arraylangcode as $langcode => $langname) {
// Upload File
$filelimit = 10 * 1048576; //Filelimit in 10MB
if ($_FILES["banner_" . $langcode]['name'] <> '') {
if ($_FILES["banner_" . $langcode]['size'] < $filelimit) {
//check if image type is valid or not
$mime = get_file_mime_type($_FILES["banner_" . $langcode]['name']);
if (($mime == "image/gif") || ($mime == "image/jpeg") || ($mime == "image/png")) {
$filename = $_FILES["banner_" . $langcode]['name'];
preg_match("/\.([^\.]+)$/", $filename, $file_ext);
$newfilename = random_string() . "_static_page_" . $id . "." . $file_ext[1]; // default length 8
move_uploaded_file($_FILES["banner_" . $langcode]['tmp_name'], "../images/banner/" . $newfilename) or die ("Could not copy the file");
//$banner_path = "../images/slideshow/".$newfilename;
//createthumb($banner_path, $banner_path, 680, 350);
$banner[$langcode] = $newfilename;
} else {
echo '<script language="javascript">
alert("Image format should be JPEG, GIF or PNG. Image size should be lower than 10MB");
history.back();
</script>';
exit;
}
} else {
echo '<script language="javascript">
alert("Image format should be JPEG, GIF or PNG. Image size should be lower than 10MB");
history.back();
</script>';
exit;
}
} else {
$banner[$langcode] = "";
//$messgae .= "Please select a banner image.\\n\\n";
}
}
if($link_or_page == "link"){
$link_to = $_POST["link_to"];
foreach ($arraylangcode as $langcode => $langname) {
//$page_title = $_POST["page_".$langcode];
$sql = "update static_page set link_to=?, lastupdate=?, lastupby=? where id=?";
$parameters = array($link_to, $nowdate, $_SESSION['cmsloginid'], $id);
bind_pdo($sql, $parameters);
}
}
if($link_or_page == "page"){
$sql = "update static_page set lastupdate=?, lastupby=?, ";
$parameters = array($nowdate, $_SESSION['cmsloginid']);
foreach ($arraylangcode as $langcode => $langname) {
$sql .= "desc_" . $langcode . "=?, title_" . $langcode . "=?, ";
$parameters[] = $_POST["desc_" . $langcode];
$parameters[] = $_POST["title_" . $langcode];
if ($banner[$langcode] != '' || $_POST['delimage_' . $langcode] > 0) {
$sql .= "banner_" . $langcode . "=?, ";
$parameters[] = $banner[$langcode];
//unlink image
$unlink_file_path = "../images/banner/" . $old_menu_info["banner_" . $langcode];
if (is_file($unlink_file_path)) {
unlink($unlink_file_path);
}
}
}
$sql = substr_replace($sql, "", -2);
$sql .= " where id=?";
$parameters[] = $id;
bind_pdo($sql, $parameters);
}
$dbh = null;
header("Location: static_page_index.php?msg=2");