⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prockindmng.asp

📁 诚信商店系统源代码
💻 ASP
字号:
<%@LANGUAGE="VBScript"%>
<!--#include file="../public/wxl_conn.asp"-->
<!--#include file="../public/PublicFunction.asp"-->
<%

response.expires = 0
Const PageSize=18
Page=CInt(request("Page"))
if Page<=0 then Page=1
str_pKindID=request("str_pKindID")
wxl=request("wxl")
str_pKindPID=request("str_pKindPID")
if str_pKindPID="" then str_pKindPID="00"

%>
<script language="javascript">
function confirmDel(id){
if ( confirm("你确定要删除分类吗?分类下的所有商品将会被删除!")) {
  window.location.href = "<%=UrlFile&"?str_pKindPID="&str_pKindPID%>&wxl=del&str_pKindID=" + id
  }
}
</script>
<%

if wxl="" then
  LookData()

elseif wxl="ShowOper" then
	ShowOperHtml
elseif wxl="ShowHtml" then
  dim sql1(10)
  sql1(2)=""
  sql1(3)=""
  sql1(4)=""
  sql1(5)=""
  sql1(6)=""
  ShowHtml(sql1)

elseif wxl="Add" then
  str_pKindName=trim(request("str_pKindName"))
  txt_pKindExplain=trim(request("txt_pKindExplain"))
  str_pKindPage=request("str_pKindPage")
  str_pKindPic=request("str_pKindPic")
  str_pKindUrl=request("str_pKindUrl")
  str_pKindPage1=request("str_pKindPage1")
  str_pKindPic1=request("str_pKindPic1")
  str_pKindUrl1=request("str_pKindUrl1")
'////////////
  set sql=Server.Createobject("ADODB.Recordset")
  if str_pKindID<>"" then
      sql.open "select * from web_ProKind where str_pKindID='"&str_pKindID&"'",conn,3,2
	  int_sLogType=1
  else
	  int_sLogType=0
'//////获取部门编号
	  if str_pKindPID="00" then
		str_pKindID=GetID("select Max(str_pKindID)+1 from web_ProKind where len(str_pKindID)=2")
		if len(str_pKindID)=1 then str_pKindID="0"&str_pKindID
	  else
		str_pKindID=GetID("SELECT MAX(mid(str_pKindID, len("&str_pKindPID&")+2, 2)) + 1 FROM web_ProKind WHERE (LEN(str_pKindID) = "&len(str_pKindPID)+2&") AND (LEFT(str_pKindID, LEN(str_pKindID) - 2) = '"&str_pKindPID&"')")
		if len(str_pKindID)=1 then str_pKindID="0"&str_pKindID
		str_pKindID=str_pKindPID&str_pKindID
	  end if
      sql.open "select * from web_ProKind where str_pKindID='"&str_pKindID&"'",conn,3,2
	  sql.AddNew
 	  sql("str_pKindID")=str_pKindID
	  sql("str_pKindPID")=str_pKindPID
      sql("int_pKindShowIndex")=str_pKindID
  end if
  sql("str_pKindName")=str_pKindName
  sql("txt_pKindExplain")=txt_pKindExplain
  sql("str_pKindPage")=str_pKindPage
  sql("str_pKindPic")=str_pKindPic
  sql("str_pKindUrl")=str_pKindUrl
  sql("str_pKindPage1")=str_pKindPage1
  sql("str_pKindPic1")=str_pKindPic1
  sql("str_pKindUrl1")=str_pKindUrl1
  sql.Update
  sql.close
%>
<script language='javascript'>
  alert('分类信息保存成功!');
  window.location.href = "<%=UrlName&"?str_pKindPID="&str_pKindPID&"&MenuId="&MenuId%>";
</script>
<%


elseif wxl="Modi" then
  if str_pKindID="" then Back("未知错误!")
  Query="select * from web_ProKind where str_pKindID='"&str_pKindID&"'"
  set sql=conn.Execute(Query)
  ShowHtml sql

