<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/conn.asp"-->
<!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" />
<meta name="keywords" content="<%=jianbook.sysinfo("keyword")%>" />
<meta name="description" content="<%=jianbook.sysinfo("dsc")%>" />
<title><%=jianbook.sysinfo("title")%>—Powered by 94116.cn</title>
<link href="../ui/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link href="../ui/images/main.css" rel="stylesheet" type="text/css" />

    
</head>


<body style="background:#FFF">
<%
'''jianbook 
''' ==================================================================
''' 版权所有 http://www.9416.cn
''' ------------------------------------------------------------------
''' 此程序为免费开源版，个人可免费自由使用，不得作为商业用途，不可以修改再次发布！
''' ------------------------------------------------------------------
''' 个人使用需要保留版权，如需去除版权请联系作者购买。
''' ==================================================================




dim c_id,c_upid
c_class=0
c_id=0
c_upid=0

if trim(request("upid"))<>"" and IsNumeric(request("upid")) then
c_upid=request("upid")
end if
if trim(request("class"))<>"" and IsNumeric(request("class")) then
c_class=request("class")
end if
if trim(request("id"))<>"" and IsNumeric(request("id")) then
sql="select * from comment where id="&request("id")
rs.open sql,conn,1,1
if not rs.eof then
c_title=rs("name")
c_pic=rs("pic")
c_file=rs("file")
c_id=rs("id")
c_con=rs("content")
c_lm=rs("lm")
end if
rs.close
end if

if request.Cookies("admin")("login")="true" then
uname=request.Cookies("admin")("user")
elseif request.Cookies("user")("login")="true" then
uname=request.Cookies("user")("username")
elseif request.Cookies("guest")("login")="true" then
uname=request.Cookies("guest")("username")
else
uname=look_ip(jianbook.myip())&"游客"
end if

%>

<!--发布信息-->
<div class="c_form" id="c_div"  >
  <form id="cform" name="cform" method="post"  class="layui-form">
  <input type="hidden" name="class" value="<%=c_class%>"  />
 <input type="hidden" name="id" value="<%=c_id%>"  />

  <input type="hidden" name="upid" value="<%=c_upid%>"  />
   <input type="hidden" name="type" value="<%=utype%>"  />

<input type="hidden" name="plat" value="pc"  />
<input type="hidden" name="path" value="<%=webroot%>"  />
 <div class="f_form">


<div class="layui-upload">
<div class="file-div" >

<%if trim(c_file)<>"" then%>
<div class="upload-file"><%=c_file%><input type="hidden" name="fujian" value="<%=c_file%>"><div class="file-close" onclick="fjclose(this)">×</div></div>
<%end if%>


</div>
<div class="upload-div" style="display: block;">
<%if trim(c_pic)<>"" then
sp_pic=split(c_pic,",")
for i=0 to ubound(sp_pic)
%>
<div class="upload-img"><img src="../<%=trim(sp_pic(i))%>" width="80" height="80"><input type="hidden" name="pic" value="<%=trim(sp_pic(i))%>"><div class="upload-close" onclick="picclose(this)">×</div></div>
<%next
end if%>
</div>
<%if request("upid")="" then%>
<div class="file iconfont icon-fujian1" ></div>
<div class="upload layui-icon layui-icon-picture " ></div>
<%end if%>

<%if request("upid")="" and request("send")="" then%>
<div class="f_type">
<select name="lm" class="lm">
  <option value="">选择分类</option>
 	<%
	if request.Cookies("admin")("login")="true" then
	Sql="select * from [type] order by  num asc,id desc"
	else
	Sql="select * from [type] where iscomment=1 order by  num asc,id desc"
	end if
	
rs.open Sql,conn,3,3
	if not rs.eof then
	do while not rs.eof
%>
 <option value="<%=rs("title")%>" <%if c_lm=rs("title") then%> selected="selected"<%end if%>><%=rs("title")%></option>
<%
rs.movenext
loop
end if
rs.close%>
 
</select>

</div>
<%end if%>
    
 
   
</div>
<div class="f_content">
<p><a class="trigger " href="javascript:;"></a></p>
<textarea name="content" class="content" id="content" placeholder="" lay-verify="content"><%=c_con%></textarea>
<div class="textarea-count">
			<span class="textareaInput">0</span>/<span class="textareaTotal">500</span>
		</div>
  <div class="jianbook_cor"><%=jianbook.cor%></div>
</div>


    <div class="f_txt">

	
<%if request("class")=2 then%>
<input name="name" type="hidden" class="f_name"  value="<%=request("send")%>"/>
	<%else%>
    <input name="name" type="hidden"  value="<%=uname%>"/>
<%end if%>
    <input type="button" name="button2"  value="确认提交" class="mes_btn" lay-submit="lay-submit"  lay-filter="mes" />
    </div>
     
  </div>
  
  
  </form>
</div>
<script type="text/javascript" src="../ui/jquery.js"></script>
<script type="text/javascript" src="../ui/layui/layui.js"></script>

<script type="text/javascript" src="../ui/jq.js"></script>

<script type="text/javascript" src="../ui/pc.js?11"></script>
 <script type="text/javascript">
 
	
 layui.use(['layer','form','laydate','upload','element'], function(){ 
  var  layer = layui.layer; 
   var form = layui.form;
    var element = layui.element;
   var laydate = layui.laydate;
  var upload = layui.upload;
	  checknum()
	  $("textarea").focus()
	upload.render({
    elem: '.upload'
    ,url: '../upload/index.asp'
	 ,multiple: true
	,number:10
    ,before: function(obj){
	layer.load(); 
    }
    ,done: function(res){
		  layer.closeAll('loading');
      //如果上传失败
      if(res.code > 0){
        return layer.msg(res.msg);
      }
      //上传成功
	    if(res.code == 0){
		
	var item=this.item
		console.log(item)
		item.parent(".layui-upload").find(".upload-div").show(500)
	
	item.parent(".layui-upload").find(".upload-div").append("<div class='upload-img'><img src=../"+res.data["src"]+" width=80 height=80><input type='hidden' name='pic' value="+res.data["src"]+"  /><div class='upload-close' onclick='picclose(this)'>×</div></div>");
		
	
        return layer.msg(res.msg);
		
      }
    }
    ,error: function(){
		  layer.closeAll('loading');
      //演示失败状态，并实现重传
     return layer.msg('上传失败');
    
    }
  });
  
  
  upload.render({
    elem: '.file'
    ,url: '../upload/file.asp'
	,accept: 'file'
    ,before: function(obj){
	layer.load(); 
    }
    ,done: function(res){
		  layer.closeAll('loading');
      //如果上传失败
      if(res.code > 0){
        return layer.msg(res.msg);
      }
      //上传成功
	    if(res.code == 0){
		
	var item=this.item
		
	

	item.parent(".layui-upload").find(".file-div").html('<div class="upload-file">'+res.data["src"]+"<input type='hidden' name='fujian' value="+res.data["src"]+"  /><div class='file-close' onclick='fjclose(this)'>×</div></div>");
	
        return layer.msg(res.msg);
		
      }
    }
    ,error: function(){
		  layer.closeAll('loading');
      //演示失败状态，并实现重传
     return layer.msg('上传失败');
    
    }
  });

  
  

  


});
 

    </script>
    <%=jianbook.jcount(2)%>
</body>
</html>
