";
$accfoldername = substr($tempname, 0, strpos($tempname, '/') );
if ($accfoldername=="shop001") $accfoldername="";
require_once($filepath.$backend."config".$accfoldername.".inc.php");
require_once($filepath.$backend."common.inc.php");
include("config.php");
if ( !empty($_SESSION["acccheck"]) && !empty($_SESSION["acclogin"]) ) {
$sql= "SELECT * FROM `backend_user` WHERE skey = '".$_SESSION["acccheck"]."' AND login = '".$_SESSION["acclogin"]."'";
$rs = $db->query($sql);
if (mysql_num_rows($rs) == 0) {
header("Location: ../error.php");
exit;
}
} else {
header("Location: ../error.php");
exit;
}
include("../../../include/fckeditor/fckeditor.php");
$page_field = "";
$num_of_files = 0;
$attachment_text=array(
"-----",
' 相片
最佳顯示尺寸: 190*240 Pixel'
);
$col_name=array(
"-----",
"photo"
);
//initial
if (empty($id)) {
$id = "";
$temp_id = md5(uniqid(time()));
}
if (empty($page)) {
$page = "1";
}
//Load data
if ($id != "") {
$sql = "SELECT * FROM `".$page_tbname."` WHERE `id` = '$id'";
$row = $db->getrow($sql);
foreach($row as $_key=>$_item){
${$_key} = $_item;
}
if ($display == 1) {
$displayd = 'checked';
$displayh = '';
} else {
$displayd = '';
$displayh = 'checked';
}
} else {
$displayd = 'checked';
$displayh = '';
}
$category_list = '';
$sql = "SELECT id, en_name FROM `levelone` WHERE 1";
if ($result = $db->query($sql)) {
while ($row = mysql_fetch_assoc($result)) {
$selected = ($row['id'] != $levelone)?'':' selected';
$category_list .= '
';
}
mysql_free_result($result);
}
$files_content = "";
//upload file
for ($i=1;$i<=$num_of_files;$i++) {
if ($id != "") {
$sql = "SELECT * FROM `attachment` WHERE `table_name` = '".$page_tbname."' AND `table_id` = '".$id."' AND `col_name` = '".$col_name[$i]."'";
$rs = $db->query($sql);
if (mysql_num_rows($rs) > 0) {
$rowfile = $db->fetch_array($rs);
${"file".$i} = 'File name: '.$rowfile["real_name"].'
Delete