elseif wxl="del" then
  conn.execute("delete from web_ProKind where mid(str_pKindID,1,len('"&str_pKindID&"'))='"&str_pKindID&"'")
  conn.execute("delete from web_ProcLib where  mid(A1,1,len('"&str_pKindID&"'))='"&str_pKindID&"'")
  conn.execute("delete from web_ProcKindOper where  mid(str_pKOperKind,1,len('"&str_pKindID&"'))='"&str_pKindID&"'")

%>

<script language='javascript'>
  alert('分类分类成功删除!');
  window.location.href ="<%=UrlName&"?MenuId="&MenuId&"&str_pKindPID="&str_pKindPID%>";
</script>
<%

'处理显示顺序
elseif wxl="AddOper" then
   MenuNum=request("int_pKOperID").count
   conn.Execute("delete from web_ProcKindOper where str_pKOperKind='"&str_pKindID&"'")
   for i= 1 to MenuNum
    Query="insert into web_ProcKindOper (str_pKOperKind,int_pKOperID) values('"&str_pKindID&"','"&request("int_pKOperID")(i)&"')"
'    response.write Query&"<Br>"
    conn.Execute(Query)
   next
%>
<script language='javascript'>
  alert('栏目管理员保存成功!');
  window.location.href = "<%=UrlFile&"?str_pKindPID="&str_pKindPID%>";
</script>
<%

end if

sub LookData()
  set sql2=server.createobject("ADODB.recordset")
  Query="select * from web_ProKind where str_pKindPID='"&str_pKindPID&"'  order by int_pKindShowIndex"
  sql2.open Query,conn,1,1
  sql2.PageSize=CLng(PageSize)
  if Page>sql2.PageCount then Page=sql2.PageCount
  if not(sql2.eof) then
    sql2.absolutepage=CLng(Page)
  end if
  PageNum=sql2.PageCount
  Rows=sql2.RecordCount

  call HtmlListHead(GetCfgName(str_pKindPID)&"  [分类列表]",sql2.RecordCount,sql2.PageCount,Page,"<a href='"&UrlName&"?wxl=ShowHtml&str_pKindPID="&str_pKindPID&"'>新建分类</a>",UrlFile&"?str_pKindPID="&str_pKindPID)
%>
<TABLE class=coolTable cellSpacing=0 cellPadding=2 altRowColor="oldlace" borderStyle="2">
  <THEAD>
  <TR align=middle>
	<TD align="center" width=60>编号</TD>
    <TD align="center" >名称</TD>
	<TD align="center" width=60>说明</TD>
    <TD align="center" width=50>主管</TD>
	<TD align="center" width=50>广告</TD>
	<TD align="center" width=80>热点推介</TD>
	<TD align="center">操&nbsp;&nbsp;作</TD>
  </TR>
  </THEAD>
  <TBODY>
<%for i=1 to Pagesize
   if sql2.eof then exit for
   %>
  <TR>
    <td ><%=sql2("str_pKindID")%></td>
	<td >
	<%if len(sql2("str_pKindID"))=6 then response.write sql2("str_pKindName") else response.write "<a href='"&UrlFile&"?str_pKindPID="&sql2("str_pKindID")&"'>"&sql2("str_pKindName")&"</a>"%>
	</td>
    <td ><%=sql2("txt_pKindExplain")%></td>
	<td align="center" width=60><a href='<%=UrlFile&"?wxl=ShowOper&str_pKindID="&sql2("str_pKindID")%>'>编辑</a></td>
	<TD align="center" width=60><%="<a href='urlpicmng.asp?KindId="&sql2("str_pKindID")&"'>管理</a>"%></TD>
	<TD align="center" width=60><%="<a href='hotprocmng.asp?KindId="&sql2("str_pKindID")&"'>编辑</a>"%></TD>
    <TD width=70 >
	 <a href=<%response.write(UrlFile&"?str_pKindPID="&str_pKindPID&"&wxl=Modi&str_pKindID="&sql2("str_pKindID")&"&MenuId="&MenuId)%>>修改</a>&nbsp;
     <a href=<%response.write("javascript:confirmDel('"&sql2("str_pKindID")&"')")%>>删除</a>
    </TD>
  </TR>
