<!--#include file="../include/config.asp"-->
<!--#include file="../include/conn.asp"-->
<!--#include file="inc/check.asp"-->
<!--#include file="inc/function.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>
<title>后台-单页分类管理-powered by jiruinet.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="jiruinet@qq.com,企业建站" />
<meta name="robots" content="index,follow" />
<meta name="description" content="<%=site_title%>,极瑞企业网站系统,powered by jiruinet.com"/>
<meta name="keywords" content="<%=site_title%>后台管理,极瑞企业网站系统"/>
<link rel="stylesheet" type="text/css" href="css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="css/admin.css" media="screen" />
<script type="text/javascript" src="js/jquery/1.9.1/jquery.min.js" charset="utf-8"></script> 
<script type="text/javascript" src="js/layer/1.9.3/layer.js" charset="utf-8"></script> 
<script type="text/javascript">
function CheckAll(form)
{if (listform.submitAllSearch.checked == true)
	{
	   for (var i=0;i<form.elements.length;i++)
	   {
		  var e = form.elements[i];
		  e.checked = true;
	   }
	}
	else
	{
	   for (var i=0;i<form.elements.length;i++)
	   {
		  var e = form.elements[i];
		  e.checked = false;
	   }
	} 
}
</script>
</head>
<body>
<%
Dim cid
cid=request.querystring("cid")
If request.Form("do")="删 除" Then 
	selectid=request.Form("selectid")
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class where id in ("& selectid & ")"
	rs.open sql,conn,1,3
	Do While Not rs.eof And Not rs.bof 
	rs.delete
	rs.update
	rs.movenext
	Loop 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	response.redirect "about_class.asp"
End If 
If request.querystring("action")="del" Then 
	If IsNumeric(cid)=false Then response.redirect "about_class.asp"
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class where id ="& cid
	rs.open sql,conn,1,3
	If Not rs.eof And Not rs.bof Then 
		rs.delete
		rs.update
	End If 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao where class_id ="& cid
	rs.open sql,conn,1,3
	Do While Not rs.eof And Not rs.bof 
		rs.delete
		rs.update
	rs.movenext
	Loop 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	response.redirect "about_class.asp"
End If 
If request.form("action")="save" And request.Form("id")="" Then 
	filename=Left(RemoveHTML(request.Form("file")),200)
	If Right(filename,1)<>"/" Then filename=filename&"/"
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class"
	rs.open sql,conn,1,3
	rs.addnew
	rs("class")=Left(RemoveHTML(request.Form("aboutclass")),200)
	'rs("keywords")=Replace(RemoveHTML(request.Form("keywords")),"，",",")
	'rs("contents")=request.Form("contents")
	rs("file")=filename
	rs("muban")=Left(RemoveHTML(request.Form("muban")),200)
	'rs("class_rank")=RemoveHTML(request.Form("newsclass_rank"))
	'rs("addtime")=Now()
	rs.update
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	response.redirect "about_class.asp"
ElseIf request.Form("action")="save" And request.Form("id")<>"" Then 
	id=request.querystring("id")
	If IsNumeric(cid)=false Then response.redirect "about_class.asp"
	filename=Left(RemoveHTML(request.Form("file")),200)
	If Right(filename,1)<>"/" Then filename=filename&"/"
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class where id=" & request.Form("id")
	rs.open sql,conn,1,3
	rs("class")=Left(RemoveHTML(request.Form("aboutclass")),200)
	rs("file")=filename
	rs("muban")=Left(RemoveHTML(request.Form("muban")),200)
	rs.update
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	response.redirect "about_class.asp"
End If 
%>
<div id="wrap">
<div class="header">
	<div class="top">
		<div class="logo"></div>
		<div class="right">
			<div class="admin"><%=myadminuser%> <a href="passwords.asp">修改密码</a> |&nbsp; <a href="login.asp?action=out"> 退出</a></div>
			<div class="clear"></div>
			<div class="top_ico">
			<ul>
				<li><a href="../" target="_blank">浏览网站</a></li>
				<li><a href="http://www.jiruinet.com/" target="_blank">帮助信息</a></li>
			</ul>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="menu">
		<ul>
		<%Call menu(3)%>
		</ul>
	</div>
