<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="editsell.aspx.cs" Inherits="HeyuanHouse.Web.member.editsell" %>
<%@ Register src="../siteheader.ascx" tagname="siteheader" tagprefix="uc1" %>
<%@ Register src="../sitefooter.ascx" tagname="sitefooter" tagprefix="uc2" %>
<%@ Register src="membernav.ascx" tagname="membernav" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>河房网 - 专业的房产信息交易平台 - www.0762h.com</title>
<link href="../images/style.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="../editor/jquery/theme/redmond/jquery-ui-custom.css" rel="stylesheet" />	
<script type="text/javascript" src="../editor/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../editor/jquery/jquery-ui-custom.min.js"></script>
<script type="text/javascript" src="../editor/xheditor-zh-cn.js"></script>
<script type="text/javascript" src="../editor/xheditor_plugins/ubb.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$('#txtdetail').xheditor(true,{plugins:{Code:{c:'btnCode',t:'插入代码',e:function(){
			var _this=this;
			var htmlCode='<div><select id="xheCodeType"><option value="html">HTML/XML</option><option value="javascript">JavaScript</option><option value="css">CSS</option><option value="php">PHP</option><option value="csharp">C#</option><option value="cpp">C++</option><option value="java">Java</option><option value="perl">Perl</option><option value="python">Python</option><option value="ruby">Ruby</option><option value="vb">Visual Basic</option><option value="delphi">Delphi</option><option value="as3">Action Script 3</option><option value="sql">SQL</option><option value="plain">其它</option></select></div><div><textarea id="xheCodeValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>';
			var jCode=$(htmlCode),jType=jSave=$('#xheCodeType',jCode),jValue=jSave=$('#xheCodeValue',jCode),jSave=$('#xheSave',jCode);
			jSave.click(function(){
				_this.focus();
				_this.pasteText('[code='+jType.val()+']\r\n'+jValue.val()+'\r\n[/code]');
				_this.hidePanel();
				return false;	
			});
			_this.showDialog(jCode);
		}}},
		tools:'FontSize,FontColor,Bold,Italic,Underline,Removeformat,Separator,Align,Link,Unlink,Separator,Blocktag',forcePtag:false,showBlocktag:false,beforeSetSource:ubb2html,beforeGetSource:html2ubb,emots:{'qq':{'name':'QQ','count':55,'width':25,'height':25,'line':11}},emotMark:true});
}
//function submitForm(){$('#frmDemo').submit();}
</script>
<style type="text/css">
.addfile {cursor:pointer;height:20px;position:absolute;margin:0px 0 0 -75px;width:1px;filter:alpha(opacity=0);opacity:0;}
</style>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data">
<uc1:siteheader ID="siteheader1" runat="server" />
<div id="sitenav">您现在的位置：<a href="/">河房网</a> &gt;&gt; <a href="/member/">会员中心</a></div>
<div class="main">
  <div class="boxright">
      <uc3:membernav ID="membernav1" runat="server" />
</div>
  <div class="boxlefts">