<%
  sql2.movenext
  next
  if i<>18 then
  for i=i to 18
%>
   <TR>
    <td>&nbsp;</td>
    <td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
  </TR>
<%
  next
  end if
%>    
</TBODY></TABLE>
<%
 HtmlListEnd sql2.RecordCount,sql2.PageCount,Page,"<a href='"&UrlName&"?wxl=ShowHtml&str_pKindPID="&str_pKindPID&"'>新建分类</a>",UrlFile&"?str_pKindPID="&str_pKindPID
end sub


sub ShowOperHtml()
	HtmlHead("分类管理员")
%>
<table border="1" width="500" cellpadding="3" cellspacing="0" bgcolor="#D6D3CE" bordercolordark="#FFFFFF" bordercolorlight="#808080" align="center" >
<form name=form1 action="<%=UrlFile%>" method="POST">
    <tr>
      <td>
<%
set sql=server.createobject("ADODB.recordset")
set sql1=server.createobject("ADODB.recordset")
sql1.open "select * from web_ProcKindOper where str_pKOperKind='"&str_pKindID&"'" ,conn,1,1
sql.open "select int_sOperID,str_sOperName from web_SysOperators where bln_sOperIsDeleted=0",conn,1,1
while not sql.eof
	response.write "<input type='checkbox' name='int_pKOperID' value='"&sql(0)&"'"
	if sql1.recordcount>0 then sql1.movefirst
	do until sql1.eof 
		if sql1(1)=sql(0) then response.write " checked "
		sql1.movenext
	loop
	response.write ">"&sql(1)&"&nbsp;&nbsp;"
	sql.movenext
wend
%>       
      </td>
    </tr>
    </table> 
          <table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#D6D3CE">
            <tr>
              <td height="6"></td>
            </tr>
            <tr>
              <td height="2" align="center">
 			    <input type="submit" value="  保 存" name="B1" class="submit" style="width:60; height:25;">&nbsp;&nbsp;  
                &nbsp; <input type="reset" value="  返 回" name="B2" class="submit" style="width:60; height:25;" onClick="history.back();"></td> 
            </tr>
            <tr>
              <td height="6"></td>
            </tr>
          </table>
		<input type=hidden name="str_pKindPID" value='<%=str_pKindPID%>'>
        <input type=hidden name="wxl" value="AddOper">
        <input type=hidden name="str_pKindID" value=<%=str_pKindID%>>
</form>

<%
	HtmlEnd
end sub

sub ShowHtml(sql)
HtmlHead("分类管理")
set tmpOper=conn.execute("select int_sOperID,str_sOperName from web_SysOperators where bln_sOperIsDeleted=0 order by str_sOperName")
while not tmpOper.eof 
	strOpt=strOpt&"<option value='"&tmpOper(0)&"'>"&tmpOper(1)&"</option>"
	strOpt1=strOpt1&"<option value='"&tmpOper(0)&"'>"&tmpOper(1)&"</option>"
	tmpOper.movenext
wend
%>
  <SCRIPT language=JavaScript>
  <!--
  function checkvalue() {
    aa=document.form1
    if (aa.str_pKindName.value=="") {
        window.alert ("请输入分类名称!"); aa.str_pKindName.focus();return false}
	}


function UpFile()
{

	var html = wxlShowDlg("upload.asp", window, 400, 150);
	if (html) form1.str_pKindPic.value=html;
}


