 <?php

session_start();
require_once "../init.php";
require_once "../authority.inc.php";
$id=$_GET['id'];
$page_id=$_GET['page_id'];
$width=$_POST['s-width'];
$height=$_POST['s-height'];
$zindex1=$_POST['zindex1'];
$tongbu=$_POST['tongbu'];
$lang=$_GET['lang'];
$left1=$_POST['left1'];
$top1=$_POST['top1'];
if($id=="middle"||$id=="head" ||$id=="head"){
echo "当前不是可编辑区域";

echo "<script>window.parent.location.href='index.php?page_id=$page_id&lang=$lang';</script>";
}
if($id=="middler")
{
if($tongbu=="1"){
$sql ="update menu SET main_width='$width' WHERE  lang='$lang'";
}
else{
$sql ="update menu SET main_height='$height',main_width='$width' WHERE  IDProduct=$page_id ";
}
}

elseif($id=="header")
{
if($tongbu=="1"){
$sql ="update menu SET head_height='$height',head_width='$width' WHERE  lang='$lang'";
}
else{
$sql ="update menu SET head_height='$height',head_width='$width' WHERE  IDProduct=$page_id ";
}
}

elseif($id=="footer")
{
if($tongbu=="1"){
$sql ="update menu SET foot_height='$height',foot_width='$width'  WHERE  lang='$lang'";
}
else{
$sql ="update menu SET foot_height='$height',foot_width='$width' WHERE  IDProduct=$page_id ";
}
}
else
{	 

$sql ="update notes SET height='$height',width='$width',xyz='".$left1."|".$top1."|".$zindex1."' WHERE id=$id";
}
	  $DB->query($sql);
$db->close();

echo "<script>window.parent.location.href='index.php?page_id=$page_id&lang=$lang';</script>";
?>