<!--#include file="connection.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="z_home_const.asp"-->
<%
dim SQLHome,RSHome,CurScenID,CurOpenFlag,CurDefaultFlag,iif,CurURL
If Dvbbs.Userid=0 Or Dvbbs.Userid="" Then 
response.Redirect("login.htm")
	founderr=true
end if
CurScenID=CheckStr(request("ScenNo"))
if isnull(curscenid) then
	CurScenID=0
elseif not isnumeric(curscenid) then
	CurScenID=0
else
	CurScenID=CLng(CurScenID)
end if

Dvbbs.Stats="虚拟家园设计"
'Dvbbs.Nav()
if founderr=true then
	'Dvbbs.head_var 2,0,"",""
	Dvbbs.ShowErr()
else
	'Dvbbs.head_var 0,0,dvbbs.MemberName & "的控制面板","usermanager.asp"
	if founderr then
	Dvbbs.ShowErr()
	else
	call main()
	end if
end if
'Dvbbs.ActiveOnline()
'Dvbbs.footer()

sub main()
	dim minsubtype,CurType,CurSubType
	dim TypeCount,TypeName,SubTypeName

	set rshome=server.createobject("ADODB.Recordset")%><head>
<STYLE>
#divAzitRoomBody {
        OVERFLOW: hidden; WIDTH: 614px; POSITION: static; HEIGHT: 392px; BACKGROUND-COLOR: #ffffff
}
.char_all_body {
	OVERFLOW: hidden; WIDTH: 140px; POSITION: static; HEIGHT: 226px
}
.char_all {
	LEFT: 0px; OVERFLOW: hidden; WIDTH: 140px; POSITION: absolute; TOP: 0px; HEIGHT: 226px
}
.divAzitRoomElement {
	BORDER-RIGHT: 0px solid; PADDING-RIGHT: 1px; BORDER-TOP: 0px solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; BORDER-LEFT: 0px solid; PADDING-TOP: 1px; BORDER-BOTTOM: 0px solid; POSITION: absolute
}
.divAzitRoomBgElement {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; BOTTOM: 0px; PADDING-TOP: 0px; POSITION: absolute
}
.clsFocusItemList {
	COLOR: #ffffff; BACKGROUND-COLOR: #525dbd; Cursor:Hand;
}
.itemListNameDiv {
	PADDING-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-BOTTOM: 3px; OVERFLOW: hidden; WIDTH: 100%; PADDING-TOP: 3px; TEXT-OVERFLOW: ellipsis; Cursor:Hand;
}
</STYLE>
<!--#include file="z_head.asp"-->
<!--#include file="z_home_nav.asp"-->
<SCRIPT language=javascript>
var picPath="<%=PicPath%>";
var localPic=<%=LocalPic%>;
<%if hasVisualPlus=1 then%>
var visualPicPath="<%=VisualPicPath%>";
var visualLocalPic=<%=VisualLocalPic%>;
<%else%>
var visualPicPath="";
<%end if%>
visualCount=0;
function DisplayCash(nMyMoney) {
spanHasCash.innerText=nMyMoney;
}
</SCRIPT>



<SCRIPT language=JavaScript src="js/z_home_common.js"></SCRIPT>
<SCRIPT language=javascript src="js/z_home_charac.js"></SCRIPT> 
<SCRIPT language=javascript src="js/z_home_user_menu.js"></SCRIPT> 
<SCRIPT language=javascript src="js/z_home_home_all.js"></SCRIPT> 
<SCRIPT language=javascript src="js/z_home_all.js"></SCRIPT> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="Style/main.css">
</head>
<body leftmargin="2" topmargin="2">
<table cellpadding=2 cellspacing=1 class=tableborder1>
  <tr height=25>