function UpFile11()
{

	var html = wxlShowDlg("upload.asp", window, 400, 150);
	if (html) form1.str_pKindPic1.value=html;
}
//-->
</SCRIPT>
<table border="1" width="600" cellpadding="3" cellspacing="0" bgcolor="#D6D3CE" bordercolordark="#FFFFFF" bordercolorlight="#808080" align="center" >
<form name=form1 action="<%=UrlFile%>" method="POST" onSubmit='return checkvalue();'>
    <tr>
      <td>分类名称:</td>
      <td>
        <input type="text" name="str_pKindName" size=60 value="<%=sql(1)%>">
      </td>
    </tr>
    <tr>
      <td valign=top>分类说明:</td>
      <td>
        <textarea name="txt_pKindExplain" cols=50 rows=10><%=sql(2)%></textarea>
      </td>
    </tr>
    <tr>
      <td>分类模板:</td>
      <td><input type="text" name="str_pKindPage" size=63 value="<%=sql(5)%>"></td>
    </tr>
    <tr>
      <td>分类广告:</td>
      <td><input type="text" name="str_pKindPic" size=25 value="<%=sql(6)%>"><input type='button' name='up1' value='上传'   onClick='UpFile();'>&nbsp;URL:<input type="text" name="str_pKindUrl" size=25 value="<%=sql(7)%>"></td>
    </tr>
    <tr>
      <td>内容模板:</td>
      <td><input type="text" name="str_pKindPage1" size=63 value="<%=sql(8)%>"></td>
    </tr>
    <tr>
      <td>内容广告:</td>
      <td><input type="text" name="str_pKindPic1" size=25 value="<%=sql(9)%>"><input type='button' name='up2' value='上传'  onClick='UpFile11();'>&nbsp;URL:<input type="text" name="str_pKindUrl1" size=25 value="<%=sql(10)%>"></td>
    </tr>
    </table> 
          <table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#D6D3CE">
            <tr>
              <td height="6"></td>
            </tr>
            <tr>
              <td height="2" align="center">
<%If str_pKindID<>"" then%>
<SCRIPT LANGUAGE="JavaScript">
<!--
  //document.form1.str_pKindPage.value='<%=sql(7)%>';
  //document.form1.str_pKindPic.value='<%=sql(8)%>';
//-->
</SCRIPT>
			  <input type="submit" value="  修 改" name="B1" class="submit" style="width:60; height:25;">&nbsp;&nbsp;  
<%else%>
<SCRIPT LANGUAGE="JavaScript">
<!--
 // document.form1.str_pKindPage.value='<%=GetName("select str_pKindPage from web_ProKind where str_pKindID='"&str_pKindPID&"'")%>';
 // document.form1.str_pKindPic.value='<%=GetName("select str_pKindPic from web_ProKind where str_pKindID='"&str_pKindPID&"'")%>';
//-->
</SCRIPT>
			  <input type="submit" value="  确 认" name="B1" class="submit" style="width:60; height:25;">&nbsp;&nbsp;  
<%end if%>
                &nbsp; <input type="reset" value="  返 回" name="B2" class="submit" style="width:60; height:25;" onClick="history.back();"></td> 
            </tr>
            <tr>
              <td height="6"></td>
            </tr>
          </table>
		<input type=hidden name="str_pKindPID" value='<%=str_pKindPID%>'>
        <input type=hidden name="wxl" value="Add">
        <input type=hidden name="str_pKindID" value=<%=str_pKindID%>>
</form>

<%
HtmlEnd
response.write "<br>"
end sub

function GetCfgName(tmpID)
	set tmpCfg=server.createobject("ADODB.recordset")
	i=len(tmpID)/2
	GetCfgName="<a href='"&UrlFile&"?str_pKindPID=00'>分类列表</a>"
	for j=1 to i 
		GetCfgName=GetCfgName&"→<a href='"&UrlFile&"?str_pKindPID="&left(tmpID,j*2)&"'>"&GetName("select str_pKindName from web_ProKind where str_pKindID='"&left(tmpID,j*2)&"'")&"</a>"
	next
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -