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

📄 slice_mdy.asp

📁 一个很好的asp cms管理系统
💻 ASP
字号:
<%
Option Explicit
'----------------------------------------------------------------------------------
'本页:
'	碎片编辑页面
'说明:
'
'----------------------------------------------------------------------------------
%>
<!--#include file="inc/Config.class.asp"-->
<!--#include file="inc/DBControl.class.asp"-->
<!--#include file="inc/FunctionLib.class.asp"-->
<!--#include file="inc/Manager.class.asp"-->
<%
Dim Cfg, Db, FLib, Admin
Set Cfg = New Config
Set Db = New DBControl
Set FLib = New FunctionLib
Set Admin = New Manager

If Not Admin.Logined Then
    FLib.Alert "对不起,你已经超时或未登录","./",1
    Response.End
End If

If Not Admin.CheckPopedom("TSYS_GROUP2_SLICE") Then
    FLib.Alert "权限不足", "BACK", 0
    Response.End
End If

Dim Work
    Work = Request("Work")

Db.Open()
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc/style.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript" src="inc/FunctionLib.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function chkForm_AddReco(obj)
{
    if(obj.class_id.value == "")
    {
        alert("请选择[所属频道]");
        return false;
    }
    if(obj.title.value == "")
    {
        alert("请填写[碎片名称]");
        obj.title.focus();
        return false;
    }
	if(obj.start_flag.value == "")
	{
        alert("请填写[定位标签-开始位置]");
        obj.start_flag.focus();
        return false;
	}
	if(obj.end_flag.value == "")
	{
        alert("请填写[定位标签-结束位置]");
        obj.end_flag.focus();
        return false;
	}
	if(obj.file_path.value == "")
	{
        alert("请填写[应用文件]");
        obj.file_path.focus();
        return false;
	}
	if(!GetRadioBox("slice_type"))
	{
        alert("请选择[碎片类型]");
        return false;
	}

    return true;
}

function chkForm_MdyReco(obj)
{
    if(obj.class_id.value == "")
    {
        alert("请选择[所属频道]");
        return false;
    }
    if(obj.title.value == "")
    {
        alert("请填写[碎片名称]");
        obj.title.focus();
        return false;
    }
	if(obj.start_flag.value == "")
	{
        alert("请填写[定位标签-开始位置]");
        obj.start_flag.focus();
        return false;
	}
	if(obj.end_flag.value == "")
	{
        alert("请填写[定位标签-结束位置]");
        obj.end_flag.focus();
        return false;
	}
	if(obj.file_path.value == "")
	{
        alert("请填写[应用文件]");
        obj.file_path.focus();
        return false;
	}
	if(!GetRadioBox("slice_type"))
	{
        alert("请选择[碎片类型]");
        return false;
	}

    return true;
}

function my_RCSelector_Open()
{
	var result = RCSelector_Open(1, document.all.class_id.value, "请选择所属频道");
	if(!result) return false;

	document.all.class_title.innerHTML = result[0].title + "&nbsp;[id:" + result[0].id + "]";
	document.all.class_id.value = result[0].id;
}

function SwitchSliceType(typeId)
{
	document.all["tbody_slice_type1"].style.display = "none";
	document.all["tbody_slice_type2"].style.display = "none";
	document.all["tbody_slice_type3"].style.display = "none";

	document.all["tbody_slice_type" + typeId].style.display = "block";
}

