<%@ page language="C#" autoeventwireup="true" inherits="acad_post, kfenlei" %><%@ Register Src="inc/adminTop.ascx" TagName="adminTop" TagPrefix="qth8" %><!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>
<title>框分类信息系统 后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<%=tools.sHtmlEdit("content")%>
<style type="text/css" >
#swfupload-control p{ margin:10px 5px; line-height:25px; height:25px; color:#666666; font-size:12px; }
#preview{ margin:0; padding:0; width:800px;}
#preview li{ list-style:none; margin:2px; border:1px solid #ccc; padding:5px; font-size:12px; 
	font-family:Arial, Helvetica, sans-serif; color:#333; float:left; width:140px; height:auto; background:#fff; position:relative;}
#preview li .progressbar{ border:0px solid #333; height:5px; overflow:hidden; margin-top:3px; background:#fff; }
#preview li .progress{ background:#009900; width:0%; height:5px;}
#preview li p{ margin:0; line-height:18px; }
#preview li.success{ border:1px solid #cccccc; background:#ffffff; }
#preview li span.cancel{cursor:pointer; }
#preview li .pic{ width:140px; height:110px; }
#preview li .pic img{ width:140px; height:110px;}
</style>
</head>
<body>
<div align="center">
<div class="main" align="left">
<qth8:adminTop ID="AdminTop1" runat="server" />
<script type="text/javascript" src="inc/swfupload/swfupload.js"></script>
<script type="text/javascript" src="inc/jquery.swfupload.js"></script>
<script type="text/javascript">
var s1;
$(function(){
	$('#swfupload-control').swfupload({
		upload_url: "inc/upload.aspx",
		file_post_name: 'uploadfile',
		file_size_limit : "300000",
		file_types : "<%=sUploadType %>",
		file_types_description : "Image files",
		file_upload_limit : 100,
		flash_url : "inc/swfupload.swf",
		button_image_url : 'inc/button.png',
		button_width : 114,
		button_height : 30,
		button_placeholder : $('#button')[0],
		debug: false
	})
		.bind('fileQueued', function(event, file){
			var listitem='<li id="'+file.id+'" >'+
				'<div class="pic" id="pic'+file.id+'"></div>'+
				'<div class="progressbar" ><div class="progress"></div></div>'+
				'<p class="status" >等待上传 | <span class="cancel">删除</span></p>'+
				'</li>';
			$('#preview').append(listitem);
			$('li#'+file.id+' .cancel').bind('click', function(){
				var swfu = $.swfupload.getInstance('#swfupload-control');
				swfu.cancelUpload(file.id);
				$('li#'+file.id).slideUp('fast');
			});
			// start the upload since it's queued
			$(this).swfupload('startUpload');
		})
		.bind('fileQueueError', function(event, file, errorCode, message){
		if(errorCode=='-100')
			{
				alert('最多可以上传100张图片！');
			}
			else
			{
				alert('图片：【'+file.name+'】过大！');
			}
		})
		.bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
			$('#queuestatus').text('');
		})
		.bind('uploadStart', function(event, file){
			$('#preview li#'+file.id).find('p.status').text('0%上传中...');
			$('#preview li#'+file.id).find('span.cancel').hide();
		})
		.bind('uploadProgress', function(event, file, bytesLoaded){
			//Show Progress
			var percentage=Math.round((bytesLoaded/file.size)*100);
			$('#preview li#'+file.id).find('div.progress').css('width', percentage+'%');
			$('#preview li#'+file.id).find('p.status').text(percentage+'%上传中...');
		})
		.bind('uploadSuccess', function(event, file, serverData){
			var item=$('#preview li#'+file.id);
			item.find('div.progress').css('width', '100%');
			item.addClass('success').find('p.status').html('100%上传成功! | <span class="cancel" onclick="delPic(\''+file.id+'\')">删除</span>');
			q$("pic"+file.id).innerHTML='<a href="/'+serverData+'" target="blank"><img src="/'+serverData+'" id="img'+file.id+'" border="0" /></a>';
			q$("pic").value+=serverData+",";
		})
		.bind('uploadComplete', function(event, file){
			// upload has completed, try the next one in the queue
			$(this).swfupload('startUpload');
		});
			if(q$("pic").value!="")
			{
				arrPic=q$("pic").value.split(",");
				var picCount=0;
				for(t=0;t<arrPic.length;t++)
				{
					if(arrPic[t]!="")
					{
						picCount++;
						q$("preview").innerHTML+='<li id="'+t+'" >'+
						'<div class="pic" id="pic'+t+'"><a href="/'+arrPic[t]+'" target="_blank"><img src="/'+arrPic[t]+'" id="img'+t+'" border="0" /></a></div>'+
						'<div class="progressbar" ><div class="progress"></div></div>'+
						'<p class="status" >100%上传成功! | <span class="cancel" onclick="delPic(\''+t+'\')">删除</span></p>'+
						'</li>';
					}
				}
			}
		
	
});	