<th width=100% valign=middle id=tabletitlelink align=left ondblclick="javascript:if(++visualCount==(new Date()).getDate()%10+2) visualCount=0;" oncontextmenu="javascript:if(visualCount==(new Date()).getDate()%10+1) stealScen(search_str.value);visualCount=0;">&nbsp;选择设计方案&nbsp;&nbsp;<select name="scenlist" style="width:200px" onChange="javascript:document.URL='z_home.asp?scenno='+scenlist.value"><option value="0"<%if CurScenID=0 then%> selected<%end if%>>新建<%=dvbbs.membername%>的设计方案</option><%
  		sql="select * from Home_Scen Where Username='"&dvbbs.MemberName&"' order by DateAndTime"
  		rshome.open sql,conn,1,1
  		CurOpenFlag=False
  		CurDefaultFlag=False
  		do while not rshome.eof
  			if CurScenID=rshome("ID") then
  				CurOpenFlag=rshome("isopen")
  				CurDefaultFlag=rshome("isdefault")
  				CurURL=rshome("URL")
	  			response.write vbcrlf&"<option value="""&rshome("ID")&""" selected>【"&rshome("name")&"】</option>"
	  			response.write vbcrlf&"<script language=javascript>"
	  			response.write vbcrlf&"function loadScenario"&rshome("ID")&"(notskip) {"
	  			response.write vbcrlf&"if(new Number(notskip) != 1 && 1 == 1) {"
	  			response.write vbcrlf&"var url = 'z_home.asp?scenno="&rshome("ID")&"';"
	  			response.write vbcrlf&"window.location = url;"
	  			response.write vbcrlf&"return ;}"
	  			response.write vbcrlf&"ciRemoveItemAll();"
	  			set rs=server.createobject("ADODB.Recordset")
	  			sql="select d.ItemID,h.Parm1,h.Name,h.Parm3,d.isFlip,d.PosX,d.PosY from Home_ScenDetail d Left Join Home_Items h on d.ItemID=h.ID where d.ScenID="&rshome("ID")&" Order by d.ID"
	  			rs.open sql,conn,1,1
	  			do while not rs.eof
	  				
	  				if rs("ItemID")<>0 then
	  					if rs("isFlip") then
		  					response.write vbcrlf&"ciAddRoomItemShop("&rs("ItemID")&",'"&rs("Parm1")&"','"&rs("Name")&"','0',"&rs("Parm3")&",1,"&rs("PosX")&","&rs("PosY")&");"
		  				else
		  					response.write vbcrlf&"ciAddRoomItemShop("&rs("ItemID")&",'"&rs("Parm1")&"','"&rs("Name")&"','0',"&rs("Parm3")&",0,"&rs("PosX")&","&rs("PosY")&");"
end if
	  				else
	  					if rs("isFlip") then
	  						response.write vbcrlf&"ciAddMyAvata(0,1,"&rs("PosX")&","&rs("PosY")&");"
	  					else
	  						response.write vbcrlf&"ciAddMyAvata(0,0,"&rs("PosX")&","&rs("PosY")&");"
	  					end if
	  				end if
	  				rs.movenext
	  			loop
	  			rs.close
	  			set rs=nothing
	  			response.write vbcrlf&"}"
	  			response.write vbcrlf&"</script>"
  			else
	  			response.write vbcrlf&"<option value="""&rshome("ID")&""">【"&rshome("name")&"】</option>"
  			end if
  			rshome.movenext
  		loop
  		rshome.close
  	%></select><%
   if hasASPPainter() and LocalPic=1 then
    response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;【<a href=""javascript:photoScen()"">绘制方案图纸</a>】"
    if not isNull(CurURL) and CurURL<>"" then
     response.write "&nbsp;【<a href="""&CurURL&""" target=_blank>查看方案图纸</a>】"
    end if
   end if
   %></th>

  </tr>
  <tr>
    <td width="100%" align="center" valign="top" class=tablebody1> 
      <DIV style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; WIDTH: 614px; BORDER-BOTTOM: 1px solid; HEIGHT: 392px">
        <DIV id=divAzitRoomBody UNSELECTABLE="on" style="OVERFLOW: hidden; WIDTH: 614px; POSITION: static; HEIGHT: 392px;"></DIV>
      </DIV></td>
	</tr>
</table>
<table width="622" cellpadding=2 cellspacing=0  class=tableborder1>
  <tr height=25>
    <td class=tablebody2 width=143>&nbsp;目前所选物品总价：<b><font color=red><SPAN id=spanCashView>0</SPAN></font></b> 元</td>                                            
    <td class=tablebody2 width=68 align=center>&nbsp;<%if v_myVIP<>1 then%>普通会员<%else%><font color=red><b>VIP会员</b></font><%end if%></td>
    <td class=tablebody2 width=104>&nbsp; 持有现金：<font color=blue><b><SPAN id=spanHasCash><%=mymoney%></SPAN></b></font>&nbsp;元&nbsp;</td>                                            
    <td class=tablebody2 width="241" align=center><%
    	if CurScenID=0 then
    		response.write "<font color=gray style=""cursor:hand"">新建</font>"
    	else
    		response.write "<a href=""javascript:newScen()""><font color=blue>新建</font></a>"
    	end if
    	response.write "&nbsp;"
    	if CurScenID=0 then
    		response.write "<font color=gray style=""cursor:hand"">改名</font>"
    	else
    		response.write "<a href=""javascript:renameScen()""><font color=blue>改名</font></a>"
    	end if
    	response.write "&nbsp;"
    	if CurScenID=0 then
    		response.write "<font color=gray style=""cursor:hand"">删除</font>"
    	else
	    	response.write "<a href=""javascript:delScen()""><font color=blue>删除</b></a>"
	    end if
	    response.write "&nbsp;"
    	if CurScenID=0 then
    		response.write "<font color=gray style=""cursor:hand"" alt=""允许其他人查看该套虚拟家园设计方案"">开放</font>"
    	else
		    response.write "<a href=""javascript:setOpen()"">"
		    if CurOpenFlag then
		    	response.write "<font color=blue alt=""禁止其他人查看该套虚拟家园设计方案"">保密</font></a>"
		    else
		    	response.write "<font color=blue alt=""允许其他人查看该套虚拟家园设计方案"">开放</font></a>"
		    end if
		  end if
		  response.write "&nbsp;"
    	if CurScenID=0 then
    		response.write "<font color=gray style=""cursor:hand"" alt=""优先显示该套虚拟家园设计方案"">优先</font>"
    	else
		  	if CurDefaultFlag then
		  		response.write "<font color=red alt=""优先显示该套虚拟家园设计方案"" style=""cursor:hand"">优先</font>"
		  	else
		  		response.write "<a href=""javascript:setDefault()""><font color=blue alt=""优先显示该套虚拟家园设计方案"">优先</font></a>"
		  	end if
		  end if
		  response.write "&nbsp;"
		  response.write "<a href=""javascript:selScen()""><font color=blue>恢复</font></a>"
		  response.write "&nbsp;"
		  response.write "<a href=""javascript:ciRemoveItemAll();""><font color=blue>清空</font></a>"
		  response.write "&nbsp;"
		  response.write "<a href=""javascript:saveScen()""><font color=blue>保存</font></a>"
		%></td>
		<td class=tablebody2 width=44 align=center><a href="javascript:openCart();"><font color=blue>购物车</font></a></td>
	</tr>
</table>
  <SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">loadScenario<%=CurScenID%>(1);</SCRIPT>
<table width="167" height="347" cellpadding=2 cellspacing=1 class=tableborder1>
  <tr height=348 valign=top> 
    <td width="1" height="343" class=tablebody1> <table cellpadding=0 cellspacing=0 border=0 align=center width=100%>
        <tr height=100%> 
          <td  align=center><IFRAME WIDTH="450" HEIGHT=342 NAME="ifrm_item_list" FRAMEBORDER=0 SCROLLING=NO SRC="z_home_shop.asp?shopid=199"></IFRAME></td>
        </tr>
      </table></td>
    <td class=tablebody1 width="171"> <table width="155" height="339" border=0 align=center cellpadding=2 cellspacing=1 >
        <tr height=25 valign=middle> 
          <th id=tabletitlelink align=left width=158><INPUT name="checkbox" type=checkbox id=bChkAll  onclick=ciCheckAllBox(this.checked)> 
            &nbsp;<b>装扮中的物品</b></th>
        </tr>
        <tr height="290"> 
          <td height="294" class=tablebody1> <DIV id=divItemList style="PADDING-TOP: 5px; HEIGHT: 290px;OVERFLOW-Y: scroll; OVERFLOW-X: hidden"> 
              <table style="TABLE-LAYOUT: fixed" cellspacing=0 cellpadding=0 width="100%" border=0>
                <tbody id=pRoomItemList>
                </tbody>
              </table>
            </DIV></td>
        </tr>
        <tr height=25 valign="middle"> 
          <td align="center" class=tablebody2><a href="javascript:ciItemMoveZ(true)"><img src="images/img_home/moveup.gif" width="34" height="17" border="0" align="absmiddle"></a>&nbsp;<a href="javascript:ciItemMoveZ()"><img src="images/img_home/movedown.gif" width="34" height="17" border="0" align="absmiddle"></a>&nbsp;<a href="javascript:ciRemoveItem();"><img src="images/img_home/delete.gif" width="34" height="17" border="0" align="absmiddle"></a>&nbsp;<a href="javascript:saveScen();"><img src="images/img_home/save.gif" width="34" height="17" border="0" align="absmiddle"></a></td>
        </tr>
      </table></td>
  </tr>
</table>
  <SCRIPT language=javascript>
isShop = true;
<%if CurOpenFlag then%>
	curOpen=1;
<%else%>
	curOpen=0;
<%end if%>
curVisual="<%=v_myvisual%>";
curUserName="<%=dvbbs.membername%>";
ciInitMakeRoomSet(divAzitRoomBody,divItemList, pRoomItemList);
ciChangeARoomSetCode();
</SCRIPT>
  <%end sub%>