function SliceEditor()
{
    OpenWin("Slice_ReviewWin", "Slice_Review.asp?Work=SliceEditor", 700, 400);
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%
Select Case Work
    Case "MdyPwd" :
        MdyPwd()
    Case "AddReco" :
        AddReco()
    Case "MdyReco" :
        MdyReco()
End Select

Function AddReco()
	Dim Parent, ClassTitle
    Parent = FLib.SafeSql(Request("Parent"))
    ClassTitle = Request("ClassTitle")

	Dim Fso, Fle, SliceTemplate
	Set Fso = Server.CreateObject(Cfg.FileSystemObject_Name)
	Set Fle = Fso.OpenTextFile(Server.MapPath("inc/slice.xml"), 1)
	SliceTemplate = Fle.ReadAll()
	Fle.Close()
	Set Fle = Nothing
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr>
    <td>资源配置 &gt; 碎片管理 &gt; 增加碎片</td>
  </tr>
</table>
<form name="form1" method="post" action="Slice_Process.asp" onsubmit="return chkForm_AddReco(this)">
  <table width="700" border="0" cellspacing="0" cellpadding="3">
    <tr> 
      <td width="25%" align="right">所属频道:</td>
      <td width="75%"><a id="class_title" href="javascript:my_RCSelector_Open();void(0);"> 
        <%If Parent <> "" And ISNumeric(Parent) Then Response.Write ClassTitle & "&nbsp;[id:" & Parent & "]" Else Response.Write "未选择频道" End If%>
        </a> </td>
    </tr>
    <tr> 
      <td align="right">碎片名称:</td>
      <td width="75%"> <input name="title" type="text" class="input_text" id="title" size="60"> 
      </td>
    </tr>
    <tr> 
      <td align="right">碎片类型:</td>
      <td> <input type="radio" name="slice_type" id="slice_type1" value="1"> <label for="slice_type1" onclick="SwitchSliceType(1)">动态碎片</label> 
        <input type="radio" name="slice_type" id="slice_type2" value="2"> <label for="slice_type2" onclick="SwitchSliceType(2)">手工碎片</label> 
        <input type="radio" name="slice_type" id="slice_type3" value="3"> <label for="slice_type3" onclick="SwitchSliceType(3)">静态碎片</label> 
      </td>
    </tr>
    <tr> 
      <td align="right">定位标签:</td>
      <td> <input name="start_flag" type="text" id="start_flag" size="20" class="input_text">
        <input name="end_flag" type="text" id="end_flag" size="20" class="input_text">
        之间</td>
    </tr>
    <tr> 
      <td align="right">应用文件:</td>
      <td width="75%"> <input name="file_path" type="text" id="file_path" value="" size="60" class="input_text"> 
      </td>
    </tr>
    <tbody id="tbody_slice_type1" style="display:none">
      <tr> 
        <td align="right" valign="top">动态碎片数据:</td>
        <td> <textarea name="slice_data1" cols="58" rows="10" wrap="VIRTUAL" id="slice_data1" class="input_text"><%=Server.HtmlEncode(SliceTemplate)%></textarea> 
          <br>
          [<a href="javascript:SliceEditor();void(0);">预览动态碎片</a>] </td>
      </tr>
    </tbody>
    <tbody id="tbody_slice_type2" style="display:none">
      <tr> 
        <td rowspan="2" align="right" valign="top">手工碎片数据:</td>
        <td> <textarea name="slice_data2" cols="58" rows="10" wrap="VIRTUAL" id="slice_data2" class="input_text"></textarea> 
        </td>
      </tr>
      <tr>
        <td><input name="editor_type" type="radio" value="1" checked>
          HTML编辑器 
          <input type="radio" name="editor_type" value="0">
          普通编辑器</td>
      </tr>
    </tbody>
    <tbody id="tbody_slice_type3" style="display:none">
      <tr> 
        <td align="right" valign="top">静态碎片数据:</td>
        <td width="75%"> <input name="slice_data3" id="slice_data3" type="text" size="60" class="input_text"> 
          <br> <span class="txtNote">数据来源可以使用互联网文件下及本地文件</span></td>
      </tr>
    </tbody>
    <tr> 
      <td align="right">备  注:</td>
      <td> <input name="content" type="text" id="content" value="" class="input_text" size="60"> 
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp;</td>
      <td width="75%">&nbsp;</td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp; </td>
      <td width="75%"> <input type="submit" name="Submit43" value="提  交" class="input_button"> 
        <input type="reset" name="Submit223" value="复位" class="input_button"> 
        <input type="button" name="Submit323" value="返回" onClick="window.history.back()" class="input_button"> 
        <input type="hidden" name="Work" value="AddReco"> <input name="class_id" type="hidden" id="class_id" value="<%=Parent%>"></td>
    </tr>
  </table>
</form>
<%
End Function

Function MdyReco()
    Dim Sql, Rs, rId
        rId = FLib.SafeSql(Request("rId"))
        Sql = "SELECT TOP 1 A.*, B.title AS class_title FROM slice_list A LEFT JOIN res_class_list B ON A.class_id = B.id WHERE A.id=" & rId
    Set Rs = Db.ExeCute(Sql)

    If Rs.Eof And Rs.Bof Then
        Rs.Close
        Set Rs = Nothing
        FLib.Alert "记录不存在", "BACK", 0
        Response.End
    End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr>
    <td>资源配置 &gt; 碎片管理 &gt; 修改碎片</td>
  </tr>
</table>
<form name="form1" method="post" action="Slice_Process.asp" onsubmit="return chkForm_MdyReco(this)">
  <table width="700" border="0" cellspacing="0" cellpadding="3">
    <tr> 
      <td align="right">所属频道:</td>
      <td> <a id="class_title" href="javascript:my_RCSelector_Open();void(0);"><%=Rs("class_title") & "&nbsp;[id:" & Rs("class_id") & "]"%></a> </td>
    </tr>
    <tr> 
      <td align="right">碎片名称:</td>
      <td> <input name="title" type="text" class="input_text" id="title" value="<%=Rs("title")%>" size="60"> 
      </td>
    </tr>
    <tr> 
      <td align="right">碎片类型:</td>
      <td> <input type="radio" name="slice_type" id="slice_type1" value="1" <%If Rs("slice_type")=1 Then Response.Write "checked" End If%>> 
        <label for="slice_type1" onclick="SwitchSliceType(1)">动态碎片</label> <input type="radio" name="slice_type" id="slice_type2" value="2" <%If Rs("slice_type")=2 Then Response.Write "checked" End If%>> 
        <label for="slice_type2" onclick="SwitchSliceType(2)">手工碎片</label> <input type="radio" name="slice_type" id="slice_type3" value="3" <%If Rs("slice_type")=3 Then Response.Write "checked" End If%>> 
        <label for="slice_type3" onclick="SwitchSliceType(3)">静态碎片</label> </td>
    </tr>
    <tr> 
      <td align="right">定位标签:</td>
      <td> <input name="start_flag" type="text" id="start_flag" size="20" value="<%=Server.HtmlEncode(Rs("start_flag"))%>" class="input_text">
        <input name="end_flag" type="text" id="end_flag" size="20" value="<%=Server.HtmlEncode(Rs("end_flag"))%>" class="input_text">
        之间</td>
    </tr>
    <tr> 
      <td align="right">应用文件:</td>
      <td> <input name="file_path" type="text" id="file_path" value="<%=Server.HtmlEncode(Rs("file_path"))%>" size="60" class="input_text"> 
      </td>
    </tr>
    <tbody id="tbody_slice_type1" style="display:none">
      <tr> 
        <td align="right" valign="top">动态碎片数据:</td>
        <td> <textarea name="slice_data1" cols="58" rows="10" wrap="VIRTUAL" id="slice_data1" class="input_text"><%If Rs("slice_type")=1 Then Response.Write Server.HtmlEncode(Rs("slice_data")) End If%></textarea> 
          <br>
          [<a href="javascript:SliceEditor();void(0);">预览动态碎片</a>] </td>
      </tr>
    </tbody>
    <tbody id="tbody_slice_type2" style="display:none">
      <tr> 
        <td rowspan="2" align="right" valign="top">手工碎片数据:</td>
        <td> <textarea name="slice_data2" cols="58" rows="10" wrap="VIRTUAL" id="slice_data2" class="input_text"><%If Rs("slice_type")=2 Then Response.Write Server.HtmlEncode(Rs("slice_data")) End If%></textarea> 
        </td>
      </tr>
      <tr>
        <td><input name="editor_type" type="radio" value="1" <%If Rs("editor_type") = 1 Then Response.Write("checked") End If%>>
          HTML编辑器 
          <input type="radio" name="editor_type" value="0" <%If Rs("editor_type") = 0 Then Response.Write("checked") End If%>>
          普通编辑器</td>
      </tr>
    </tbody>
    <tbody id="tbody_slice_type3" style="display:none">
      <tr> 
        <td align="right" valign="top">静态碎片数据:</td>
        <td> <input name="slice_data3" id="slice_data3" type="text" size="60" value="<%If Rs("slice_type")=3 Then Response.Write Server.HtmlEncode(Rs("slice_data")) End If%>" class="input_text"> 
          <br> <span class="txtNote">数据来源可以使用互联网文件下及本地文件</span></td>
      </tr>
    </tbody>
    <tr> 
      <td align="right">备  注:</td>
      <td> <input name="content" type="text" class="input_text" id="content" value="" size="60"> 
      </td>
    </tr>
    <tr> 
      <td align="right" valign="top">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp; </td>
      <td width="75%"> <input type="submit" name="Submit42" value="提  交" class="input_button"> 
        <input type="reset" name="Submit222" value="复位" class="input_button"> 
        <input type="button" name="Submit322" value="返回" onClick="window.history.back()" class="input_button"> 
        <input type="hidden" name="Work" value="MdyReco"> <input type="hidden" name="rId" value="<%=Rs("id")%>"> 
        <input name="class_id" type="hidden" id="class_id" value="<%=Rs("class_id")%>"> 
      </td>
    </tr>
  </table>
</form>
<script language="JavaScript">
<!--
SwitchSliceType(<%=Rs("slice_type")%>)
//-->
</script>
<%
    Rs.Close
    Set Rs = Nothing
End Function
%>
</body>
</html>

⌨️ 快捷键说明

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