<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% if session("admid")=""  then response.redirect"login.asp"%>
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
</head>
<body>
<%
  Select Case Request.querystring("action")
         case "addtech"
		    Set Rs=Server.CreateObject("adodb.recordset")
			  Rs.Open "xiaokan",conn,1,3
			  Rs.addnew
			  Rs("title")=Request.Form("Name")
			  Rs("content")=Request.Form("Content")
			  Rs("pic")=Request.Form("pdf")
			  Rs("pdf")=Request.Form("pic")
			  Rs("Number")=Request.Form("Number")
			  Rs("writer")=Session("Admin")
			  Rs("rar")=Request.Form("rar")
			  Rs("check")=0
			  Rs.update
			  Rs.close
			  Set Rs=Nothing
			Response.Redirect("xiaokan.asp")
		Case "edittech"
		   Set Rs=Server.CreateObject("adodb.recordset")
			  Rs.Open "Select * from xiaokan where id="&cint(Request.QueryString("id")),conn,1,3
			  Rs("title")=Request.Form("Name")
			  Rs("content")=Request.Form("Content")
			  Rs("pic")=Request.Form("pdf")
			  Rs("pdf")=Request.Form("pic")
			  Rs("rar")=Request.Form("rar")
			  Rs("Number")=Request.Form("Number")
			  Rs("writer")=Session("Admin")
			  Rs("check")=0
			  Rs.update
			  Rs.close
			  Set Rs=Nothing
			Response.Redirect("xiaokan.asp")
		Case "checked"
		       If Session("class")<>"1" Then
			    Response.Write("<script language=javascript>alert('您没有权限审核校刊发布');history.back;</script>")
				Response.End()
			   else
			   Conn.execute("update xiaokan  Set [check]=0 where id="&cint(Request.QueryString("id")))
			   Response.Redirect("xiaokan.asp")
			   End If
		Case "check"
		       If Session("class")<>"1" Then
			    Response.Write("<script language=javascript>alert('您没有权限审核校刊发布');history.back;</script>")
				Response.End()
			   else
			   Conn.execute("update xiaokan  Set [check]=1 where id="&cint(Request.QueryString("id")))
               Response.Redirect("xiaokan.asp")	
			   End If
		Case "del"
		    Conn.Execute("delete * from xiaokan where id="&cint(request.querystring("id")))
			Response.redirect("xiaokan.asp")
	   Case "add"				
%>
<table width="500" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="2">+校刊添加</td>
  </tr>
  <form  action="?action=addtech" method="post" name="form1">
  <tr bgcolor="#FFFFFF">
    <td width="114" height="25">校刊</td>
    <td width="363" height="25"><input name="Name" type="text" id="Name"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25">简介</td>
    <td height="25"><textarea name="Content" cols="50" rows="6" id="Content"></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25">校刊图片</td>
    <td height="25"><input name="pdf" type="text" id="pdf">
    <input type="button" name="goimg2 " value="上传图片" onClick="window.open('upload_flash.asp?formname=form1&editname=pdf&uppath=../upload&filelx=jpg','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25">PDF 上传</td>
    <td height="25"><input type="text" name="pic">      &nbsp;
      <input type="button" name="nb" value=" PDF文件 "onClick="window.open('upload.asp?formname=form1&editname=pic&uppath=../upload&filelx=pdf','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
  </tr>
    <tr bgcolor="#FFFFFF">
    <td height="25">rar 上传</td>
    <td height="25"><input type="text" name="rar">      &nbsp;
      <input type="button" name="nb" value=" rar文件 "onClick="window.open('upload.asp?formname=form1&editname=rar&uppath=../upload&filelx=pdf','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
  </tr>
  <%
    Dim num
	 Set Rst=conn.Execute("Select max(number) from tech")
	    num=Rst(0)+1
     Set rst=nothing		
  %>
  <tr bgcolor="#FFFFFF">
    <td height="25">排序</td>
    <td height="25"><input name="Number" type="text" id="Number" size="10" value="<%=num%>"></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="25" colspan="2"><input type="submit" name="Submit" value="提交"></td>
    </tr>
  </form>
</table>
<%
case "edit"
Set Rs=conn.Execute("Select * from xiaokan where id="&cint(Request.querystring("id")))
%>
<table width="500" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="2">+校刊编辑</td>
  </tr>
  <form  action="?action=edittech&id=<%=Rs(0)%>" method="post" name="form1">
    <tr bgcolor="#FFFFFF">
      <td width="114" height="25">校刊</td>
      <td width="363" height="25"><input name="Name" type="text" id="Name" value="<%=Trim(Rs("title"))%>"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25">简介</td>
      <td height="25"><textarea name="Content" cols="50" rows="6" id="Content"><%=Rs("Content")%></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25">校刊图片</td>
      <td height="25"><input name="pdf" type="text" id="pdf" value="<%=Rs("pic")%>">
        <input type="button" name="goimg2 " value="上传图片" onClick="window.open('upload_flash.asp?formname=form1&editname=pdf&uppath=../upload&filelx=jpg','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25">PDF 上传</td>
      <td height="25"><input type="text" name="pic" value="<%=Rs("pdf")%>">
&nbsp;
<input type="button" name="nb" value=" PDF文件 " onClick="window.open('upload.asp?formname=form1&editname=pic&uppath=../upload&filelx=pdf','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
    </tr>
	  <tr bgcolor="#FFFFFF">
    <td height="25">rar 上传</td>
    <td height="25"><input type="text" name="rar" value="<%=Rs("rar")%>">      &nbsp;
      <input type="button" name="nb" value=" rar文件 "onClick="window.open('upload.asp?formname=form1&editname=rar&uppath=../upload&filelx=pdf','','status=no,scrollbars=no,top=220,left=220,width=420,height=165')"></td>
  </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25">排序</td>
      <td height="25"><input name="Number" type="text" id="Number" size="10" value="<%=Rs("Number")%>"></td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="25" colspan="2"><input type="submit" name="Submit" value="提交"></td>
    </tr>
  </form>
</table>
<%
  Rs.Close
  Set Rs=Nothing
%>
<%end Select
  Conn.Close
  Set Conn=Nothing
%>
</body>
</html>