</div>
<div class="main">
	<div class="left">
	<h2>单页内容管理</h2>
		<ul>
			<li><a href="about_edit.asp" title="" >添加介绍</a></li>
			
			<li><a href="about.asp" title="">单页管理</a></li>
			
			<li><a href="about_class.asp" title="" class="current">单页分类管理</a></li>
			<%
			set rs=server.createobject("adodb.recordset")
			sql="select * from "&jrcms_DB_Pre&"jieshao_class order by id"
			rs.open sql,conn,1,1
			Do While Not rs.eof and Not rs.bof 
			current=""
			response.write "<li  class="""&current&" about""><a href=""about.asp?cid="&rs("id")&""" title="""">"&Left(rs("class"),8)&"</a></li>"
			rs.movenext
			Loop 
			rs.close
			Set rs=Nothing 
			Set sql=Nothing 
			%>
		</ul>
	</div>
	<div class="right">
	<h2>单页分类管理</h2>
	<div class="contents">

	<%
	'file=Day(Now())&Hour(Now())&Minute(Now())&Second(Now())&"/"
	If request.querystring("action")="edit" Then 
	If IsNumeric(cid)=false Then response.redirect "about_class.asp"
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class where id ="& cid
	rs.open sql,conn,1,3
	If Not rs.eof And Not rs.bof Then 
	id=rs("id")
	classname=rs("class")
	file=rs("file")
	muban=rs("muban")
	End If 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	End If 
	If muban="" Then muban="about.html"
	%>
	<form  method="post"  action="about_class.asp"  class="form form-horizontal" id="form-class-add">
		<div class="row cl">
			<input type="hidden" name="action" value="save" />
			<input type="hidden" name="id" value="<%=id%>" />
			<label class="form-label col-2"><span class="c-red">*</span>分类名称：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" placeholder="分类名称不能为空" id="" name="aboutclass" datatype="*" value="<%=classname%>">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">页面目录：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" placeholder="页面目录" id="" name="file" datatype="*" value="<%=file%>">
			</div>
		</div>
		<div class="row cl hidden">
			<label class="form-label col-2">模板文件：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" placeholder="模板文件" id="" name="muban" datatype="*" value="<%=muban%>">
			</div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit">&nbsp; 保 存 &nbsp;</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
<form  method="post"  action="about_class.asp"  id="listform" name="listform">
		<table width="100%" class="list">
			<tr>
				<th width="40">选择</th><th width="150">类别</th><th>页面文件夹</th><!--th width="150">模板</th--><th width="50">修改</th><!--th width="60">静态生成</th--><th width="50">删除</th>
			</tr>
			<%
			set rs=server.createobject("adodb.recordset")
			sql="select * from "&jrcms_DB_Pre&"jieshao_class order by id"
			rs.open sql,conn,1,1
			Do While Not rs.eof And Not rs.bof 
			id=rs("id")
			aboutclass=rs("class")
			file=rs("file")
			muban=rs("muban")
			%>
			<tr class="noclick" onmouseover="this.className='onclick'" onmouseout="this.className='noclick'">
				<td align="center"><input type="checkbox" name="selectid" value="<%=id%>" /></td>
				<td style="padding:10px;font-size:12px;font-weight:900;"><%=Left(aboutclass,8)%></td>
				<td><%=Left(file,70)%></td>
				<!--td style="color:#aaa;padding-left:18px;"><%=muban%></td-->
				<td class="edit"><a href="about_class.asp?action=edit&cid=<%=id%>" title="修改"></a></td>
				<!--td class="edit"><a href="" style="background:url('img/small_ico.gif') 0px -150px no-repeat;margin-left:20px;"></a></td-->
				<td class="edit"><a href="about_class.asp?action=del&cid=<%=id%>" style="background:url('img/small_ico.gif') 0px -243px no-repeat;" title="删除"></a></td>
			</tr>
			<%
			rs.movenext
			Loop 
			rs.close
			Set rs=Nothing 
			Set sql=Nothing 
			%>
		</table>
		<div style="margin:8px 0px;padding-left:21px;font-size:12px;">
		<input onClick='CheckAll(this.form)' type='checkbox' id='submitAllSearch' name="submitAllSearch" value='selectall'> <input class="submit" name="do" onmouseover="this.className='submit2'" onmouseout="this.className='submit'" type="submit"  value="删 除" style="margin-left:22px;font-size:12px;" onClick="{if(confirm('确定要将选中的内容全部删除么')){return true;}return false;}"> </div>
		<div class="clear"></div>
		</form>
	</div>
	</div>
	<div class="clear"></div>
	<div>
	</div>
</div>
 <div id="else" class="clearfix">

 </div>
</div>
<div class="bottom" id="footer">
	<div class="content">
		<div class="left"><%=copyright%></div>
		<div class="right"><%=Email%></div>
		<div class="clear"></div>
	</div>
</div>
</body>
<script type="text/javascript" src="js/Validform/5.3.2/Validform.min.js" charset="utf-8"></script> 
<script type="text/javascript" src="js/H-ui.js" charset="utf-8"></script> 
<script type="text/javascript" src="js/H-ui.admin.js" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
	$("#form-class-add").Validform({
		tiptype:2,
		callback:function(form){
			form[0].submit();
			layer.msg('提交成功，已完成更新！',{icon: 1,time:1000});
		}
	});
});
</script>
<script>
function yn(str,action,id)
	{
	layer.confirm(str, {
	icon : 3,
	title:'信息提示',
	btn: ['确定','取消'] //按钮
	}, function()
		{
		location='<%=Request.ServerVariables("script_name")%>?action='+action+'&id='+id;
		});
	}
function showpic(picid)
{
layer.open({
    type: 1,
    title: false,
    closeBtn: 0,
    area: 'maxwidth',
    skin: 'layui-layer-nobg', //没有背景色
    shadeClose: true,
    content: $('#'+picid)
});
}
</script>
</html>
