<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/Function_PC.asp"-->
<!--#include file="loginisok.asp"-->
<%
unav=3
bclassname="会员中心"
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>发布信息 - <%=Dream_SiteTitle%></title>
<meta name="keywords" content="<%=Dream_SiteKeywords%>" />
<meta name="description" content="<%=Dream_SiteDescription%>" />
<!--#include file="jscss.asp"-->
<!--#include file="inc/zdsbphone.asp"-->
<script type="text/javascript" src="js/jquery.wallform.js"></script>
<script type="text/javascript">
$(function(){
	$('#photoimg').die('click').live('change', function(){
		var imgnum=1
		if($("#preview div").length<imgnum){
		var status = $("#up_status");
		var btn = $("#up_btn");		
		$("#imageform").ajaxForm({
			target: '#preview', 
			beforeSubmit:function(){
				status.show();
				btn.hide();
			}, 
			success:function(){
				status.hide();
				btn.show();
			}, 
			error:function(){
				status.hide();
				btn.show();
		}}).submit();		
		}else{
		alert("最多只能上传"+imgnum+"传图片!");
		}
	});
});
</script>
<script>
$(document).ready(function(){
  $("button").live("click",function(){
  var imgid=$(this).val();
  //alert($(this).attr("name"));
  var buttonname=$(this).attr("name");
  var imgsrc=$("#"+imgid+" img").attr("src");
  if ($(this).attr("name")=="del"){  
	  $.get("delimg.asp?src="+imgsrc,function(data,status){if(data){alert(data);}});
	  $("#"+imgid+"").remove();  
  }
  });  
});
</script>
</head>
<body>
<!--#include file="nheader.asp"-->
<div class="conment">
	<div class="local">当前位置：<a href="index.asp">首页</a> > <a href="user.asp">会员中心</a> > 发布信息</div>
	<div class="about_nav">
		<h3>会员中心</h3>
		<ul>		
		<!--#include file="usernav.asp"-->
		</ul>		
	</div>
	<div class="about_right">
		<div class="about_right_title"><h3>发布信息</h3><span>注：图片格式gif,jpg,bmp,jpeg,png；不要超过2M。</span></div>
		<div class="about_right_con">
		<span style="font-size:14px; color:#FF0000;">实名认证后发布信息自动审核，马上发布马上显示，为了方便您的宣传请您尽快认证</span>
			<div class="reg">
			<form id="imageform" name="form1" method="post" enctype="multipart/form-data" action="upfile1.asp">
			<div class="updemo"><div id="up_status" style="display:none"><img src="loader.gif" alt="uploading"/></div>
			<div id="up_btn" class="btn">
				<span>添加缩略图</span>
				<input id="photoimg" type="file" name="photoimg">
			</div>
			</div>	
			</form>
			<div id="preview"></div>
			<ul>
			<form name="form1" method="post" action="addinfo_ok.asp?action=addinfo">
			<textarea name="picurl" id="picurl" style="display:none"></textarea>
			<li><span>所属地区：</span>
			<select name="p_area" id="p_area">
				<option value="请选择">选择地区</option>
			<%
			set rs=server.CreateObject("adodb.recordset")
			sql="select * from Dream_Area where Dream_ClassID=0 order by Dream_Zid asc"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			do while not rs.eof
			%>
				<option value="<%=rs("id")%>"> + <%=rs("Dream_Names")%></option>
			<%
				set rss=server.CreateObject("adodb.recordset")
				sqls="select * from Dream_Area where Dream_ClassID="&rs("id")&" order by Dream_Zid asc"
				rss.open sqls,conn,1,1
				if not(rss.eof and rss.bof) then
				do while not rss.eof
				%>
				<option value="<%=rss("id")%>"> --- <%=rss("Dream_Names")%></option>
				<%
				rss.movenext
				loop
				end if
				rss.close
				set rss=nothing 
			rs.movenext
			loop
			else
			%>
				<option value="0">暂无分类</option>
				<%
			end if
			rs.close
			set rs=nothing
			%>
			</select></li>
			<li><span>所属分类：</span><select name="p_theme" id="p_theme">
			<option value="请选择">选择分类</option>
			<%
			set rs=server.CreateObject("adodb.recordset")
			sql="select * from Dream_Theme where Dream_ClassID=0 order by Dream_Zid asc"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			do while not rs.eof
			%>
				<option value="<%=rs("id")%>"> + <%=rs("Dream_Names")%></option>
			<%
				set rss=server.CreateObject("adodb.recordset")
				sqls="select * from Dream_Theme where Dream_ClassID="&rs("id")&" order by Dream_Zid asc"
				rss.open sqls,conn,1,1
				if not(rss.eof and rss.bof) then
				do while not rss.eof
				%>
				<option value="<%=rss("id")%>"> --- <%=rss("Dream_Names")%></option>
				<%
				rss.movenext
				loop
				end if
				rss.close
				set rss=nothing 
			rs.movenext
			loop
			else
			%>
				<option value="0">暂无分类</option>
				<%
			end if
			rs.close
			set rs=nothing
			%>
			</select></li>
			<li><span>标题：</span><input type="text" name="p_title" id="p_title" class="input_1" value=""></li>
			<li><span>简要：</span><input type="text" name="p_titlecon" id="p_titlecon" class="input_1" value=""></li>
			<li><span>电话：</span><input type="text" name="p_phone" id="p_phone" class="input_1" value=""></li>
			<li><span>QQ：</span><input type="text" name="p_qq" id="p_qq" class="input_1"></li>
			<li><span>地址：</span><input type="text" name="p_address" id="p_address"  class="input_1" value=""></li>
			<li><span>地图链接：</span><input type="text" name="p_mapurl" id="p_mapurl" class="input_1" value=""></li>
			<li class="nop"><span>优惠信息：</span><textarea name="p_content4" rows="4" id="p_content4"></textarea></li>
			<li class="nop"><span>温馨提示：</span><textarea name="p_content" rows="4" id="p_content"></textarea></li>
			<li class="nop"><span>商家介绍：</span><textarea name="p_content3" rows="4" id="p_content3"></textarea></li>
			<input type="hidden" name="p_ceshi">
			<li class="an">
			   <input type="submit"  id="button" value="添加信息" class="input_an" >
			 </li>
			</form>
			</ul>
			</div>
		</div>
	</div>	
</div>
<!--#include file="footer.asp"-->
<script>
$('#button').click(function () {
	$("#picurl").html($("#preview").html());
	var p_area = $('#p_area').val();
	var p_theme = $('#p_theme').val();
	var p_title = $('#p_title').val();
	if (p_area == "请选择") {
		alert("请选择所属地区");
		return false;
	}
	if (p_theme == "请选择") {
		alert("请选择所属分类");
		return false;
	}	
	if (p_title.length<1) {
		alert("标题不能为空");
		return false;
	}
});	
</script>
</body>
</html>