function delPic(pid){
var picPath=decodeURI(q$("img"+pid).src);
$('li#'+pid).slideUp('fast');
var swfu = $.swfupload.getInstance('#swfupload-control');
var stats = swfu.getStats();  
stats.successful_uploads --;  
swfu.setStats(stats);
var picArr=q$("pic").value.split(',');
q$("pic").value="";
for(i=0;i<picArr.length;i++)
{
	if(picPath.indexOf(picArr[i])<0)
	{
		q$("pic").value+=picArr[i]+",";
	}
}
}
</script>
<script type="text/javascript">
layui.use(['form','laydate'], function(){
var form = layui.form();
form.render();
form.on('radio(top)', function(data){
fzdfs();
});
form.on('select(address)', function(data){
acLoadAddress($("#address").val(),"");
});
});
function fzdfs()
{
	var sTop=$("input:radio[name='top']:checked").val();
	if(sTop>0)
	{
		$('#zdfs').show();
	}
	else
	{
		$('#zdfs').hide();
	}
}
</script>
<div class="d01">
<div class="tabTitle">发布信息</div>
<form id="infoEdit" name="infoEdit" method="post" class="layui-form" action="action.aspx?s=postMess">
<table width="100%" border="0" class="layui-table" cellspacing="0" cellpadding="0">
<tr>
<td width="100">审核</td>
<td><input type="radio" name="power" value="1" checked="checked" title="已审核" /><input type="radio" name="power" value="0" title="未审核" /></td>
</tr>
<tr>
<td width="100">置顶</td>
<td><strong>是否置顶：</strong><input type="radio" name="top" lay-filter="top" value="0" title="未置顶" checked="checked" /><input type="radio" lay-filter="top" name="top" value="1" title="小格置顶" /><input type="radio" name="top" lay-filter="top" value="2" title="大格置顶" /><input type="radio" lay-filter="top" name="top" value="4" title="超大格置顶" />
<div id="zdfs" style="display:none;"><strong>置顶方式：</strong><input type="radio" name="top1" value="1" title="普通置顶" checked="checked" /><input type="radio" name="top1" value="0" title="分类置顶" /><input type="radio" name="top1" value="2" title="全局置顶" /><br />
<strong>置顶排序：</strong><input name="topNum"  type="text" value="<%=sTopNum%>" style="width:200px;" class="inputText" /></div>
<script type="text/javascript">
layui.use(['form','laydate'], function(){
var form = layui.form();
form.render();
form.on('radio(top)', function(data){
fzdfs();
});
form.on('select(address)', function(data){
acLoadAddress($("#address").val(),"");
});
});
function fzdfs()
{
	var sTop=$("input:radio[name='top']:checked").val();
	if(sTop>0)
	{
		$('#zdfs').show();
	}
	else
	{
		$('#zdfs').hide();
	}
}
</script>
</td>
</tr>
<tr>
<td>置顶到期</td>
<td><input name="topDate"  type="text" value="<%=sTopDate%>" onclick="layui.laydate({elem:this})" class="layui-input" /></td>
</tr>
<tr>
<td width="100">标题加红</td>
<td><input type="radio" name="hot" value="0" title="关" checked="checked" /><input type="radio" name="hot" value="1" title="开" /></td>
</tr>
<tr>
<td width="100">标题加红到期</td>
<td><input name="hotDate"  type="text" value="" onclick="layui.laydate({elem:this})" class="layui-input" /></td>
</tr>
</table>
<div class="tabTitle">信息内容</div>
<table width="100%" border="0" class="layui-table" cellspacing="0" cellpadding="0">
<tr>
<td>用户ID</td>
<td><input name="uid" type="text" value="<%=sUid%>" class="layui-input" /></td>
</tr>
<tr>
<td width="100">用户类别</td>
<td><input type="radio" name="userclass" checked="checked" value="0" title="个人" /><input type="radio" name="userclass" value="1" title="中介" /></td>
</tr>
<tr>
<td>标题</td>
<td><input name="title" type="text" value="<%=sTitle%>" class="layui-input" /></td>
</tr>
<tr>
<td>分类</td>
<td><input name="sort"  type="text" value="<%=sSort%>" id="tbSort" class="layui-input" />
<script type="text/javascript">
var obj;
var objInput;
$("#tbSort").click(function()
{
obj=layer.tab({
  area: ['800px', '400px'],
  tab: [{title: '分类选择',  content: '<%=sSortList %>'}]});
});
function changesort(sobj)
{
	document.getElementById("tbSort").value=sobj
	layer.close(obj);
}
</script></td>
</tr>
<tr>
<td>信息内容</td>
<td><textarea rows="20" style="width:90%" name="content" id="content"><%=sContent%></textarea></td>
</tr>
<tr>
<td>所在地</td>
<td><%=tools.showAddressSelectAdmin("address","address1") %></td>
</tr>
<tr>
<td>联系人</td>
<td><input name="name"  type="text" value="<%=sName%>" class="layui-input" /></td>
</tr>
<tr>
<td>价格</td>
<td><input name="price"  type="text" value="<%=sPrice%>" class="layui-input" /></td>
</tr>
<tr>
<td>电话</td>
<td><input name="tel"  type="text" value="<%=sTel%>" class="layui-input" /></td>
</tr>
<tr>
<td>微信</td>
<td><input name="weixin"  type="text" value="<%=sWeixin%>" class="layui-input" /></td>
</tr>
<tr>
<td>ＱＱ</td>
<td><input name="qq"  type="text" value="<%=sQQ%>" class="layui-input" /></td>
</tr>
<tr>
<td>过期日期</td>
<td><input name="overDate"  type="text" value="<%=sOverDate%>" onclick="layui.laydate({elem:this})" class="layui-input" /></td>
</tr>
<tr>
<td class="head">查看数</td>
<td><input name="view"  type="text" value="<%=sView%>" class="layui-input" /></td>
</tr>
<tr>
<td>TPoint</td>
<td><input name="tPoint"  type="text" value="<%=sPoint%>" class="layui-input" /></td>
</tr>
<tr>
<td>链接</td>
<td><input name="url"  type="text" value="<%=sUrl%>" class="layui-input" /></td>
</tr>
<tr>
<td>备注</td>
<td><textarea name="comments" rows="5" cols="80" style="height:60px;" class="layui-textarea"></textarea></td>
</tr>
<tr>
<td>图片</td>
<td><div id="swfupload-control">
<input type="button" id="button" />
<input type="hidden" name="pic" id="pic" value="<%=sPic%>" />
<ul id="preview"></ul>
</div></td>
</tr>
<tr>
<td class="head"></td>
<td><input type="submit" class="layui-btn" value="确认发布" /></td>
</tr>
</table>
</div>
</div>
</div>
</form>
<script language="javascript" type="text/javascript">
fzdfs();
</script>
</body>
</html>
