',
' Photo Small Top
(W*H: 160*120)',
' Photo Small Middle
(W*H: 160*120)',
' Photo Small Bottom
(W*H: 160*120)'
);
$col_name=array(
"-----",
'Photo ',
'Photo Small Top',
'Photo Small Middle',
'Photo Small Bottom'
);
//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."' "; // WHERE `id` = '$id'";
$row = $db->getrow($sql);
foreach($row as $_key=>$_item){
${$_key} = $_item;
}
if ($display == 1) { $displayd = 'checked'; $displayh = '';
} else { $displayd = ''; $displayh = 'checked'; }
if ($displayzh == 1) { $displaydzh = 'checked'; $displayhzh = '';
} else { $displaydzh = ''; $displayhzh = 'checked'; }
if ($displaysc == 1) { $displaydsc = 'checked'; $displayhsc = '';
} else { $displaydsc = ''; $displayhsc = 'checked'; }
} else {
$displayh = ''; $displayd = 'checked';
$displayhzh = 'checked'; $displaydzh = '';
$displayhsc = 'checked'; $displaydsc = '';
}
if ($id != "" ) {
// $sql = "SELECT * FROM eshopframe WHERE framefile='".$temp."'";
$sql = "SELECT * FROM eshopframe WHERE frametype='Design layout' and framefile='".$temp."'";
$rs = $db->query($sql);
while($row = $db->fetch_array($rs)) {
$filecontenten1 = $row["filecontenten1"];
$filecontenten2 = $row["filecontenten2"];
$filecontenten3 = $row["filecontenten3"];
$filecontentsc1 = $row["filecontentsc1"];
$filecontentsc2 = $row["filecontentsc2"];
$filecontentsc3 = $row["filecontentsc3"];
$filecontenttc1 = $row["filecontenttc1"];
$filecontenttc2 = $row["filecontenttc2"];
$filecontenttc3 = $row["filecontenttc3"];
}
}
$websiteframe_list= "";
$sql = "SELECT * FROM eshopframe WHERE display='1' and frametype='Website frame' order by sorting, framepage, id ";
$rs = $db->query($sql);
while($row = $db->fetch_array($rs)) {
$websiteframe_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