<div id="myistit"><span>修改二手房信息</span> (标有<font color="red">*</font>号为必须填写项)</div>
<div id="myissay">
<table width="100%" border="0" cellpadding="8" cellspacing="0" class="usertables">
              <tr>
				<td colspan="2"><h2>第一步：填写房源基本信息<span>(标有<font color="red">*</font>号为必须填写项)</span></h2></td>
			  </tr>
			  <tr>
				<td width="15%" align="right"><em>*</em>所在区域：</td>
				<td>
				<asp:DropDownList runat="server" ID="ddlarea" DataValueField="aid" DataTextField="name" />
				</td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>房屋类型：</td>
				<td>
				<asp:DropDownList runat="server" ID="ddlhouseclass" DataValueField="cid" DataTextField="name" />
				<span class="menber_right_post_span">（1-7层为普通住宅，8-12层为小高层，13层以上为高层）</span></td>
			  </tr>
			  
			  <tr>
				<td align="right"><em>*</em>小区名称：</td>
				<td><asp:TextBox runat="server" ID="txtzone" MaxLength="25" /><span class="menber_right_post_span">（请填写小区名称，如：广晟花园；如非小区，可填写就近的路名，如：文明路）<asp:RequiredFieldValidator 
                        ID="rfvForZone" runat="server" ControlToValidate="txtzone" Display="None" 
                        ErrorMessage="请填写小区名称"></asp:RequiredFieldValidator>
                    </span></td>
			  </tr>
			  
			  <tr>
				<td align="right"><em>*</em>建筑面积：</td>
				<td><asp:TextBox runat="server" ID="txtbuildingarea" MaxLength="7" /> M<sup>2</sup><span class="menber_right_post_span">（请填写数字）<asp:RequiredFieldValidator 
                        ID="rfvbuildingarea" runat="server" ControlToValidate="txtbuildingarea" 
                        Display="None" ErrorMessage="请填写建筑面积"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revbuildingarea" runat="server" 
                        ControlToValidate="txtbuildingarea" Display="None" ErrorMessage="建筑面积请填写数字" 
                        ValidationExpression="^[1-9]\d*$"></asp:RegularExpressionValidator>
                    </span></td>
			  </tr>
			  <tr>
				<td align="right">装修情况：</td>
				<td><table id="PersonRentalSource_ctl00_rbDecorate" border="0">
		<tr>
			<td>
			<asp:RadioButtonList runat="server" ID="rbldecorate" RepeatDirection="Horizontal" RepeatLayout="Flow">
			  <asp:ListItem Text="毛坯房" Value="毛坯房" />
			  <asp:ListItem Text="简易装修" Value="简易装修" Selected="True" />
			  <asp:ListItem Text="精装修" Value="精装修" />
			  <asp:ListItem Text="豪华装修" Value="豪华装修" />
			</asp:RadioButtonList>
			</td>
		</tr>
	</table>
				</td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>房型：</td>
				<td>
				<asp:DropDownList runat="server" ID="ddlroomcount">
				  <asp:ListItem Text="1" Value="1" />
				  <asp:ListItem Text="2" Value="2" />
				  <asp:ListItem Text="3" Value="3" />
				  <asp:ListItem Text="4" Value="4" />
				  <asp:ListItem Text="5" Value="5" />
				  <asp:ListItem Text="6" Value="6" />
				  <asp:ListItem Text="7" Value="7" />
				  <asp:ListItem Text="8" Value="8" />
				  <asp:ListItem Text="9" Value="9" />
				</asp:DropDownList>
				房
				<asp:DropDownList runat="server" ID="ddlhallcount">
				  <asp:ListItem Text="0" Value="0" />
				  <asp:ListItem Text="1" Value="1" />
				  <asp:ListItem Text="2" Value="2" />
				  <asp:ListItem Text="3" Value="3" />
				  <asp:ListItem Text="4" Value="4" />
				  <asp:ListItem Text="5" Value="5" />
				  <asp:ListItem Text="6" Value="6" />
				  <asp:ListItem Text="7" Value="7" />
				  <asp:ListItem Text="8" Value="8" />
				  <asp:ListItem Text="9" Value="9" />
				</asp:DropDownList>
				厅
				<asp:DropDownList runat="server" ID="ddltoiletcount">
				  <asp:ListItem Text="0" Value="0" />
				  <asp:ListItem Text="1" Value="1" />
				  <asp:ListItem Text="2" Value="2" />
				  <asp:ListItem Text="3" Value="3" />
				  <asp:ListItem Text="4" Value="4" />
				  <asp:ListItem Text="5" Value="5" />
				  <asp:ListItem Text="6" Value="6" />
				  <asp:ListItem Text="7" Value="7" />
				  <asp:ListItem Text="8" Value="8" />
				  <asp:ListItem Text="9" Value="9" />
				</asp:DropDownList>
				卫
				</td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>售价：</td>
				<td><asp:TextBox runat="server" ID="txtsellmoney" MaxLength="6" />万元
				<span class="menber_right_post_span">（请填写数字，面议可填写0）</span> <span class="menber_right_post_span">
                    <asp:RequiredFieldValidator ID="rfvsellmoney" runat="server" 
                        ControlToValidate="txtsellmoney" Display="None" ErrorMessage="请填写售价"></asp:RequiredFieldValidator>
                    </span>
				</td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>描述标题：</td>
				<td><asp:TextBox runat="server" ID="txttitle" Width="300px" MaxLength="25" /> <a href="javascript:void(0)" onclick="makerentaltitle()">自动填写标题</a><span class="menber_right_post_span"><asp:RequiredFieldValidator 
                        ID="rfvtitle" runat="server" ControlToValidate="txttitle" Display="None" 
                        ErrorMessage="请填写房屋描述标题"></asp:RequiredFieldValidator>
                    </span></td>
			  </tr>
			  <tr>
				<td align="right" valign="top">详细描述：</td>
				<td><span class="menber_right_post_span">
                    你可以简单的介绍一下您的房子，请不要在这里留电话号码<br /></span></td>
			  </tr>
			  <tr>
			    <td></td>
			    <td colspan="1" align="center" valign="top">
			    <div>
			     <!--编辑器开始-->
			     <asp:TextBox runat="server" ID="txtdetail" Rows="12" Columns="80" Width="100%" TextMode="MultiLine" />
			    </div></td>
		      </tr>
		       <tr>
				<td colspan="2"><h2>第二步：填写联系方式<span>(标有<font color="red">*</font>号为必须填写项)</span></h2></td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>联系人：</td>
				<td><asp:TextBox runat="server" ID="txtlinkman" MaxLength="20" /><span class="menber_right_post_span">
                    <asp:RequiredFieldValidator ID="rfvlinkman" runat="server" 
                        ControlToValidate="txtlinkman" Display="None" ErrorMessage="请填写联系人"></asp:RequiredFieldValidator>
                    </span></td>
			  </tr>
			  <tr>
				<td align="right"><em>*</em>联系电话：</td>
				<td><asp:TextBox runat="server" ID="txtlinktel" MaxLength="20" /><span class="menber_right_post_span">
                    <asp:RequiredFieldValidator ID="rfvlinktel" runat="server" 
                        ControlToValidate="txtlinktel" Display="None" ErrorMessage="请填写联系电话"></asp:RequiredFieldValidator>
                    </span></td>
			  </tr>
			  <tr>
				<td colspan="2"><h2>第三步：填写补充信息<span>(选填，越详细越容易获得客户关注哦)</span></h2></td>
			  </tr>
			  <tr>
				<td align="right">房屋楼层：</td>
				<td>第<asp:TextBox runat="server" ID="txtfloorno" Width="30px" MaxLength="2" />层 / 总<asp:TextBox runat="server" ID="txttotalfloor" Width="30px" MaxLength="2" /><span class="menber_right_post_span">层（出租楼层/总楼层，请填写对应的数字，如第三层，则填写3即可）</span></td>
			  </tr>
			  <tr>
				<td align="right">房屋朝向：</td>
				<td>
				<asp:RadioButtonList runat="server" ID="rbtorientation" RepeatLayout="Flow" RepeatDirection="Horizontal">
				  <asp:ListItem Text="东" Value="东" />
				  <asp:ListItem Text="西" Value="西" />
				  <asp:ListItem Text="南" Value="南" />
				  <asp:ListItem Text="北" Value="北" />
				  <asp:ListItem Text="东南" Value="东南" />
				  <asp:ListItem Text="西南" Value="西南" />
				  <asp:ListItem Text="东北" Value="东北" />
				  <asp:ListItem Text="西北" Value="西北" />
				  <asp:ListItem Text="南北" Value="南北" />
				  <asp:ListItem Text="东西" Value="东西" />
				</asp:RadioButtonList>
				<span class="menber_right_post_span"></span></td>
			  </tr>
			  
			  <tr>
				<td align="right">具体地址：</td>
				<td><asp:TextBox runat="server" ID="txtaddress" MaxLength="25" /><span class="menber_right_post_span">（例如：建设大道28号）</span></td>
			  </tr>
			  <tr>
				<td align="right">地图标注：</td>
				<td> 
				   <asp:TextBox runat="server" ID="txtmaplnglat" />
				   <input type="button" id="btnShowMap" value="地图标注" />
				   <span class="menber_right_post_span"></span></td>
			  </tr>
			  <tr>
				<td rowspan="2" align="right" valign="top">家具清单：</td>
				<td>
				<asp:TextBox runat="server" ID="txtfurnishings" Rows="3" Columns="50" TextMode="MultiLine" MaxLength="150" />
				</td>
			  </tr>
			  <tr>
			    <td><span class="menber_right_post_span">自己填写清单，或者从下面标签中选择：<br /><a id="lb1" name="餐桌" onclick="lbOnClick(this)" href="javascript:void(0)"  >
                    餐桌</a>、<a id="A1" name="双人床" onclick="lbOnClick(this)" href="javascript:void(0)"  >双人床</a>、<a id="A6" name="单人床" onclick="lbOnClick(this)" href="javascript:void(0)"  >单人床</a>、<a id="A2" name="床头柜" onclick="lbOnClick(this)" href="javascript:void(0)" >床头柜</a>、<a id="A3" name="电视机" onclick="lbOnClick(this)" href="javascript:void(0)"  >电视机</a>、<a id="A4" name="宽带" onclick="lbOnClick(this)" href="javascript:void(0)"  >宽带</a>、<a id="A5" name="电视柜" onclick="lbOnClick(this)" href="javascript:void(0)" >电视柜</a>、<a id="A7" name="衣柜" onclick="lbOnClick(this)" href="javascript:void(0)"  >衣柜</a>、<a id="A8" name="沙发" onclick="lbOnClick(this)" href="javascript:void(0)"  >沙发</a>、<a id="A9" name="茶几" onclick="lbOnClick(this)" href="javascript:void(0)" >茶几</a>、<br /><a id="A10" name="空调" onclick="lbOnClick(this)" href="javascript:void(0)"  >
                    空调</a>、<a id="A11" name="冰箱" onclick="lbOnClick(this)" href="javascript:void(0)"  >冰箱</a>、<a id="A12" name="洗衣机" onclick="lbOnClick(this)" href="javascript:void(0)" >洗衣机</a>、<a id="A13" name="饮水机" onclick="lbOnClick(this)" href="javascript:void(0)"  >饮水机</a>、<a id="A14" name="音响" onclick="lbOnClick(this)" href="javascript:void(0)"  >音响</a>、<a id="A15" name="台灯" onclick="lbOnClick(this)" href="javascript:void(0)"  >台灯</a>、<a id="A16" name="电话" onclick="lbOnClick(this)" href="javascript:void(0)"  >电话</a>、<a id="A17" name="热水器" onclick="lbOnClick(this)" href="javascript:void(0)" >热水器</a>、<a id="A18" name="车库" onclick="lbOnClick(this)" href="javascript:void(0)"  >车库</a></span></td>
		      </tr>
		      <tr>
				<td align="right" valign="top">房屋图片：</td>
				<td>
				<a href="javascript:void(0);" title="点此此处可添加需上传图片">点此添加图片<input id="file_addpic_btn_0" class="addfile" name="uploadHousePhoto" onchange="HousePhotoChange(this)" size="1" type="file" /></a>
				<span class="menber_right_post_span">（如室内图，可上传四张图片，每张不大于500K，图片格式只限于JPG、JPEG、GIF）</span></td>
			  </tr>
			  <tr>
				<td align="right" valign="top"></td>
				<td>
				  <div>
				    <ul>
				      <input type="hidden" runat="server" id="txtNeedDeletedPicPids" />
				    </ul>
				  </div>
				  <div id="housePhotoPeview">
				  </div>
				</td>
			  </tr>
			  <tr>
			    <td align="center" valign="top">&nbsp;</td>
		        <td valign="top">
		        <asp:Button runat="server" ID="btnPost" CssClass="member_right_posted" 
                        Text="修改完成,我要保存" onclick="btnPost_Click" />
		            <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="请按下面提示填写信息再发布" 
                        ShowMessageBox="True" ShowSummary="False" />
		        </td>
			  </tr>
		  </table>
