"; $accfoldername = substr($tempname, 0, strpos($tempname, '/') ); if ($accfoldername=="shop001") $accfoldername=""; require("config.php"); require_once("../../../config".$accfoldername.".inc.php"); require_once("../../../common.inc.php"); date_default_timezone_set('Asia/Hong_Kong'); // page variable name $page_field = ""; // include("config.php"); //check login session if (empty($_SESSION["backend_sysid"])) { header("Location: ../error.php"); exit; } getpost(); if ($id == "") { //check if ($temp_id == "") { header("Location: ".$page_address_list); exit; } //insert $sql = "INSERT INTO `".$page_tbname."` ( `id` ) VALUES ( NULL );"; $db->query($sql); $id = $db->insert_id(); if($temp_id != ""){ $sql = "UPDATE `attachment` SET `table_id` = '".$id."', `temp_id` = '' WHERE `table_name` = '".$page_tbname."' AND `temp_id` = '".$temp_id."'"; $db->query($sql); } } $tags_each= $tags; if ($tags_each){ foreach ($tags_each as $t){ $tags_id .= $t." "; } } //update $sql ="UPDATE `".$page_tbname."` SET `display`='".escapeit($display)."', `displayzh`='".escapeit($displayzh)."', `displaysc`='".escapeit($displaysc)."', sorting='".escapeit($sorting)."', framepage='".escapeit($framepage)."', websitepage='".escapeit($websitepage)."', pathfile1='".escapeit($pathfile1)."', pathfile2='".escapeit($pathfile2)."', template='".escapeit($template)."', updatetime=now() WHERE `id` = '".$id."'"; $db->query($sql); if (!empty($delfiles)) { foreach ($delfiles as $key => $value) { del_attachment($value, "../../"); } } header("Location: ".$page_address_list."?keepSession=1&page=".$page); exit; ?>