</div>
  </div>
</div>
<!-- 遮罩类弹出层 -->
<div id="divIframe" title="地图标注" style="text-align:center;">
   <iframe frameborder="0" style="width:610px ; height:400px" id="mapIframe"></iframe>
</div>
<input type="button" id="btnCloseMapFrame" style="display:none" />
<script type="text/javascript">
    function lbOnClick(obj)
    {
        var tbShow=document.getElementById("txtfurnishings");
        var s=tbShow.value;
        var o=obj.name; 
       
        if(s==""){
        tbShow.value=o;
         
        }
        else
        {
            if(s.indexOf(o)==-1)
            {
                tbShow.value+="、"+o;
            }
            else
            {
                alert("清单内已有！");
            }
        }
       
    }
    
    function makerentaltitle()
    {
        var zone = document.getElementById("txtzone").value ;
        var roomcount = document.getElementById("ddlroomcount").options[document.getElementById("ddlroomcount").selectedIndex].value ;
        var hallcount = document.getElementById("ddlhallcount").options[document.getElementById("ddlhallcount").selectedIndex].value ;
        var toiletcount = document.getElementById("ddltoiletcount").options[document.getElementById("ddltoiletcount").selectedIndex].value ;
        
        var title = zone + roomcount + "房" ;
        if (hallcount != "0")
            title += hallcount + "厅" ;
        
        if (toiletcount != "0")
            title += toiletcount + "卫" ;
            
        document.getElementById("txttitle").value = title + "出售" ;
    }
    
    $("#txtfloorno").bind("keypress", function(e){if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;});
    $("#txttotalfloor").bind("keypress", function(e){if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;});
    $("#txtbuildingarea").bind("keypress", function(e){if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;});
    $("#txtsellmoney").bind("keypress", function(e){if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;});
    
    //btnShowMap
    /*==========事件绑定==========*/
    $(function()
    {
        //遮罩类弹出层
        $("#btnShowMap").click(function(event)
        {
            event.preventDefault();
            event.stopPropagation();
            
            $("#divIframe").dialog("open");
            document.getElementById("mapIframe").src = "googlemap.aspx" ; // "map.aspx" ;
        });

        //单击自身取消冒泡
        $("#divIframe").bind("click", function(event)
        {
            event.stopPropagation();
        });

        //document对象单击隐藏所有弹出层
        $(document).bind("click", function(event)
        {
            $("#divIframe").dialog("close");
        });
        
        //document对象单击隐藏所有弹出层
        $("#btnCloseMapFrame").bind("click", function(event)
        {
            $("#divIframe").dialog("close");
        });
    });
    
    /*==========加载时执行的语句==========*/
    $(function()
    {
        //初始化遮罩类弹出层
        $("#divIframe").dialog({
            show: null,
            bgiframe: false,
            autoOpen: false,
            draggable: true,                
            resizable: false,
            modal: true,
            width: 620,
            height: 410
        });            
    });
    
    /*===图片上传UI处理JS_start===*/
    var uploadPicArray = new Array() ;
    var uploadPicCount = 0 ;
    var uploadPicNo = 0 ;
     
    <%= HousePhotoInitJs %> 
        
    function HousePhotoChange(f)
    {    
        if (!f.value.IsAllowUploadPic())
        {
           alert("请上传JPG、JPEG、GIF格式的图片！") ;
           return ;
        }
        
        if (uploadPicCount >= 4)
        {
           alert("最多只能上传4张图片！") ;
           return ;
        }
        
        uploadPicArray[uploadPicCount] = new Array(uploadPicNo,f.value) ;        
        uploadPicCount++ ;
        uploadPicNo++ ;
        
        renderPhotoHtml() ;
        
        var new_element=document.createElement('input'); 
        new_element.type='file'; 
        new_element.size=1; 
        new_element.name = "file_addpic_btn" ;
        new_element.className="addfile"; 
        new_element.onchange= function() { HousePhotoChange(this); };
        new_element.id = "file_addpic_btn_" + uploadPicNo ;
        f.parentNode.insertBefore(new_element, f); 
        f.style.position ='absolute'; 
        f.style.left='0px'; 
    }
    
    function removeHousePhoto(picno)
    {
        var tempPicArray = new Array() ;
        var tempindex = 0 ;
        for(var i = 0 ; i < uploadPicCount ;i++)
        {
            if (uploadPicArray[i][0] != picno)
            {
               tempPicArray[tempindex] = uploadPicArray[i] ;
               tempindex++ ;
            }
        }
        
        uploadPicArray = tempPicArray ;
        uploadPicCount-- ;
        
        try{
        var delobj = document.getElementById("file_addpic_btn_" + picno) ;
        delobj.parentNode.removeChild(delobj) ;
        }catch(err) {}
        
        var needDeletedPicPids = document.getElementById("txtNeedDeletedPicPids").value ;
        if (needDeletedPicPids.length == 0)
           needDeletedPicPids = picno ;
        else 
           needDeletedPicPids += "," + picno ; 
        
        document.getElementById("txtNeedDeletedPicPids").value = needDeletedPicPids ;
        renderPhotoHtml() ;
    }
    
    function renderPhotoHtml()
    {
        var html = "" ;
        for(var i = 0 ; i < uploadPicCount ; i++)
        {
            html += "<img src='" + uploadPicArray[i][1] + "' width='100px' height='75px' /> <a href='javascript:removeHousePhoto(" + uploadPicArray[i][0] + ");'>删?</a> " ;
        }
        
        $("#housePhotoPeview").html(html) ;
    }
    
    String.prototype.IsAllowUploadPic = function() 
    { 
        var strFilter=".jpeg|.gif|.jpg|" ;
        if(this.indexOf(".")>-1) 
        { 
	        var p = this.lastIndexOf("."); 
	        var strPostfix=this.substring(p,this.length) + '|'; 
	        strPostfix = strPostfix.toLowerCase(); 
	        if(strFilter.indexOf(strPostfix)>-1) 
	        { 
		        return true; 
	        } 
        } 
        return false; 
    }
    
    /*===图片上传UI处理JS_end===*/
</script>
<uc2:sitefooter ID="sitefooter1" runat="server" />
</form>
</body>
</html>
